Cypress tests for soft logout (#11402)

This commit is contained in:
Richard van der Hoff 2023-08-16 08:40:09 +01:00 committed by GitHub
parent 373a34c3d1
commit 4f138ed041
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 194 additions and 28 deletions

View file

@ -17,6 +17,7 @@ limitations under the License.
/// <reference types="cypress" />
import { HomeserverInstance } from "../../plugins/utils/homeserver";
import { doTokenRegistration } from "./utils";
describe("Login", () => {
let homeserver: HomeserverInstance;
@ -93,7 +94,6 @@ describe("Login", () => {
})
.then((data) => {
homeserver = data;
cy.visit("/#/login");
});
});
@ -108,33 +108,7 @@ describe("Login", () => {
// If you are using ufw, try something like:
// sudo ufw allow in on docker0
//
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");
// click on "Continue with OAuth test"
cy.findByRole("button", { name: "Continue with OAuth test" }).click();
// wait for the Test OAuth Page to load
cy.findByText("Test OAuth page");
// click the submit button
cy.findByRole("button", { name: "Submit" }).click();
// Synapse prompts us to pick a user ID
cy.findByRole("heading", { name: "Create your account" });
cy.findByRole("textbox", { name: "Username (required)" }).type("alice");
// wait for username validation to start, and complete
cy.wait(50);
cy.get("#field-username-output").should("have.value", "");
cy.findByRole("button", { name: "Continue" }).click();
// Synapse prompts us to grant permission to Element
cy.findByRole("heading", { name: "Continue to your account" });
cy.findByRole("link", { name: "Continue" }).click();
doTokenRegistration(homeserver.baseUrl);
// Eventually, we should end up at the home screen.
cy.url().should("contain", "/#/home", { timeout: 30000 });