Commit graph

335 commits

Author SHA1 Message Date
Neil Guertin
0dad48ad18 Fix failing test multiuser/writer/annotation_spec.js
Wait for animation after annotation save

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Id1be5607e15ac23596e527c3e27fca83c91ee380
2024-01-09 07:58:12 -05:00
Neil Guertin
0dd5dd6f60 Rename getFrame() to cframe()
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I1f220687eb972d4b3d65cb26fe0201b1ccd24993
2024-01-05 07:12:17 -05:00
Szymon Kłos
5ed163faa1 cypress: autofilter dismiss by click outside popup
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ib5a447c9ba772fdc8441b22e98e531505424a6f1
2024-01-05 12:48:47 +01:00
Neil Guertin
80a2f4cca6 Replace cy.cGet with cy.getFrame in document load
And other changes to reduce logs by about
20 lines per test (15% of total)

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ia6a1c96752816c5cd9fb11368cf921bdce9936ff
2023-12-28 14:58:06 +03:00
Szymon Kłos
a4add51e93 calc: avoid jumping on large cell selection
If we had very long or tall cell - maybe bigger than a screen
on every selection we tried to show it on the screen what
caused view to jump. If cell is bigger and partially visible
left view at the same position to avoid "jumping".

Steps to reproduce:
1. merge many cells - longer than one screen width
2. scroll in the middle of merged cell
3. select the cell
Result: jump to the begining
Expected: no jump if it is paritally visible

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I04da5cd346f175728222888a039a796b271e00d1
2023-12-27 20:09:27 -05:00
Neil Guertin
f4c855792f Use new custom command cy.getFrameWindow()
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I4f54b35f01b41bfb47a1d5d359de5cdab4cb9640
2023-12-27 10:06:05 +03:00
Skyler Grey
61aa037ad9 Fix several regressions from touch unification
Touch unification (b3bff28bede07a48cdecefcda14a6fc9da86e4bb, change ID
I9016fc15ad3ccb3664af348fdcdca006495b0778) was a rework of the input
system to better support touch devices, but unfortunately it caused some
fairly serious regressions. This commit fixes the following:
- Triple/Quadruple clicking was no longer recognized on non-touch
  devices.
- There were some issues recognizing wrapped events
- Pens were considered to be touch devices, but this broke some
  remote/virtual machine setups. It's possible that this change will
  cause a regression for apple pencil users. I plan to get an Apple
  pencil to test whether preventing pens from being touch devices breaks
  the Apple pencil workflow instead
- manualDrag was taken to mean "is on a touch device". This is only
  almost true, causing some input to be incorrectly ingnored when it was
  not
- manualDrag and _manualDrag were confused. They affect different
  things, and we now recognize this

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Iab0d3bcca588eaed14469597868a9c4e2dcf8488
Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
2023-12-18 15:28:13 +01:00
Pranam Lashkari
cfc6874c22 cypress: refector mismatching parameter in function call
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I8fa8e4b1e20de0af16368cb23ca641b8d7186bfc
2023-11-24 18:36:26 +05:30
Skyler Grey
e817f03785 Unify touchscreen handling, remove L.Browser.touch
L.Browser.touch is sometimes nice, but it's ultimately a flawed concept
to use it for input events. Using L.Browser.touch for input handicaps
people with mice if it's too liberal in what it classes as touchscreens,
and handicaps people with touchscreens if it's too conservative. There's
also no sweet spot: it's impossible to choose correctly if someone is
using both a touchscreen and a pointer device, as there's no right
option!

Previously many of our event handlers and some of our UI was gated
behind L.Browser.touch. This commit adds a new "window.touch" property
which is used instead. It has functions to help with event detection,
allowing you to easily make event handlers that work for only the input
devices they are designed for, without gating them behind feature
detection. This has the added bonus that - as you register all the
events - switching between a touchscreen and pointer is now not only
possible but already implemented!

For cases which don't have reasonable events to tag onto (e.g. the
teardrop for cursor movement) this commit adds "hasPrimaryTouchscreen"
and "hasAnyTouchscreen" which use the CSS media queries to detect if
there's a touchscreen attached to your device (either as the primary
input mechanism or at all). This works a lot more similarly to
L.Browser.mode, but being dynamically updated allows you to effectively
swich between touchscreen and not at-will. This still has all of the
disadvantages that L.Browser.touch did when used to register event
handlers, so my advice would be to avoid using it with events.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I9016fc15ad3ccb3664af348fdcdca006495b0778
2023-11-22 15:48:06 +01:00
Pranam Lashkari
e71f082412 cypress: introduce writer comment autosave tests
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ic79e9cf935f29ac407a8c5ff3900f2ad1f7449a6
2023-10-31 20:43:58 +05:30
Szymon Kłos
1d6d3806b7 cypress: autofilter: test autofilter on mobile
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I63f05af3f618f150bf6550b03a25ff83dfa9d3b4
2023-09-25 16:41:11 +02:00
Szymon Kłos
cb1c62eda6 cypress: adjust tests to new combobox
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ieb6982abbea68f5d2e8a8215d2a69f10f4123fac
2023-08-31 12:56:10 +02:00
Gökay Şatır
7d084e40cb Update cypress tests.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I1c60f89d6ab68e4a61861d77383010dd7f22480a
2023-08-14 14:24:46 +03:00
Henry Castro
8773e0e050 cypress: cypress logs for cool.html iframe
Also logs unhandled exceptions from iframe cool.html

Change-Id: I6f7b7d1340c8818d3f81916d42d6d9ed2920e35c
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-07-10 10:49:04 -04:00
Henry Castro
3c0731bf2c cypress: add emacs mode lines
Change-Id: I2cb19d34639ea6af55c693fad7bef8855a0ccba3
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-07-10 10:49:04 -04:00
Henry Castro
9bcc79b266 cypress: add option baseURL
Setting a baseURL cypress verify if the server is
running and prevents to refresh when command cy.visit()

Change-Id: I1cffc0932d6a1ec4ee9793eb3935f60e02ca2545
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-07-10 10:49:04 -04:00
Henry Castro
51ae4a836e cypress: logging stack traces of the unit test failing
Change-Id: Ic06c62b1cbd467abe17a5ff859848ca10673b4a4
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-07-10 10:49:04 -04:00
Henry Castro
a32cbb311d cypress: logging unhandled exceptions
Change-Id: I82bd3552fbf0b844492340762899b5c492148eca
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-07-10 10:49:04 -04:00
Henry Castro
a2048ce70d cypress: fix "loadTestDoc" remote server
If it is a remote 'coolwsd' server,
there is no way to rename or copy files.

Change-Id: Ic38302de5ecf3fa08fedd485d6060ede320867bc
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-07-10 10:49:04 -04:00
Henry Castro
ffb0bb8f7e cypress: add option "coolwsd=server:port"
It is useful inspect logs and run unit test
with an already running coolwsd instance.

Change-Id: I6b01316d552e3d12bf63db9cc7e813adb33a20c0
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-07-10 10:49:04 -04:00
Marco Cecchetti
ff34b16947 cypress tests for accessibility toggle ui
Helper functions:
checkAccessibilityEnabledToBe
  check accessibility state independently from current desktop ui
setAccessibilityState
  set accessibility state independently from current desktop ui

Both helper functions check that ui state and a11y support in text
input element are in sync.

Enable/Disable Accessibility Support
  test state toggling and state preservation when switching ui

Typing after switching accessibility state
  check editable area content after toggling accessibility support

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: Icce5ae148024a8abf9b65a90229915f28f720554
2023-07-10 16:02:18 +02:00
Szymon Kłos
c94be3e5f8 formulabar: use IME with new contenteditable
It converts textarea into contenteditable div.
Input is handled by TextInput.js used for document
and already in the past for formulabar. Replaces
usage of keyevents which are not triggered with
eg. Japanese.

Fixes also #6737
Fixes on mobile #6767 requires: https://gerrit.libreoffice.org/c/core/+/153717

New widget consists of text layer with visible content
and cursor layer with selections and cursor. When clicked
it focuses TextInput.js field for typing.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ieb7cf148a5aba80ab790e0b53c3a5ba27f166b73
2023-07-02 18:55:12 -04:00
Marco Cecchetti
2cf2a1e891 cypress: expectTextForClipboard helper function never fails
expectTextForClipboard(expectedText) never fails for any passed
expectedText string
The value returned by the function passed to `then` cypress construct
must not be regarded as an implicit assertion.

I don't see anymore the '\n TEXT" case. It seems that comparing for
equality against the selected plain content is enough.

Fixed some cypress test that was failing after modifying
expectTextForClipboard.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I64ce31fa2127efcc70bbc3da3ac45fe456e66803
2023-06-29 13:43:13 +02:00
Henry Castro
e38bc519ae cypress: fix possible random file duplicates
The failing unit test it is due to a duplicate file
that was modified with new properties.

Change-Id: I02824cfeaf8c496e84dc4e285975e95e79edb9df
Signed-off-by: Henry Castro <hcastro@collabora.com>
2023-06-28 18:15:53 -04:00
Marco Cecchetti
809234805e refactored cypress tests for editable area
Helper functions has been moved to external file:
contenteditable_helper.js

Tests have been subdiveded in groups.

Spec file renamed from editing_spec to editable_area_spec

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: Ifdb18b0de4851a2fc927b3a8fb3b1472165f2b7f
2023-06-15 15:00:18 -04:00
Marco Cecchetti
39be94e852 Force notebookbar ui when a11y is enabled
When accessibility is enabled in coolwsd.xml, overrides setting in
<user-interface> section by force to use the notebookbar UI.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I98f4b288439b21110214ca2a67df639b397184c9
2023-06-15 08:54:51 +01:00
Marco Cecchetti
b9f9cef60a a11y: populating editable area with focused paragraph
We handle notification from core about currently focused paragraph:
content, caret position, text selection start/end.
Notifications are sent on any text changes, even when the text has
been modified in another view.
Moreover we can request such info to core at any time.
That allows AT software to read focused paragraph and selected text.
All that keeping editing still working.
A set of new cypress tests for checking clipboard content has been
developed.

failing cpp unit test:
- HTTPWSTest::testInactiveClient
'unexpected message' assertion was failing since an idle client can
receive an a11yfocuschanged message when the same paragraph has focus
in both view and the active view is editing the paragraph.

failing cypress tests:
desktop
- calc/autofilter_spec.js
  - added more wait time before performing clickOnFirstCell
- impress/undo_redo_spec.js
  - Repair Document was broken
    - we need to select 'Hello world' in order to overwrite it

mobile
- impress/spellchecking_spec.js
  - Apply suggestion
    - better use selectTextOfShape instead of Ctrl-A

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I070d390543fa66fe786c4a0661fa09f891b9883e
2023-05-31 22:43:51 +02:00
Marco Cecchetti
d7e302c94a a11y: TextInput: switch from <textarea> to content editable <div>
Refactored TextInput implementation. A content editable <div> is used
in place of <textarea>.
<img> elements are used as pre/post spaces.
Minimal changes to FormulaBarJSDialog, since some code was
dependendent on
TextInput details.
Refactored some cypress helper funcions, too, since cypress tests
expected a <textarea> element.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I13fd7d5c6446dea054a5a9e88f22ed100a66b3fb
2023-05-31 22:43:51 +02:00
Gökay Şatır
9a680bf2c7 Enable skipped tests in desktop writer top toolbar spec.
Remove notebookbar tag and use switch UI functionality.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I49cfc7340b7ef07d06b0b7c37d24d88127c03735
2023-05-13 10:26:44 +03:00
Gökay Şatır
a2838cca3a Enable desktop writer annotation tests.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I5ee91f32da271b5fdb209262f52a6828aa248500
2023-05-11 19:09:03 +03:00
Gökay Şatır
9d5d153972 Enable desktop impress undo redo spec.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I71f5d43bb1e52e1962db0dfd9e66c6a4a4726e51
2023-05-11 15:28:13 +03:00
Gökay Şatır
e8acb950b0 Enable calc text editing mode test.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ib03f0aa24268a104b6815c813a795c9a21e8e932
2023-05-11 13:55:55 +03:00
Gökay Şatır
71687e1c66 Enable calc switch sheets test.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I1adda596e402a3be116459b3669080844f79ade7
2023-05-11 13:55:55 +03:00
Gökay Şatır
31d70be23f Enable impress text paragraph props test.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I75540d483b71b4d61ad274097c61b3f974be1393
2023-05-10 18:57:53 +03:00
Gökay Şatır
3bb8c28939 Enable calc desktop focus spec.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I5d11a05acbe512c2fd13be8816dbdca7c2464ad9
2023-05-10 08:59:00 +03:00
Gökay Şatır
94db748f1b Enable disabled cell appearance tests.
Add switch UI to notebookbar function to desktop helper.
Remove tagnotebookbar.
Remove clickonidle function calls.

Tests should be more reliable and faster now - tested locally.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I8b05f0b7cf3755ce6e1fe35a26a4ec1154bb2510
2023-05-09 16:09:43 +03:00
Gökay Şatır
cf38a03aac Disable interference test for now.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I73a494cebdfe7dffec1795aa72771d3dd76c494a
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
cf24f725e2 Update multi-user tests.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I75125728e20bee789fce085c31d93b7650312eec
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
83c4ced3f5 Update writer mobile tests.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ibac2beade335519885877c14bc97cda9d02fb3d3
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
5deb474685 Update impress tests.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I0b47edf6e2788b8e3faaef0d0f6aad2ca033782b
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
52b060f984 Update calc mobile tests.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ia16008b638f5f48ad890c80ea04d04515ff3c29a
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
2a1db594ad Update writer desktop tests.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I974bb8ee2e7d77cae29ac97b2c0f6b687e90e005
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
f87539a325 Update impress desktop tests.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I26d0fbf83b894a759c550bee7b0374f367fdd6f8
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
014c7b17b5 Update draw desktop test.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ieea40808df9ff20a1cf4fbda62674651b1d601e8
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
74fa2ab02c Update calc desktop tests.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ia53a5a8a3c783f59254a183341d483640e6a2525
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
c9217176bb Update Cypress and make related changes.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ie896ea22b5591ea5e7d574f2436ece7a31da4c0c
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
2023-05-05 07:07:14 +03:00
Gökay Şatır
54d425c980 Improve Cypress tests and fix one comment related case for Impress.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ib243a70b8a0cf5f3abfd8f713525520f7b152c57
2023-04-24 11:34:04 +03:00
Michael Meeks
91c8803913 Cypress: easy to use debugging hook for failing tests.
Enabled by removing the code comments.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I88ffb02ec2a06f8d717fe1a5b3fba2fe6b5427f8
2023-04-21 19:20:50 -04:00
Jaume Pujantell
72103a4858 only click on toolbar scroll if it's visible
Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: I2f04ee5d49dbad2b630740aa86d4f78c8826307a
2023-04-21 10:03:49 +01:00
Jaume Pujantell
21161cecdd wait before a click that triggers too early
Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: I59e190159f077f67af6ccdb6f40aab0b0b283a61
2023-04-21 10:03:49 +01:00