Stabilise Cypress login tests (#9446)
* Attempt to stabilise login tests * More stability * Stabilise s'more * don't clear LS as we rely on it for enablements * Add small delay * Iterate * Update login.ts
This commit is contained in:
committed by
GitHub
parent
b04991a962
commit
2cf8a9a2f7
@@ -21,13 +21,6 @@ import { SynapseInstance } from "../../plugins/synapsedocker";
|
||||
describe("Login", () => {
|
||||
let synapse: SynapseInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
cy.visit("/#/login");
|
||||
cy.startSynapse("consent").then(data => {
|
||||
synapse = data;
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cy.stopSynapse(synapse);
|
||||
});
|
||||
@@ -37,7 +30,11 @@ describe("Login", () => {
|
||||
const password = "p4s5W0rD";
|
||||
|
||||
beforeEach(() => {
|
||||
cy.registerUser(synapse, username, password);
|
||||
cy.startSynapse("consent").then(data => {
|
||||
synapse = data;
|
||||
cy.registerUser(synapse, username, password);
|
||||
cy.visit("/#/login");
|
||||
});
|
||||
});
|
||||
|
||||
it("logs in with an existing account and lands on the home screen", () => {
|
||||
@@ -65,14 +62,17 @@ describe("Login", () => {
|
||||
|
||||
describe("logout", () => {
|
||||
beforeEach(() => {
|
||||
cy.initTestUser(synapse, "Erin");
|
||||
cy.startSynapse("consent").then(data => {
|
||||
synapse = data;
|
||||
cy.initTestUser(synapse, "Erin");
|
||||
});
|
||||
});
|
||||
|
||||
it("should go to login page on logout", () => {
|
||||
cy.get('[aria-label="User menu"]').click();
|
||||
|
||||
// give a change for the outstanding requests queue to settle before logging out
|
||||
cy.wait(500);
|
||||
cy.wait(2000);
|
||||
|
||||
cy.get(".mx_UserMenu_contextMenu").within(() => {
|
||||
cy.get(".mx_UserMenu_iconSignOut").click();
|
||||
@@ -94,7 +94,7 @@ describe("Login", () => {
|
||||
cy.get('[aria-label="User menu"]').click();
|
||||
|
||||
// give a change for the outstanding requests queue to settle before logging out
|
||||
cy.wait(500);
|
||||
cy.wait(2000);
|
||||
|
||||
cy.get(".mx_UserMenu_contextMenu").within(() => {
|
||||
cy.get(".mx_UserMenu_iconSignOut").click();
|
||||
|
||||
Reference in New Issue
Block a user