Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e08b11b

Browse files
authored
Make Spaces cypress tests less flaky (#9138)
1 parent ed67aec commit e08b11b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

cypress/e2e/spaces/spaces.spec.ts

+13-13
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ describe("Spaces", () => {
100100
cy.get(".mx_AccessibleButton").contains("Go to my first room").click();
101101

102102
// Assert rooms exist in the room list
103-
cy.get(".mx_RoomTile").contains("General").should("exist");
104-
cy.get(".mx_RoomTile").contains("Random").should("exist");
105-
cy.get(".mx_RoomTile").contains("Jokes").should("exist");
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");
106106
});
107107

108108
it("should allow user to create private space", () => {
@@ -128,14 +128,14 @@ describe("Spaces", () => {
128128
cy.get(".mx_AccessibleButton").contains("Skip for now").click();
129129

130130
// Assert rooms exist in the room list
131-
cy.get(".mx_RoomTile").contains("General").should("exist");
132-
cy.get(".mx_RoomTile").contains("Random").should("exist");
133-
cy.get(".mx_RoomTile").contains("Projects").should("exist");
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");
134134

135135
// Assert rooms exist in the space explorer
136-
cy.get(".mx_SpaceHierarchy_roomTile").contains("General").should("exist");
137-
cy.get(".mx_SpaceHierarchy_roomTile").contains("Random").should("exist");
138-
cy.get(".mx_SpaceHierarchy_roomTile").contains("Projects").should("exist");
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");
139139
});
140140

141141
it("should allow user to create just-me space", () => {
@@ -157,8 +157,8 @@ describe("Spaces", () => {
157157
cy.get(".mx_AddExistingToSpace_entry").click();
158158
cy.get(".mx_AccessibleButton").contains("Add").click();
159159

160-
cy.get(".mx_RoomTile").contains("Sample Room").should("exist");
161-
cy.get(".mx_SpaceHierarchy_roomTile").contains("Sample Room").should("exist");
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");
162162
});
163163

164164
it("should allow user to invite another to a space", () => {
@@ -233,8 +233,8 @@ describe("Spaces", () => {
233233
cy.viewSpaceHomeByName(spaceName);
234234
});
235235
cy.get(".mx_SpaceRoomView .mx_SpaceHierarchy_list").within(() => {
236-
cy.get(".mx_SpaceHierarchy_roomTile").contains("Music").should("exist");
237-
cy.get(".mx_SpaceHierarchy_roomTile").contains("Gaming").should("exist");
236+
cy.contains(".mx_SpaceHierarchy_roomTile", "Music").should("exist");
237+
cy.contains(".mx_SpaceHierarchy_roomTile", "Gaming").should("exist");
238238
});
239239
});
240240
});

0 commit comments

Comments
 (0)