Make Spaces cypress tests less flaky (#9138)

This commit is contained in:
Michael Telatynski 2022-08-08 17:07:55 +01:00 committed by GitHub
parent ed67aec334
commit e08b11b9c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,9 +100,9 @@ describe("Spaces", () => {
cy.get(".mx_AccessibleButton").contains("Go to my first room").click();
// Assert rooms exist in the room list
cy.get(".mx_RoomTile").contains("General").should("exist");
cy.get(".mx_RoomTile").contains("Random").should("exist");
cy.get(".mx_RoomTile").contains("Jokes").should("exist");
cy.get(".mx_RoomList").contains(".mx_RoomTile", "General").should("exist");
cy.get(".mx_RoomList").contains(".mx_RoomTile", "Random").should("exist");
cy.get(".mx_RoomList").contains(".mx_RoomTile", "Jokes").should("exist");
});
it("should allow user to create private space", () => {
@ -128,14 +128,14 @@ describe("Spaces", () => {
cy.get(".mx_AccessibleButton").contains("Skip for now").click();
// Assert rooms exist in the room list
cy.get(".mx_RoomTile").contains("General").should("exist");
cy.get(".mx_RoomTile").contains("Random").should("exist");
cy.get(".mx_RoomTile").contains("Projects").should("exist");
cy.get(".mx_RoomList").contains(".mx_RoomTile", "General").should("exist");
cy.get(".mx_RoomList").contains(".mx_RoomTile", "Random").should("exist");
cy.get(".mx_RoomList").contains(".mx_RoomTile", "Projects").should("exist");
// Assert rooms exist in the space explorer
cy.get(".mx_SpaceHierarchy_roomTile").contains("General").should("exist");
cy.get(".mx_SpaceHierarchy_roomTile").contains("Random").should("exist");
cy.get(".mx_SpaceHierarchy_roomTile").contains("Projects").should("exist");
cy.get(".mx_SpaceHierarchy_list").contains(".mx_SpaceHierarchy_roomTile", "General").should("exist");
cy.get(".mx_SpaceHierarchy_list").contains(".mx_SpaceHierarchy_roomTile", "Random").should("exist");
cy.get(".mx_SpaceHierarchy_list").contains(".mx_SpaceHierarchy_roomTile", "Projects").should("exist");
});
it("should allow user to create just-me space", () => {
@ -157,8 +157,8 @@ describe("Spaces", () => {
cy.get(".mx_AddExistingToSpace_entry").click();
cy.get(".mx_AccessibleButton").contains("Add").click();
cy.get(".mx_RoomTile").contains("Sample Room").should("exist");
cy.get(".mx_SpaceHierarchy_roomTile").contains("Sample Room").should("exist");
cy.get(".mx_RoomList").contains(".mx_RoomTile", "Sample Room").should("exist");
cy.get(".mx_SpaceHierarchy_list").contains(".mx_SpaceHierarchy_roomTile", "Sample Room").should("exist");
});
it("should allow user to invite another to a space", () => {
@ -233,8 +233,8 @@ describe("Spaces", () => {
cy.viewSpaceHomeByName(spaceName);
});
cy.get(".mx_SpaceRoomView .mx_SpaceHierarchy_list").within(() => {
cy.get(".mx_SpaceHierarchy_roomTile").contains("Music").should("exist");
cy.get(".mx_SpaceHierarchy_roomTile").contains("Gaming").should("exist");
cy.contains(".mx_SpaceHierarchy_roomTile", "Music").should("exist");
cy.contains(".mx_SpaceHierarchy_roomTile", "Gaming").should("exist");
});
});
});