Update existing Cypress tests - use Cypress Testing Library (#10755)

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
pull/28217/head
Suguru Hirahara 2023-05-01 20:13:24 +00:00 committed by GitHub
parent 58c942be45
commit a81940b62a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ interface CryptoTestContext extends Mocha.Context {
} }
const openRoomInfo = () => { const openRoomInfo = () => {
cy.get(".mx_RightPanel_roomSummaryButton").click(); cy.findByRole("button", { name: "Room info" }).click();
return cy.get(".mx_RightPanel"); return cy.get(".mx_RightPanel");
}; };

View File

@ -60,7 +60,7 @@ const handleVerificationRequest = (request: VerificationRequest): Chainable<Emoj
const checkTimelineNarrow = (button = true) => { const checkTimelineNarrow = (button = true) => {
cy.viewport(800, 600); // SVGA cy.viewport(800, 600); // SVGA
cy.get(".mx_LeftPanel_minimized").should("exist"); // Wait until the left panel is minimized 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"); cy.get(".mx_BaseCard").should("exist");
// Ensure the failure bar does not cover the timeline // Ensure the failure bar does not cover the timeline
@ -74,7 +74,7 @@ const checkTimelineNarrow = (button = true) => {
cy.get("[data-testid='decryption-failure-bar-button']:last-of-type").should("be.visible"); 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.get(".mx_BaseCard").should("not.exist");
cy.viewport(1000, 660); // Reset to the default size cy.viewport(1000, 660); // Reset to the default size
}; };

View File

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