fleet/cypress/integration/all/setup/setup.spec.ts
Martavis Parker 688a9f01d5
E2E Test fixes (#2491)
* fixed flow for resetting current session

* ignoring downloads for windows because paths

* using correct shell for windows

* using correct shell for windows

* ignoring exception; we can't fake react context

* changes file

* must wait for flash to show

* lint fixes

* re-added secure package
2021-10-12 14:33:56 -07:00

45 lines
1.1 KiB
TypeScript

describe("Setup", () => {
// Different than normal beforeEach because we don't run the fleetctl setup.
beforeEach(() => {
const SHELL = Cypress.platform === "win32" ? "cmd" : "bash";
cy.exec("make e2e-reset-db", {
timeout: 5000,
env: { SHELL },
});
});
it("Completes setup", () => {
cy.visit("/");
cy.url().should("match", /\/setup$/);
cy.contains(/setup/i);
// Page 1
cy.findByPlaceholderText(/full name/i).type("Test name");
cy.findByPlaceholderText(/email/i).type("test@example.com");
cy.findByPlaceholderText(/^password/i)
.first()
.type("admin123#");
cy.findByPlaceholderText(/confirm password/i)
.last()
.type("admin123#");
cy.contains("button:enabled", /next/i).click();
// Page 2
cy.findByPlaceholderText(/organization name/i).type("Fleet Test");
cy.contains("button:enabled", /next/i).click();
// Page 3
cy.contains("button:enabled", /next/i).click();
// Page 4
cy.contains("button:enabled", /confirm/i).click();
cy.url().should("match", /\/hosts\/manage$/i);
cy.contains(/all hosts/i);
});
});