Skip to content

Commit

Permalink
Merge pull request #4264 from systeminit/fixup/amend-pesky-cypress-test
Browse files Browse the repository at this point in the history
fixup: amended the way we measure success for workspace management cy…
  • Loading branch information
johnrwatson authored Aug 1, 2024
2 parents b7da5c0 + cff1fb4 commit c10952e
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions app/web/cypress/e2e/workspace-management/workspace-dashboard.cy.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
// @ts-check
///<reference path="../global.d.ts"/>

const SI_CYPRESS_MULTIPLIER = Cypress.env('VITE_SI_CYPRESS_MULTIPLIER') || import.meta.env.VITE_SI_CYPRESS_MULTIPLIER || 1;
const AUTH0_USERNAME = Cypress.env('VITE_AUTH0_USERNAME') || import.meta.env.VITE_AUTH0_USERNAME;
const AUTH0_PASSWORD = Cypress.env('VITE_AUTH0_PASSWORD') || import.meta.env.VITE_AUTH0_PASSWORD;
const AUTH_PORTAL_URL = Cypress.env('VITE_AUTH_PORTAL_URL') || import.meta.env.VITE_AUTH_PORTAL_URL;
const AUTH_API_URL = Cypress.env('VITE_AUTH_API_URL') || import.meta.env.VITE_AUTH_API_URL;
const SI_WORKSPACE_ID = Cypress.env('VITE_SI_WORKSPACE_ID') || import.meta.env.VITE_SI_WORKSPACE_ID;
const UUID = Cypress.env('VITE_UUID') || import.meta.env.VITE_UUID || "local";

describe("workspace", () => {
beforeEach(() => {
cy.visit("/");
});
Cypress._.times(SI_CYPRESS_MULTIPLIER, () => {
describe("workspace", () => {
beforeEach(() => {
cy.visit("/");
});

it("dashboard_redirect", () => {
it("dashboard_redirect", () => {

cy.loginToAuth0(AUTH0_USERNAME, AUTH0_PASSWORD);
cy.loginToAuth0(AUTH0_USERNAME, AUTH0_PASSWORD);

// Go to the Synthetic User's Dashboard
cy.visit(AUTH_PORTAL_URL + '/dashboard')
cy.sendPosthogEvent(Cypress.currentTest.titlePath.join("/"), "test_uuid", UUID);
// Go to the Synthetic User's Dashboard
cy.visit(AUTH_PORTAL_URL + '/dashboard')
cy.sendPosthogEvent(Cypress.currentTest.titlePath.join("/"), "test_uuid", UUID);

cy.wait(5000);
cy.wait(5000);

// Find the URL for the synthetic workspace and go there
cy.get('a[href="' + AUTH_API_URL + '/workspaces/' + SI_WORKSPACE_ID + '/go"]')
.should('be.visible')
.invoke('removeAttr', 'target')
.click();
cy.on('uncaught:exception', (e) => {
console.log(e);
return false;
});
// Find the URL for the synthetic workspace and go there
cy.get('a[href="' + AUTH_API_URL + '/workspaces/' + SI_WORKSPACE_ID + '/go"]')
.should('be.visible')
.invoke('removeAttr', 'target')
.click();
cy.on('uncaught:exception', (e) => {
console.log(e);
return false;
});

cy.wait(5000);

// Check that it loaded the workspace + prompted to create a new change set
cy.contains('Create change set', { timeout: 10000 }).should('be.visible');
cy.appModelPageLoaded();
});
});
});
});

0 comments on commit c10952e

Please sign in to comment.