Commit Graph

276 Commits

Author SHA1 Message Date
Suguru Hirahara
a81940b62a
Update existing Cypress tests - use Cypress Testing Library (#10755)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-05-01 20:13:24 +00:00
Suguru Hirahara
30ac950523
Emulate TabbedView's actual min and max widths on user settings tabs (#10737)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-28 08:13:04 +00:00
Suguru Hirahara
326e217d3f
Enable Jest and Percy snapshots for PreferencesUserSettingsTab (#10701)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-27 18:11:48 +00:00
Suguru Hirahara
d1a1506572
Update tests related to user onboarding - use Cypress Testing Library (#10728)
* Update user-onboarding-old.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Update user-onboarding-new.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-27 17:12:05 +00:00
Suguru Hirahara
fcf2fe2c1d
Update read_events.spec.ts - use Cypress Testing Library (#10719)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-27 10:37:58 +00:00
David Robertson
8eac9f821a
Rename sliding-sync.ts to sliding-sync.spec.ts (#10723)
Follow up to #10709. Will hopefully make the CI on matrix-org/sliding-sync greener.

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-27 10:33:20 +00:00
Michael Telatynski
e1f7b0af2c
Offload some more waveform processing onto a worker (#9223) 2023-04-27 11:02:20 +01:00
alunturner
ca25c8f430
Commands for plain text editor (#10567)
* add the handlers for when autocomplete is open plus rough / handling

* hack in using the wysiwyg autocomplete

* switch to using onSelect for the behaviour

* expand comment

* add a handle command function to replace text

* add event firing step

* fix TS errors for RefObject

* extract common functionality to new util

* use util for plain text mode

* use util for rich text mode

* remove unused imports

* make util able to handle either type of keyboard event

* fix TS error for mxClient

* lift all new code into main component prior to extracting to custom hook

* shift logic into custom hook

* rename ref to editorRef for clarity

* remove comment

* try to add cypress test for behaviour

* remove unused imports

* fix various lint/TS errors for CI

* update cypress test

* add test for pressing escape to close autocomplete

* expand cypress tests

* add typing while autocomplete open test

* refactor to single piece of state and update comments

* update comment

* extract functions for testing

* add first tests

* improve tests

* remove console log

* call useSuggestion hook from different location

* update useSuggestion hook tests

* improve cypress tests

* remove unused import

* fix selector in cypress test

* add another set of util tests

* remove .only

* remove .only

* remove import

* improve cypress tests

* remove .only

* add comment

* improve comments

* tidy up tests

* consolidate all cypress tests to one

* add early return

* fix typo, add documentation

* add early return, tidy up comments

* change function expression to function declaration

* add documentation

* fix broken test

* add check to cypress tests

* update types

* update comment

* update comments

* shift ref declaration inside the hook

* remove unused import

* update cypress test and add comments

* update usePlainTextListener comments

* apply suggested changes to useSuggestion

* update tests

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2023-04-27 07:37:47 +00:00
Michael Telatynski
86ea059de6
Make cypress happy about spec files all containing tests (#10709) 2023-04-25 15:42:59 +00:00
Michael Telatynski
4b1b9b17ef
Update roles cypress is looking for (#10708)
* Update roles cypress is looking for

* Fix sliding sync test
2023-04-25 14:46:18 +00:00
Michael Telatynski
a1a087f755
Fix usages of ARIA tabpanel (#10628)
* RovingTabIndex handle looping around start/end

* Make TabbedView expose aria tabpanel/tablist/tab roles

* Fix right panel being wrongly specified as aria tabs

Not all right panels map to the top right header buttons so we cannot describe it as a tabpanel relation

* tsc strict

* Update snapshots

* Fix ARIA AXE violation

* Update tests
2023-04-25 09:31:54 +01:00
Suguru Hirahara
e24e85f7a5
Merge set-integration-manager.spec.ts with general-user-settings-tab.spec.ts (#10698)
* Merge `set-integration-manager.spec.ts` with `general-user-settings-tab.spec.ts`

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Remove `set-integration-manager.spec.ts`

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Remove a duplicate command

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-24 07:56:25 +00:00
Suguru Hirahara
893feed13b
Remove a redundant snapshot - 'Manage integrations' on General settings tab (#10689)
This snapshot became redundant thanks to a new one on general-user-settings-tab.spec.ts (User settings tab - General), and should be removed to reduce the usage of quota.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-21 13:41:48 +00:00
Suguru Hirahara
259b5fe253
Update threads.spec.ts - use Cypress Testing Library (#10680)
* Set within()

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Use findByRole("textbox")

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Use findByText()

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Apply findByRole() to reaction and emoji picker

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Use findByText() and findByRole() for removing a message

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Apply findByRole() to the close button

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Replace other commands

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-21 09:45:10 +00:00
Suguru Hirahara
05ef1d5560
Update sliding-sync.spec.ts - use Cypress Testing Library (#10618)
* Update sliding-sync.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Use findByRole() - group, treeitem

The elements with ARIA "treeitem" role resides in ones with ARIA "group" role such as Favourites, People, and Invites. The elements with the "treeitem" role correspond to rooms on the room list.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Use the library more - 'should render the Rooms list in reverse chronological order by default and allowing sorting A-Z'

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Use cy.findAllByRole("treeitem")

Note the Test room is excluded from being counted thanks to within().

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Rename the rooms to avoid confusion

Since it has been unclear "Join" etc. is a verb or a room name, the room
names are changed as below:

- Join -> Room to Join
- Reject -> Room to Reject (the invite)
- Rescind -> Room to Rescind (the invite)

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Specify ARIA label for the room sublist headers

Have different ARIA labels specified for "mx_RoomSublist" and "mx_RoomSublist_headerContainer" to clarify the structure.

Change the test to check the new ARIA label.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* lint

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix a race condition

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Revert "Specify ARIA label for the room sublist headers"

This reverts commit 193a47de4c0fac4139d7c689fa020d6f0acc6819.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix realHover() target

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-21 09:32:26 +00:00
Suguru Hirahara
5445ee85cd
Update spaces.spec.ts - use Cypress Testing Library (#10620)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-20 21:36:44 +00:00
Michael Telatynski
2da52372d4
Add arrow key controls to emoji and reaction pickers (#10637)
* Add arrow key controls to emoji and reaction pickers

* Iterate types

* Switch to using aria-activedescendant

* Add tests

* Fix tests

* Iterate

* Update test

* Tweak header keyboard navigation behaviour

* Also handle scrolling on left/right arrow keys

* Iterate
2023-04-20 14:56:21 +00:00
Suguru Hirahara
467c52a2ae
Add E2E test - general-user-settings-tab.spec.ts (#10658)
* Add E2E test: `general-user-settings-tab.spec.ts`

Initial implementation

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* lint

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Check an input area for a new email address too

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-20 13:18:19 +00:00
Richard van der Hoff
2cec8b5a44
Add Cypress tests for the "complete security" phase (#10668)
* Cypress tests for the "complete security" phase

* fix imports
2023-04-20 11:04:51 +00:00
Suguru Hirahara
6b211dd602
Update events.spec.ts - use Cypress Testing Library (#10590)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-20 09:33:31 +00:00
Richard van der Hoff
e350b4c2c2
Deflakey threads cypress test (#10632)
`inviteUser` is asynchronous so you can't just call it and plough straight on.

Also some logging improvements which helped debug this
2023-04-18 10:17:46 +00:00
Suguru Hirahara
d1461d3d7d
Update polls.spec.ts - use Cypress Testing Library (#10609)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 18:19:08 +00:00
Suguru Hirahara
a092a91cd9
Update lazy-loading.spec.ts - use Cypress Testing Library (#10591)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 16:01:09 +00:00
Suguru Hirahara
7114f82e6f
Update spotlight.spec.ts - use Cypress Testing Library (#10621)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 14:06:20 +00:00
Suguru Hirahara
9c277d6b02
Update file-panel.spec.ts - use Cypress Testing Library (#10574)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 11:07:27 +00:00
Suguru Hirahara
013b7204d3
Update room-directory.spec.ts - use Cypress Testing Library (#10596)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 09:54:35 +00:00
Suguru Hirahara
4d859a34e7
Update right-panel.spec.ts - use Cypress Testing Library (#10539)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 09:19:40 +00:00
Suguru Hirahara
8471e45622
Update send_event.spec.ts - use Cypress Testing Library (#10613)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 08:32:32 +00:00
Suguru Hirahara
816a078651
Update pollHistory.spec.ts - use Cypress Testing Library (#10611)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 08:24:10 +00:00
Suguru Hirahara
812564940d
Update location.spec.ts - use Cypress Testing Library (#10612)
* Update location.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Make the test id of location share option discoverable with findByTestId()

findByTestId seeks for data-testid, instead of data-test-id.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 08:24:09 +00:00
Suguru Hirahara
4c0efc5e68
Update Cypress test files under support/ directory - use Cypress Testing Library (#10619)
* Update support files - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix openMessageComposerOptions()

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 07:37:49 +00:00
Suguru Hirahara
9d8d610f31
Update room.spec.ts - use Cypress Testing Library (#10608)
* Update room.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Empty commit

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 07:35:14 +00:00
Suguru Hirahara
8a4a584ba0
Make test ID compatible with findByTestId() of Cypress Testing Library (#10617)
'data-test-id' is not discoverable with findByTestId() of Cypress Testing Library.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 06:10:11 +00:00
Suguru Hirahara
93858813a3
Update stickers.spec.ts - use Cypress Testing Library (#10622)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-17 05:56:37 +00:00
Suguru Hirahara
41c0b0881a
Update pills-click-in-app.spec.ts - use Cypress Testing Library (#10582)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-16 22:50:57 +00:00
Suguru Hirahara
256c3591aa
Update login.spec.ts - use Cypress Testing Library (#10597)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-14 11:40:43 +00:00
Michael Weimann
bdd6d8d661
Add support for Cypress tests with Podman (#10603) 2023-04-14 11:02:59 +00:00
Suguru Hirahara
72fe394e4c
Update kick.spec.ts - use Cypress Testing Library (#10587)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-13 10:08:39 +00:00
Suguru Hirahara
a2c2c01edc
Update get-openid-token.spec.ts - use Cypress Testing Library (#10586)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-13 06:27:39 +00:00
Suguru Hirahara
9b8459e8e9
Update device-management.spec.ts - use Cypress Testing Library (#10585)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-12 15:58:28 +00:00
Suguru Hirahara
c5de595e79
Update user-view.spec.ts - use Cypress Testing Library (#10577)
* Update user-view.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Remove a line to have the test wait until the spinner disappears

The custom command 'percySnapshotElement' waits until it disappears so there is no need to keep it.

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-12 15:55:10 +00:00
Suguru Hirahara
c9c974d455
Use Cypress Testing Library - crypto.spec.ts (#10512)
* Update crypto.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Empty commit

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-12 15:48:31 +00:00
Suguru Hirahara
d179956af8
Update one-to-one-chat.spec.ts - use Cypress Testing Library (#10572)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-12 13:11:28 +00:00
Suguru Hirahara
c9599a3ef2
Update user-menu.spec.ts - use Cypress Testing Library (#10578)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-12 12:56:34 +00:00
Suguru Hirahara
bef6eca484
Update tests to ensure file size unit has been fixed (#10568)
* Update tests to ensure file size unit has been fixed

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Update cypress/e2e/timeline/timeline.spec.ts

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Edit comments mentioning kilobytes

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-04-12 10:21:13 +00:00
Suguru Hirahara
5316bb58f7
Remove find.ts and custom commands on Cypress Testing Library (#10544)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-12 07:26:12 +00:00
Suguru Hirahara
b5493680ce
Update register.spec.ts - use Cypress Testing Library (#10566)
* Update register.spec.ts - use Cypress Testing Library

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* findByRole - checkbox

<input type='checkbox'> has implicit ARIA 'checkbox' role

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-11 17:37:05 +00:00
Suguru Hirahara
65f605951f
Update timeline.spec.ts (#10540)
* timeline.spec.ts - deprecate custom commands of find.ts

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Iterate

- clickButtonReply()
- findByText()

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-11 10:33:32 +00:00
Suguru Hirahara
7b5d1802b1
Update editing.spec.ts (#10543)
* Update editing.spec.ts - deprecate custom commands

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Update editing.spec.ts - use findByRole textbox etc

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-11 08:22:45 +00:00
Suguru Hirahara
737b30d2fa
Use Cypress Testing Library - consent.spec.ts (#10514)
Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
2023-04-11 06:13:30 +00:00