Commit Graph

1476 Commits (master)

Author SHA1 Message Date
Miklos Vajna 027a87157b cool#8648 clipboard: fix mobile/impress/delete_objects_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I8ba49faa7eb5926993111d03a961f750174d3bea
2024-04-19 09:42:39 +01:00
Miklos Vajna 283b5a1637 cool#8648 clipboard: fix mobile/calc/spellchecking_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I8cc3d77a42d66c80882e44f5cd09ac88f53dfa9c
2024-04-19 09:42:39 +01:00
Miklos Vajna 9ea5add217 cool#8648 clipboard: fix mobile/calc/searchbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I74f253bb7df509c731a6b3bb22a077e1142e4580
2024-04-19 09:42:39 +01:00
Caolán McNamara b95395434e if a sheet is removed or moved, re-request comment positions
a problem since:

commit 72b2ce4bb6
Author: Caolán McNamara <caolan.mcnamara@collabora.com>
Date:   Wed Oct 25 19:19:08 2023 +0100
    we don't need to round-trip through core to reposition notes

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: If00ae17a8e80ca3f8d2a530efa6cdba90207be56
2024-04-18 17:08:28 +02:00
Caolán McNamara 06a6059235 move these common calc annotation test blocks to calcHelper
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ia67e29e447b333f4dfdfe25ec717cbdfc6dce043
2024-04-18 17:08:28 +02:00
Gökay Şatır 9eeed4d950 Add splitCoordinate to global variables.
Fix getViewRectangles function - it's used now.
Remove "_cellCursor" usage from CalcTileLayer.
Modify tests for the new changes.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ia5ec5a6e89d7d64df2041112936a16ec06c4da93
2024-04-18 16:30:27 +03:00
Neil Guertin 908e766282 Fix failing test desktop/calc/top_toolbar_spec.js
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I02944fb4c72bfd19fdeedb944e235633c33021b8
2024-04-18 08:51:42 -04:00
Miklos Vajna 3a1dd02dd1 cool#8648 clipboard: fix mobile/calc/insertion_wizard_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6d8f5429fafa77cc4e3019878c0791555225abd0
2024-04-18 10:14:36 +01:00
Miklos Vajna a12bcd3fb0 cool#8648 clipboard: fix mobile/calc/delete_objects_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Id6e1e2099273d22f9ae9718e18c70afbc27e64e7
2024-04-18 10:14:36 +01:00
Miklos Vajna 2b37f2113f cool#8648 clipboard: fix mobile/calc/cell_appearance_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I72fca080c13b4d0954ba3fff67faaa6a4927ba3e
2024-04-18 10:14:36 +01:00
Miklos Vajna a5d05f2364 cool#8648 clipboard: fix mobile/calc/bottom_toolbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ie60c7a27d88a47f00c9b793a48d4c8e533ac32d2
2024-04-18 10:14:36 +01:00
Miklos Vajna 0c21b6e833 cool#8648 clipboard: fix mobile/calc/autofilter_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: If5ecd80c5b16f8f5f3f1154de6d42ca0cd803773
2024-04-18 10:14:36 +01:00
Szymon Kłos c7dd10a877 statusbar: better strings formatting
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7c5d5cbd2e36e6391610f8d4b18a87bf32c9dde2
2024-04-18 08:00:15 +01:00
Neil Guertin 422df9d8ef Remove extra timeout for closing document
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I4c92893fb55c8884d0b0f417806686c0a6b9bbae
2024-04-17 11:08:56 +02:00
Neil Guertin cb5528c01c Remove noise from logs in closeDocument
Query included the header of the table, which was then
printed in the logs including lots of whitespace noise

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I361f60c9b42972f580ccb10986dd4b3b9400ca0c
2024-04-17 11:08:56 +02:00
Neil Guertin 4e9bb9eba4 Remove wait and skip of close document for failed tests
The bug referenced has been fixed for a long time
so the workaround is no longer necessary

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ifac6555c711a0f142dd5d00ba4f4133dd4aece9f
2024-04-17 11:08:56 +02:00
Miklos Vajna 4c5adb70e6 cool#8648 clipboard: fix mobile/calc/apply_font_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created. This was the first mobile suite that needed fixing.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Iad772d878d20d76bcf3770b7acc6abafa74859b2
2024-04-17 09:43:04 +02:00
Miklos Vajna fdb1f8c7fc cool#8648 clipboard: fix desktop/calc/cell_appearance_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created. This was the last desktop suite that needed fixing.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I428153c89c9ff46dc41541713c13fe19455e0c14
2024-04-17 09:43:04 +02:00
Miklos Vajna 3c9272c1bf cool#8648 clipboard: fix desktop/calc/autofilter_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I7d2f870d7c694ca7305477c614c3ddb698e0c501
2024-04-17 09:43:04 +02:00
Miklos Vajna 25b377efb4 cool#8648 clipboard: fix desktop/calc/delete_objects_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I80c8534b456ec5930a79d8339b297905bb5ba2de
2024-04-17 09:43:04 +02:00
Miklos Vajna 67d38b64a4 cool#8648 clipboard: fix desktop/calc/focus_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I5e6d435fc9322fd5478d78f8e9ba0ef525b6c5cd
2024-04-17 09:43:04 +02:00
Miklos Vajna a8d4a3e859 cool#8648 clipboard: fix desktop/calc/searchbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ib53e71546cc1965f4a1073d507b07caef086c628
2024-04-16 13:47:11 +01:00
Miklos Vajna 5bf298243f cool#8648 clipboard: fix desktop/calc/searchbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6148fdbdff6390c20e454ed9f26c6e55e774cc69
2024-04-16 13:47:11 +01:00
Miklos Vajna e396df494c cool#8648 clipboard: fix desktop/calc/top_toolbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I3562d90ff20963bb77afebb8ea7430586f0b6bbd
2024-04-16 13:47:11 +01:00
Miklos Vajna 7f9c809881 cool#8648 clipboard: fix desktop/calc/undo_redo_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Idb62d8496f8ff9503654ecea1747f097463afb1b
2024-04-16 13:47:11 +01:00
Miklos Vajna c10cc6d8b8 cool#8648 clipboard: fix desktop/impress/delete_objects_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic499b60dde450b32464dc2b8cd959066ac5c2e7e
2024-04-16 13:47:11 +01:00
Caolán McNamara e3d5c168c1 try adding {force: true} to leaflet-layer clicks
error is:

1) Joining a document should not trigger an invalidation
       Join after document save and modify:
     CypressError: Timed out retrying after 10050ms: `cy.click()` failed because this element:

`<div class="leaflet-layer" style="position: absolute; width: 642px; height: 484px;"></div>`

is being covered by another element:

`<div class="jsdialog ui-button-box end" id="">...</div>`

Fix this problem, or use {force: true} to disable error checking.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8b0dde030b2aadf554db75872facb6c5c96a321c
2024-04-16 13:22:56 +02:00
Darshan-upadhyay1110 0d838c26f1 Update cypress test for toolbar_spec
- Now as we hide the button for none edit modified
- we need to check for items visiblity and not the disabled attr
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: Ic0b1765cd12381ea359a8ff65dd88a350d9e9f33
2024-04-15 11:05:29 +02:00
Miklos Vajna 770feebf13 cool#8648 clipboard: fix desktop/impress/undo_redo_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Iff00cdd8e1a8863c09362cefa3a2bfdf6275f837
2024-04-15 09:51:18 +01:00
Miklos Vajna 359e7eca67 cool#8648 clipboard: fix desktop/writer/editable_area_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I60028b22e570d2566a4d64b0cd70150530830852
2024-04-15 09:51:18 +01:00
Miklos Vajna 406dad2128 cool#8648 clipboard: fix desktop/writer/notebookbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I52851e3473532781fb03f2ac9d7c14614c2d7814
2024-04-15 09:51:18 +01:00
Miklos Vajna 1e4afce8a1 cool#8648 clipboard: fix desktop/writer/searchbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ia518a7f60c39109de82e0c9b38185ebe757df1cf
2024-04-15 09:51:18 +01:00
Miklos Vajna 56adf9983e cool#8648 clipboard: fix desktop/writer/table_operation_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ieb789f923357b3ff7749fee0202b15990491cfdc
2024-04-15 09:51:18 +01:00
Miklos Vajna 1f0aec8f19 cool#8648 clipboard: fix insert hyperlink dialog
Type a word into Writer, select it, Ctrl-K, the link text should default
to the selection, but it was empty.

This happens because Toolbar.js getTextForLink() doesn't have the
pre-fetched clipboard anymore, so we return an empty string there.

Fix the problem by triggering a text selection fetch (and leaving the
clipboard alone), and then handling the hyperlink dialog on the
CanvasTileLayer.js side.

Once this is done, the usual dummy clipboard registration & copy() calls
need adding and the test passes even with the patch from
<https://github.com/CollaboraOnline/online/issues/8648#issuecomment-2037278091>.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibd8313588e705c4b027643b452099bbf02cfe8ec
2024-04-12 14:00:26 +01:00
Miklos Vajna 91c702e420 cool#8648 clipboard: fix most of desktop/writer/top_toolbar_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

'Insert hyperlink.' needs more work, leave that one alone for now.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6abdc40e46d5347c8c005c1289b59ef8933f08d2
2024-04-10 08:47:07 +01:00
Miklos Vajna b3f2c690d8 cool#8648 clipboard: fix desktop/writer/track_changes_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I1b674504b682dc7fce2c6a437dc91aadd8065531
2024-04-10 08:47:07 +01:00
Miklos Vajna 635a45aac0 cool#8648 clipboard: fix desktop/writer/undo_redo_spec.js
To work even if we don't automatically fetch HTML when a text selection
is created.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic55ddf984d8605c8627e87454a4b4916e15523d1
2024-04-10 08:47:07 +01:00
Miklos Vajna 803df018da cool#8648 clipboard: fix desktop/calc/clipboard_spec.js
Move two functions from desktop/writer/copy_paste_spec.js to
common/helper.js, this way desktop/calc/clipboard_spec.js can do an
explicit Copy and then it passes even with the async copy.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I7874f0ac00a4237a90015b0fbcd67dcfd2e9ad68
2024-04-10 08:47:07 +01:00
Miklos Vajna 286cd1ccf7 cool#8648 clipboard: fix desktop/writer/copy_paste_spec.js
Once the patch from
<https://github.com/CollaboraOnline/online/issues/8648#issuecomment-2037278091>
is applied to make CanvasTileLayer.js _onTextSelectionMsg() not fetch
the clipboard proactively, this test started to fail.

This happened because the test assumed that once a text selection is
created, we have the HTML for it, which is no longer the case.

Fix the problem by extending the dummy clipboard code to also handle
plain text and by adding a function which triggers the copy(), to
minimize the changes to the actual test code.

This is just a start, lots of other tests still need fixing, and once
the pattern is clear, common code should be extracted to
cypress_test/integration_tests/common/helper.js, probably.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I21ed1143470fa8026e133b0519e114a40fc0ed90
2024-04-09 07:52:33 +01:00
Miklos Vajna 75251f9496 cool#8648 clipboard: try to use navigator.clipboard.write()
For one, getting the selection HTML all the time when we create a text
selection is a waste of resources, since only a subsequent copy needs
that HTML. For another, the complex selection case required a confusing
"two step copy" workflow, where first you press Ctrl-C, then you
download the large selection, finally you press Ctrl-C again.

The underlying problem is the same: the document.execCommand() API for
copy (and cut) is synchronous, but network operations are async, which
don't play well together.

Fix the problem by trying to use navigator.clipboard.write() instead:
the write() call still has to happen inside a magic security context
(keyboard used, click happened), but it can take a callback as a
parameter, and inside that callback it's fine to perform async network
operations, which allows both using a one-step copy and getting rid of
the HTML download on text selection change (when most of the time we
don't need it).

Tested:

- Chrome and Safari; the behavior for Firefox is unchanged, unless
  about:config opts in to expose the new Clipboard API.

- HTML, plain text and image copy.

- Cut, not only copy.

- Doing this with the notebookbar button & keyboard.

- A single cypress test now uses a fake clipboard to assert copy. The
  rest of the tests are left unchanged for now, but likely we need to
  get rid of this implicit assumption that the copy container is updated
  on selection change: different behavior for automated vs manual testing
  is ugly.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ifcf16474a339f3f1dae3dc99181836e645340048
2024-04-04 14:09:42 +01:00
Szymon Kłos 2d023ec77f jsdialog: handle select/unselect in toolitems
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I877d1803ba4605c4b82cb2adee2bb6c4226381a4
2024-04-04 13:43:35 +02:00
Szymon Kłos f8d457cb62 remove-w2ui: convert mobile bottom bar to JSDialog
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I1e86d91282d15c6ed055f9a74808cd3158ff08de
2024-04-04 13:43:35 +02:00
Szymon Kłos 13a16ace0a remove-w2ui: convert mobile search bar to JSDialog
- fix typo in cypress function name
- unify mobile and desktop searchbar controls

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2212f588ca720634b073111b1c78f10c6ee6b7ea
2024-04-02 15:02:53 +02:00
Szymon Kłos ad5826e4c3 cypress: make mobile toolbar tests more reliable
- wait for enabled state
- then click internal button

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7663deb668de2e98b007fbace60386a4a7157058
2024-04-01 14:04:08 +03:00
Szymon Kłos db86e87c30 cypress: make table_operation_spec.js more reliable
- it failed due to click on disabled button
- make waiting for idle click be aware of that
- add small waits after doing table changes to
  allow updates to be applied

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: If19352923aeca4c18024f3a2ffcc3731a8aff96f
2024-04-01 14:04:08 +03:00
Szymon Kłos fb017302f1 remove-w2ui: convert mobile top bar to JSDialogs
- use dispatcher to invoke commands
- TODO: checked state for buttons + cypress check

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I652a163ea0c831b47ce7725ffd0f9f190a98d9bf
2024-04-01 14:04:08 +03:00
Szymon Kłos f2e9dee701 cypress: fix multiuser tests after w2ui removing
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I53c5ed04a3ba3f63ebbca8f2322e34cf8f707a04
2024-03-29 21:55:23 +01:00
Szymon Kłos d9dd67e0f9 cypress: skip failing Enable/Disable autofilter
it has problem with opening menu

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I72900aeee7a0d4548ae5281ff2ea3c16090ec736
2024-03-29 21:55:23 +01:00
Szymon Kłos 9f6ae3bf54 cypress: be more tolerant for scroll ranges
so we will not fail with some themes used
also not fail when we didn't show sidebar switch
on the toolbar

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id511004176dcf91b553417a74cb3b71c239873eb
2024-03-29 21:55:23 +01:00
Szymon Kłos ebff222073 remove-w2ui: convert TopToolbar to JSDialog
- reuse old code as much as possible
- font, fontsize, style are managed by old select2 wrapper
- move some commands to dispatcher

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2fd1820b36f3c63a5fdcc482afbcc5ffe04e299f
2024-03-29 21:55:23 +01:00
Szymon Kłos 6a452d9023 remove-w2ui: convert status bar to JSDialog
- move plain html controls into HTMLContent widget
- reuse scrollable bar from notebookbar
- use dynamically loaded menu entries in MenuButton
- allow to update MenuButton which contains menu id in the id

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2b77479520c03420fefeb32dd09d6b34279e5686
2024-03-29 01:40:29 +01:00
Marco Cecchetti 959f9b5467 calc: fix regression due to core commit: 8f7dd2340b7
The core commit 'show cell cursor on in place editing' introduced a
regression: cell cursor messages grabs focus from the formula bar when
used for editing. The regression was causing the failure of
desktop/calc/focus_spec.js cypress unit test.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: If4274cc510af065feb7aa13806a86746302b22b2
2024-03-27 09:12:48 +01:00
Marco Cecchetti acefa3f357 calc: fixed bogus cell view cursor overlay
On switching tab not clear other view messages saved for replay.
Added cypress unit tests for checking the cell view cursor bounds.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I788828783a86038bb9d7f26648925b0e03bd560a
2024-03-26 20:34:45 +01:00
Neil Guertin b21b4b98a3 Use escape in removeShapeSelection
Creates more reliable svg dom

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ie8adb7b2e543c93a4a23c49dd84aac973543f208
2024-03-25 09:33:03 -04:00
Neil Guertin 786ad1c84b Rewrite desktopHelper.insertComment()
Replace four helper functions (insertMultipleComment setupUIforCommentInsert
createComment saveComment) with one (insertComment)
Simplify code flow
Remove unneeded docType conditionals
Remove unneded identical arguments from every call
Add more relevant assertions
Use force click to remove extra toolbar clicks

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ia4bc4ac964fd0ee754a481843d55682b87b63086
2024-03-25 09:31:27 -04:00
Neil Guertin e70143b09f Cypress calc helper: make assertDataClipboardTable retriable
Finally, a robust solution for checking sheet contents
Uses .should() to make a retriable assertion, subject to normal
timeouts and with no need to wait before.
Fixes sporadic failures in desktop/calc/autofilter_spec.js

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I9c4e36b3bcdf0968e9b95237f3f17f284d2628de
2024-03-25 09:31:20 -04:00
Szymon Kłos ae5e33b30c remove-w2ui: convert presentation toolbar to JSDialogs
- it is on the left below slides list
- handle disabled state in CSS for regular unotoolbuttons

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iebff6e7db0234a4f61c532397bab697c1071595d
2024-03-25 10:48:46 +01:00
Szymon Kłos 5355042687 remove-w2ui: convert sheets toolbar to JSDialog
- SheetsBar is on the bottom in Calc, with buttons + tabs
- add callabck for edit field - only fired after ENTER
  this fixes issue from FormulaBar conversion to JSDialog
- fix cypress mobile
- simplify CSS

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7a286c87564e5ee0a89055ab4faa4daef9af31f5
2024-03-23 18:46:16 +01:00
Szymon Kłos f29a7c63df Skip failing writer/tracked_changes_spec.js for now
Comment Undo-Redo:
     AssertionError: Timed out retrying after 10000ms: expected '<div#comment-container-2.cool-annotation.cool-annotation-collapsed-show>' to have class 'tracked-deleted-comment-show'

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iae9361e5189ec8795a6dc6e0ac83cc99d653a538
2024-03-22 13:10:31 +01:00
Szymon Kłos 1945c79169 Skip failing mobile/calc/bottom_toolbar_spec.js for now
Merge cells:
     AssertionError: Timed out retrying after 10000ms: Expected to find element: `#copy-paste-container table td`, but never found it. Queried from:

              > cy.get(#coolframe, [object Object]).its(0.contentDocument, [object Object])
      at Context.eval (integration_tests/mobile/calc/bottom_toolbar_spec.js:74:50)

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8ecca00d9a1c5cc35949b4b6f875092b487d60c4
2024-03-22 13:10:31 +01:00
Neil Guertin c73cab4479 Fix failing test mobile/calc/spellchecking_spec.js (forward port)
Test failed in 23.05 because of a change in .leaflet-marker-icon
Rewrite openContextMenu and remove uses of .leaflet-marker-icon

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Iecfacdd192ea723001ed56e6c9f0c32645a6af2c
2024-03-22 13:10:31 +01:00
Szymon Kłos 5359806efb Skip failing calc/focus_spec.js for now
This is a regression from the following change:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=8f7dd2340b7cc593f1abfea7fbdc22e2d7ec6324
https://gerrit.libreoffice.org/c/core/+/164880

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8f01ffadf91cea8941d264f03bcc6b371a4a9248
2024-03-22 13:10:31 +01:00
Szymon Kłos 5efe701294 Reenable cypress mobile tests
Partial revert of commit aa259d7337.
Also make idle tests run before multiuser

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I87024193d81bcadc9ea77e9033dceb3c6250d966
2024-03-20 08:46:49 -04:00
Neil Guertin e7782149e1 Skip mobile/calc/cell_appearance_spec.js border test
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ife1faecf4471292f1aaddd98adc0b57329a8807d
2024-03-20 08:46:49 -04:00
Neil Guertin 4d4f999f24 Skip mobile/impress/apply_paragraph_props_text_spec.js
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I299ddd958e26c49746ce77f1a1e9fca383779ed3
2024-03-20 08:46:49 -04:00
Neil Guertin 42a36b9afb Fix mobile/impress/apply_font_text_spec.js
Exclude placeholder text
Fix removeShapeSelection detection

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ie8cfd791ae4468fa6994e3a49efe05577e7aae37
2024-03-20 08:46:49 -04:00
Neil Guertin 83d8df81bd Fix mobile/writer/apply_font_spec.js FontColor tests
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I47ed365d9f3b3d884ea883aa0834e39f563feab3
2024-03-20 08:46:49 -04:00
Szymon Kłos bde997dfa8 remove-w2ui: use JSDialog for formulabar
- remove w2toolbar
- use JSDialog instead
- remove Leaflet class, use ES6 class

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I94fd17983cd727eefdd5b43f5b93d4319f15f3b0
2024-03-19 17:39:24 +01:00
Jaume Pujantell 1f1eab4d99 add test for font input focus
Add a cypress test for the change in commit dfe1e1b5

Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: Id829d271efe7ccebf58c9f83cc67e6b1cf8b72e9
2024-03-18 15:27:56 +01:00
Neil Guertin 187512aa58 Fix desktop/calc/focus_spec.js
Wait for formula bar buttons before typing

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I0603fee2acd7ba3090f7b8536a5e5d6f18a52179
2024-03-18 10:02:56 -04:00
Szymon Kłos 361039c528 remove-w2ui: reuse MenuButton for color picker button
- reuse MenuButton as base for colorControl
- add only last color indicator and activation on left side button
- make possible to clreate split button from unotoolbutton

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8cd20149cc5bc25bedf4e0b0c56fc93d53339f4b
2024-03-18 12:58:02 +01:00
Pranam Lashkari 77f3361654 cypress: fixed tests after textbox/shape svgs updates
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I0fd693c373dd996ed926f65b7df64a531048476d
2024-03-15 09:23:27 +00:00
Szymon Kłos aa259d7337 cypress: disable mobile, idle, multi tests for now
so we will check desktop only which can pass

This change should be reverted after we fix problems

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id34bf6446c7ea56fc8dd8ddf750abafd693c0aa1
2024-03-13 18:49:07 +01:00
Szymon Kłos ba8a3fd60b cypress: disable failing draw/pdf_page_up_down_spec.js
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ia795fae9e852453d47f8afeb33150041fb21eb4b
2024-03-13 18:49:07 +01:00
Szymon Kłos 10950c599e cypress: disable some failing svg checks
It fails on triggerNewSVGForShapeInTheCenter()

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2693ea645a4103ecfd51db0405022764a0130d5a
2024-03-13 18:49:07 +01:00
Szymon Kłos e1f1003599 jsdialog: correctly enable/disable widgets
this fixes cypress test: desktop/impress/jsdialog_spec.js

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8e80b1e3721394e18e21902ad7794b526f5da7a5
2024-03-13 18:49:07 +01:00
Szymon Kłos f71b03484b cypress: fix insert image tests
`<div class="unotoolbutton notebookbar ui-content unospan-home-insert-graphic unoInsertGraphic no-label" tabindex="-1" id="home-insert-graphic" title="Image">...</div>`

is being covered by another element:

`<div class="w2ui-scroll-right" style="display: block;"></div>`

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Idc5aa7b6ca1c7c9a601b07e60ba76d980dc07ae2
2024-03-13 18:49:07 +01:00
Neil Guertin be851931ea Cypress: log helper function start and end
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I61812b730fa58ee1c2969f4ded84b08f5eca981a
2024-03-13 13:21:20 -04:00
Szymon Kłos 661edaeea0 remove-w2ui: use MenuButton for borser style dropdown
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7d9dfe1015e7488f0d127b39f6abcbda0158800b
2024-03-11 15:21:45 +01:00
Szymon Kłos 16b9294b6a remove-w2ui: reuse JSDialog menus for Paste
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I1e2a8772c079fea0f464a7f1cf41e9a8faf26889
2024-03-11 15:21:45 +01:00
Szymon Kłos 98ac4ccd22 remove-w2ui: reuse JSDialog menus for LanugageMenu
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ica44237bb054d0e1a16eed1f9f062b948497181c
2024-03-11 15:21:45 +01:00
Szymon Kłos 07da50acc3 remove-w2ui: use JSDialog.Dropdown in MenuButtons
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I9a5bec468a64ef8cfa9868ef3a61b9d308106c94
2024-03-11 15:21:45 +01:00
Szymon Kłos 7de8d56429 cypress: make hide sidebar button click reliable
Timed out retrying after 10050ms: `cy.click()` failed because this element:     `<td id="tb_editbar_item_sidebar" style="" class="" valign="middle" title="Sidebar">...</td>`

is being covered by another element:

`<div class="w2ui-scroll-right" onmousedown="event.preventDefault()" onclick="var el=w2ui['editbar']; if (el) el.scroll('right');" style="display: block;"></div>`

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ifa8aa4e9229c3c909b7f118c008904a78d0cd38b
2024-03-08 19:25:52 +01:00
Miklos Vajna 7f9de46688 cool#8465 clipboard: improve handling of plain text copy, simple case
Currently the current selection is always requested as HTML by the
browser, and then we ask the browser to convert it to plain text.

The problem is that e.g. Writer can produce much better plain text from
its model, compared to the plain text by the browser, e.g. bullet
characters for bullet points.

Fix the problem by:

- CanvasTileLayer.js, _onTextSelectionMsg(): requesting both HTML and
  plain text. Use ',' as a separator, as that's already established,
  e.g. the HTTP Accept header does that already

- Switching the textselectioncontent protocol message from just HTML to
  JSON that contains both HTML and plain text. This is produced in
  ChildSession::getTextSelection() and parsed in CanvasTileLayer.js,
  _onMessage()

- Clipboard.js, setTextSelectionHTML(): allowing setting both HTML and
  plain text.

- ClientSession::postProcessCopyPayload(): knowing if the content to be
  processed is HTML-in-JSON or just HTML, do additional escaping in the
  JSON / textselectioncontent case, but leave the other clipboardcontent
  case unchanged.

So far this only handles the simple case, the behavior for complex
selections are left unchanged for now. The payload is also unchanged
when a single format is requested, as many tests depend on test.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I2fe1378a8d50b7901ac9e808eb78858cd8ff8575
2024-03-08 13:54:10 +00:00
Neil Guertin 1dbed001b6 Fix click in impress annotation tests
There are now two .avatar-img elements after recent user list changes

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ia229422b4dc3e90ede240e36927b4615091cb97d
2024-03-06 15:08:29 +00:00
Pranam Lashkari bfe0c5e7de annotation: remove obsolete mobile wizard popup code
it was introduced in 13bc532
and it was removed from use in 2f77b3a

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Iec401a9505491fe69196cdb1e7192fa499d3d38f
2024-03-04 07:41:16 +01:00
Szymon Kłos 3d56af0ab5 Add KeyboardShortcuts and disable multi-sheet selection
This will be a class for storing keyboard shortcuts in
a unified way. We can easily define shortcuts for different
languages so we don't have to write long if-statements
which can cause problems if done not very carefully.

Added tests protecting from regressions.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I4dfa2d757eab4ecc1f21279e68d1ee97ae261dc5
2024-03-01 08:59:36 +01:00
Szymon Kłos 22a452bb48 cypress: test for jumps when switching tabs in calc
Protect us from regressions.

We had issues with jumping view in calc, it was related to
switching tabs (not all was visible in the UI).

One case was repeated selection of the same tab.
Second one was using a keyboard shortcut to select multiple
sheets (ctrl + shift + page up/down).

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Icda723ee51b1a4aa8876208d52b4739ca380bb78
2024-03-01 08:59:36 +01:00
Szymon Kłos ef9b536c89 Cypress Test: use widget which depends on core to test properly
Previously used combobox dropdown is online-only so it
will not block editing.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: If6bc092e8bc32ef78c63e8e7cf76922682bc0f19
2024-02-29 16:23:39 +01:00
Darshan-upadhyay1110 df465f3782 Cypress Test: Verify cell is editable after idle mode ends
- it should cover cases like all pop dialogs should be closed for idle mode
- cell should be editable after we re-activate the screen

Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: I34c681ebffdc0107f8787ddc0ad16e5fa35c2f0c
2024-02-29 16:23:39 +01:00
Neil Guertin 0700a5a314 Fix desktop/writer/statusbar_spec.js
Close confirm overwrite dialog after pressing insert

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I4dacb731c70b1bfd9bcbc2134f6e3cd7e242d468
2024-02-29 07:19:04 -05:00
Neil Guertin dc72922f1e Fix failing impress text positioning tests
Exact positions have changed between core 23.05 and core 24.04.
Allowed for a range because failures report different positions
on different machines.

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Iec8024a4e2c8d310748c3b9f52dcb9b325d1529b
2024-02-27 13:39:06 +01:00
Neil Guertin 6cd22f1f40 Update impress tests
Move selection from beforeAll to each testpoint
Remove clickOnIdle

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I1ef87e7df34319c4a1307695ffaa0011b6dbb4cd
2024-02-27 13:39:06 +01:00
Neil Guertin 5162b7b050 Simplify text element selection in impress tests
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ie24dc99f9cfba7b2b563dd168154087c1c7f8b6c
2024-02-27 13:39:06 +01:00
Neil Guertin 597bb4c1ee Fix zoom button click in cypress tests (part 2)
Use force click on buttons instead of scrolling the statusbar to make
them visible

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ib6e7eadcfb02f47e7bd4b44c71f44387f0b19168
2024-02-24 17:23:37 +05:30
Pranam Lashkari e114aa1ce8 cypress: replace incorrect class name checking
regression from 4a2e256

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Icddb4e5ef631574773e716e02df1a20ac078d44f
2024-02-24 17:23:14 +05:30
Neil Guertin 00c492f3c5 Fix zoom button click in cypress tests
Use force click on buttons instead of scrolling the statusbar to make
them visible

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I58f9571dd31d775cadd586f49a545bbc2198471c
2024-02-22 16:11:31 -05:00
Neil Guertin 962331a1bb Replace assertDataClipboardTable with assertSheetContents
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ic1f7cf6e41b7841a8a11ce0a5d23bdc6d7baf9b8
2024-02-22 09:24:59 -05:00
Neil Guertin f5073cb7ed Fix sporadically failing autofilter test
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I71dfd8f98e41f799b33ca13a6a8b6fab78fb94f6
2024-02-22 09:24:59 -05:00
Miklos Vajna 8d931d8ea4 cool#8292 browser, clipboard: fix navigator.clipboard error handling
If the notebookbar's paste or paste special button is pressed and
Chrome's clipboard permisson popup is rejected, then nothing happened,
while Firefox case was showing a more helpful popup, explaining the
problem.

This has two sides: error handling should be better and also the error
should not happen in the first place. The error can also happen when the
<iframe> is not set up correctly, but that's to be handled on the
nextcloud side.

When there *is* an error, improve error handling by restoring the
codepath that matches Firefox:

- extract the rest of the code after invoking the async clipboard read
  in _execCopyCutPaste() to a new _afterCopyCutPaste()

- paste case: invoke _afterCopyCutPaste() when the paste fails

- paste special case: only pretend we're in paste special mode if the
  success fallback is called

  - if the failure callback is called, then invoke
    _openPasteSpecialPopup()

With this, the "has async clipboard, but the permission request
rejected" and the "don't have async clipboard" codepath matches.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I727f00a1cf94dd1837e15e60410e1798de5daecc
2024-02-19 12:18:20 +00:00