This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
cypress/e2e/one-to-one-chat Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -45,17 +45,23 @@ describe("1:1 chat room", () => {
4545
4646 it ( "should open new 1:1 chat room after leaving the old one" , ( ) => {
4747 // leave 1:1 chat room
48- cy . contains ( ".mx_RoomHeader_nametext" , username ) . click ( ) ;
49- cy . contains ( '[role="menuitem"]' , "Leave" ) . click ( ) ;
50- cy . get ( '[data-testid="dialog-primary-button"]' ) . click ( ) ;
48+ cy . get ( ".mx_RoomHeader_nametext" ) . within ( ( ) => {
49+ cy . findByText ( username ) . click ( ) ;
50+ } ) ;
51+ cy . findByRole ( "menuitem" , { name : "Leave" } ) . click ( ) ;
52+ cy . findByRole ( "button" , { name : "Leave" } ) . click ( ) ;
5153
5254 // wait till the room was left
53- cy . get ( '[role="group"][aria-label="Historical"]' ) . within ( ( ) => {
54- cy . contains ( ".mx_RoomTile" , username ) ;
55+ cy . findByRole ( "group" , { name : "Historical" } ) . within ( ( ) => {
56+ cy . get ( ".mx_RoomTile" ) . within ( ( ) => {
57+ cy . findByText ( username ) ;
58+ } ) ;
5559 } ) ;
5660
5761 // open new 1:1 chat room
5862 cy . visit ( `/#/user/${ user2 . userId } ?action=chat` ) ;
59- cy . contains ( ".mx_RoomHeader_nametext" , username ) ;
63+ cy . get ( ".mx_RoomHeader_nametext" ) . within ( ( ) => {
64+ cy . findByText ( username ) ;
65+ } ) ;
6066 } ) ;
6167} ) ;
You can’t perform that action at this time.
0 commit comments