@@ -83,26 +83,26 @@ describe("Spaces", () => {
83
83
cy . get ( 'input[label="Name"]' ) . type ( "Let's have a Riot" ) ;
84
84
cy . get ( 'input[label="Address"]' ) . should ( "have.value" , "lets-have-a-riot" ) ;
85
85
cy . get ( 'textarea[label="Description"]' ) . type ( "This is a space to reminisce Riot.im!" ) ;
86
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Create" ) . click ( ) ;
86
+ cy . contains ( ".mx_AccessibleButton" , "Create" ) . click ( ) ;
87
87
} ) ;
88
88
89
89
// Create the default General & Random rooms, as well as a custom "Jokes" room
90
90
cy . get ( 'input[label="Room name"][value="General"]' ) . should ( "exist" ) ;
91
91
cy . get ( 'input[label="Room name"][value="Random"]' ) . should ( "exist" ) ;
92
92
cy . get ( 'input[placeholder="Support"]' ) . type ( "Jokes" ) ;
93
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Continue" ) . click ( ) ;
93
+ cy . contains ( ".mx_AccessibleButton" , "Continue" ) . click ( ) ;
94
94
95
95
// Copy matrix.to link
96
96
cy . get ( ".mx_SpacePublicShare_shareButton" ) . focus ( ) . realClick ( ) ;
97
97
cy . getClipboardText ( ) . should ( "eq" , "https://matrix.to/#/#lets-have-a-riot:localhost" ) ;
98
98
99
99
// Go to space home
100
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Go to my first room" ) . click ( ) ;
100
+ cy . contains ( ".mx_AccessibleButton" , "Go to my first room" ) . click ( ) ;
101
101
102
102
// Assert rooms exist in the room list
103
- cy . get ( ".mx_RoomList" ) . contains ( " .mx_RoomTile", "General" ) . should ( "exist" ) ;
104
- cy . get ( ".mx_RoomList" ) . contains ( " .mx_RoomTile", "Random" ) . should ( "exist" ) ;
105
- cy . get ( ".mx_RoomList" ) . contains ( " .mx_RoomTile", "Jokes" ) . should ( "exist" ) ;
103
+ cy . contains ( ".mx_RoomList .mx_RoomTile" , "General" ) . should ( "exist" ) ;
104
+ cy . contains ( ".mx_RoomList .mx_RoomTile" , "Random" ) . should ( "exist" ) ;
105
+ cy . contains ( ".mx_RoomList .mx_RoomTile" , "Jokes" ) . should ( "exist" ) ;
106
106
} ) ;
107
107
108
108
it ( "should allow user to create private space" , ( ) => {
@@ -113,7 +113,7 @@ describe("Spaces", () => {
113
113
cy . get ( 'input[label="Name"]' ) . type ( "This is not a Riot" ) ;
114
114
cy . get ( 'input[label="Address"]' ) . should ( "not.exist" ) ;
115
115
cy . get ( 'textarea[label="Description"]' ) . type ( "This is a private space of mourning Riot.im..." ) ;
116
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Create" ) . click ( ) ;
116
+ cy . contains ( ".mx_AccessibleButton" , "Create" ) . click ( ) ;
117
117
} ) ;
118
118
119
119
cy . get ( ".mx_SpaceRoomView_privateScope_meAndMyTeammatesButton" ) . click ( ) ;
@@ -122,20 +122,20 @@ describe("Spaces", () => {
122
122
cy . get ( 'input[label="Room name"][value="General"]' ) . should ( "exist" ) ;
123
123
cy . get ( 'input[label="Room name"][value="Random"]' ) . should ( "exist" ) ;
124
124
cy . get ( 'input[placeholder="Support"]' ) . type ( "Projects" ) ;
125
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Continue" ) . click ( ) ;
125
+ cy . contains ( ".mx_AccessibleButton" , "Continue" ) . click ( ) ;
126
126
127
127
cy . get ( ".mx_SpaceRoomView" ) . should ( "contain" , "Invite your teammates" ) ;
128
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Skip for now" ) . click ( ) ;
128
+ cy . contains ( ".mx_AccessibleButton" , "Skip for now" ) . click ( ) ;
129
129
130
130
// Assert rooms exist in the room list
131
- cy . get ( ".mx_RoomList" ) . contains ( " .mx_RoomTile", "General" ) . should ( "exist" ) ;
132
- cy . get ( ".mx_RoomList" ) . contains ( " .mx_RoomTile", "Random" ) . should ( "exist" ) ;
133
- cy . get ( ".mx_RoomList" ) . contains ( " .mx_RoomTile", "Projects" ) . should ( "exist" ) ;
131
+ cy . contains ( ".mx_RoomList .mx_RoomTile" , "General" ) . should ( "exist" ) ;
132
+ cy . contains ( ".mx_RoomList .mx_RoomTile" , "Random" ) . should ( "exist" ) ;
133
+ cy . contains ( ".mx_RoomList .mx_RoomTile" , "Projects" ) . should ( "exist" ) ;
134
134
135
135
// Assert rooms exist in the space explorer
136
- cy . get ( ".mx_SpaceHierarchy_list" ) . contains ( " .mx_SpaceHierarchy_roomTile", "General" ) . should ( "exist" ) ;
137
- cy . get ( ".mx_SpaceHierarchy_list" ) . contains ( " .mx_SpaceHierarchy_roomTile", "Random" ) . should ( "exist" ) ;
138
- cy . get ( ".mx_SpaceHierarchy_list" ) . contains ( " .mx_SpaceHierarchy_roomTile", "Projects" ) . should ( "exist" ) ;
136
+ cy . contains ( ".mx_SpaceHierarchy_list .mx_SpaceHierarchy_roomTile" , "General" ) . should ( "exist" ) ;
137
+ cy . contains ( ".mx_SpaceHierarchy_list .mx_SpaceHierarchy_roomTile" , "Random" ) . should ( "exist" ) ;
138
+ cy . contains ( ".mx_SpaceHierarchy_list .mx_SpaceHierarchy_roomTile" , "Projects" ) . should ( "exist" ) ;
139
139
} ) ;
140
140
141
141
it ( "should allow user to create just-me space" , ( ) => {
@@ -155,10 +155,10 @@ describe("Spaces", () => {
155
155
cy . get ( ".mx_SpaceRoomView_privateScope_justMeButton" ) . click ( ) ;
156
156
157
157
cy . get ( ".mx_AddExistingToSpace_entry" ) . click ( ) ;
158
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Add" ) . click ( ) ;
158
+ cy . contains ( ".mx_AccessibleButton" , "Add" ) . click ( ) ;
159
159
160
- cy . get ( ".mx_RoomList" ) . contains ( " .mx_RoomTile", "Sample Room" ) . should ( "exist" ) ;
161
- cy . get ( ".mx_SpaceHierarchy_list" ) . contains ( " .mx_SpaceHierarchy_roomTile", "Sample Room" ) . should ( "exist" ) ;
160
+ cy . contains ( ".mx_RoomList .mx_RoomTile" , "Sample Room" ) . should ( "exist" ) ;
161
+ cy . contains ( ".mx_SpaceHierarchy_list .mx_SpaceHierarchy_roomTile" , "Sample Room" ) . should ( "exist" ) ;
162
162
} ) ;
163
163
164
164
it ( "should allow user to invite another to a space" , ( ) => {
@@ -186,7 +186,7 @@ describe("Spaces", () => {
186
186
187
187
cy . get ( ".mx_InviteDialog_other" ) . within ( ( ) => {
188
188
cy . get ( 'input[type="text"]' ) . type ( bot . getUserId ( ) ) ;
189
- cy . get ( ".mx_AccessibleButton" ) . contains ( "Invite" ) . click ( ) ;
189
+ cy . contains ( ".mx_AccessibleButton" , "Invite" ) . click ( ) ;
190
190
} ) ;
191
191
192
192
cy . get ( ".mx_InviteDialog_other" ) . should ( "not.exist" ) ;
0 commit comments