From c5de595e79f794cd5750ad59d8424a4222179eb8 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Wed, 12 Apr 2023 15:55:10 +0000 Subject: [PATCH] Update `user-view.spec.ts` - use Cypress Testing Library (#10577) * Update user-view.spec.ts - use Cypress Testing Library Signed-off-by: Suguru Hirahara * Remove a line to have the test wait until the spinner disappears The custom command 'percySnapshotElement' waits until it disappears so there is no need to keep it. Signed-off-by: Suguru Hirahara --------- Signed-off-by: Suguru Hirahara --- cypress/e2e/user-view/user-view.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/user-view/user-view.spec.ts b/cypress/e2e/user-view/user-view.spec.ts index 529ef16cf1..2acfc9d535 100644 --- a/cypress/e2e/user-view/user-view.spec.ts +++ b/cypress/e2e/user-view/user-view.spec.ts @@ -40,8 +40,10 @@ describe("UserView", () => { cy.visit(`/#/user/${bot.getUserId()}`); }); - cy.get("#mx_RightPanel .mx_UserInfo_profile h2").should("contain", "Usman"); - cy.get(".mx_RightPanel .mx_Spinner").should("not.exist"); // wait for spinners to finish + cy.get(".mx_RightPanel .mx_UserInfo_profile h2").within(() => { + cy.findByText("Usman").should("exist"); + }); + cy.get(".mx_RightPanel").percySnapshotElement("User View", { // Hide the MXID field as it'll vary on each test percyCSS: ".mx_UserInfo_profile_mxid { visibility: hidden !important; }",