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

Commit

Permalink
Update existing Cypress tests - use Cypress Testing Library (#10755)
Browse files Browse the repository at this point in the history
Signed-off-by: Suguru Hirahara <[email protected]>
  • Loading branch information
luixxiul authored May 1, 2023
1 parent 58c942b commit a81940b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/crypto/crypto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface CryptoTestContext extends Mocha.Context {
}

const openRoomInfo = () => {
cy.get(".mx_RightPanel_roomSummaryButton").click();
cy.findByRole("button", { name: "Room info" }).click();
return cy.get(".mx_RightPanel");
};

Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/crypto/decryption-failure.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const handleVerificationRequest = (request: VerificationRequest): Chainable<Emoj
const checkTimelineNarrow = (button = true) => {
cy.viewport(800, 600); // SVGA
cy.get(".mx_LeftPanel_minimized").should("exist"); // Wait until the left panel is minimized
cy.get(".mx_RightPanel_roomSummaryButton").click(); // Open the right panel to make the timeline narrow
cy.findByRole("button", { name: "Room info" }).click(); // Open the right panel to make the timeline narrow
cy.get(".mx_BaseCard").should("exist");

// Ensure the failure bar does not cover the timeline
Expand All @@ -74,7 +74,7 @@ const checkTimelineNarrow = (button = true) => {
cy.get("[data-testid='decryption-failure-bar-button']:last-of-type").should("be.visible");
}

cy.get(".mx_RightPanel_roomSummaryButton").click(); // Close the right panel
cy.findByRole("button", { name: "Room info" }).click(); // Close the right panel
cy.get(".mx_BaseCard").should("not.exist");
cy.viewport(1000, 660); // Reset to the default size
};
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/right-panel/right-panel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getMemberTileByName = (name: string): Chainable<JQuery<HTMLElement>> => {

const viewRoomSummaryByName = (name: string): Chainable<JQuery<HTMLElement>> => {
cy.viewRoomByName(name);
cy.get(".mx_RightPanel_roomSummaryButton").click();
cy.findByRole("button", { name: "Room info" }).click();
return checkRoomSummaryCard(name);
};

Expand Down

0 comments on commit a81940b

Please sign in to comment.