From 9704c9fc139068065aefc3c44bed6295764a9cfc Mon Sep 17 00:00:00 2001 From: Kerry Date: Wed, 28 Jun 2023 10:20:43 +1200 Subject: [PATCH] test server switch in cypress login test (#11130) --- cypress/e2e/login/login.spec.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cypress/e2e/login/login.spec.ts b/cypress/e2e/login/login.spec.ts index 9bc6dd3f1b..2968f0946b 100644 --- a/cypress/e2e/login/login.spec.ts +++ b/cypress/e2e/login/login.spec.ts @@ -47,6 +47,30 @@ describe("Login", () => { // wait for the dialog to go away cy.get(".mx_ServerPickerDialog").should("not.exist"); + cy.get(".mx_Spinner").should("not.exist"); + cy.get(".mx_ServerPicker_server").should("have.text", homeserver.baseUrl); + + cy.findByRole("button", { name: "Edit" }).click(); + + // select the default server again + cy.get(".mx_StyledRadioButton").first().click(); + cy.findByRole("button", { name: "Continue" }).click(); + cy.get(".mx_ServerPickerDialog").should("not.exist"); + cy.get(".mx_Spinner").should("not.exist"); + // name of default server + cy.get(".mx_ServerPicker_server").should("have.text", "server.invalid"); + + // switch back to the custom homeserver + + cy.findByRole("button", { name: "Edit" }).click(); + cy.findByRole("textbox", { name: "Other homeserver" }).type(homeserver.baseUrl); + cy.findByRole("button", { name: "Continue" }).click(); + // wait for the dialog to go away + cy.get(".mx_ServerPickerDialog").should("not.exist"); + + cy.get(".mx_Spinner").should("not.exist"); + cy.get(".mx_ServerPicker_server").should("have.text", homeserver.baseUrl); + cy.findByRole("textbox", { name: "Username", timeout: 15000 }).should("be.visible"); // Disabled because flaky - see https://github.com/vector-im/element-web/issues/24688 //cy.percySnapshot("Login");