login command - need to run worker in cypress env
This commit is contained in:
parent
20a16e07a1
commit
fe6d31d880
|
@ -1,5 +1,6 @@
|
||||||
context("Create an Application", () => {
|
context("Create an Application", () => {
|
||||||
it("should create a new application", () => {
|
it("should create a new application", () => {
|
||||||
|
cy.login()
|
||||||
cy.createTestApp()
|
cy.createTestApp()
|
||||||
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
||||||
cy.contains("Cypress Tests").should("exist")
|
cy.contains("Cypress Tests").should("exist")
|
||||||
|
|
|
@ -29,14 +29,3 @@ async function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
run()
|
run()
|
||||||
|
|
||||||
// TODO: ensure that this still works
|
|
||||||
// initialiseBudibase({ dir: homedir, clientId: "cypress-test" })
|
|
||||||
// .then(() => {
|
|
||||||
// delete require.cache[require.resolve("../../server/src/environment")]
|
|
||||||
// const xPlatHomeDir = homedir.startsWith("~")
|
|
||||||
// ? join(homedir(), homedir.substring(1))
|
|
||||||
// : homedir
|
|
||||||
// run(xPlatHomeDir)
|
|
||||||
// })
|
|
||||||
// .catch(e => console.error(e))
|
|
||||||
|
|
|
@ -24,6 +24,19 @@
|
||||||
// -- This will overwrite an existing command --
|
// -- This will overwrite an existing command --
|
||||||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||||
|
|
||||||
|
Cypress.Commands.add("login", name => {
|
||||||
|
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
||||||
|
cy.contains("Create Test User").click()
|
||||||
|
cy.get("input")
|
||||||
|
.first()
|
||||||
|
.type("test@test.com")
|
||||||
|
|
||||||
|
cy.get('input[type="password"]').type("test")
|
||||||
|
|
||||||
|
cy.contains("Login").click()
|
||||||
|
cy.wait(1000)
|
||||||
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createApp", name => {
|
Cypress.Commands.add("createApp", name => {
|
||||||
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
||||||
// wait for init API calls on visit
|
// wait for init API calls on visit
|
||||||
|
@ -44,12 +57,6 @@ Cypress.Commands.add("createApp", name => {
|
||||||
.type(name)
|
.type(name)
|
||||||
.should("have.value", name)
|
.should("have.value", name)
|
||||||
cy.contains("Next").click()
|
cy.contains("Next").click()
|
||||||
cy.get("input[name=email]")
|
|
||||||
.click()
|
|
||||||
.type("test@test.com")
|
|
||||||
cy.get("input[name=password]")
|
|
||||||
.click()
|
|
||||||
.type("test")
|
|
||||||
cy.contains("Submit").click()
|
cy.contains("Submit").click()
|
||||||
cy.get("[data-cy=new-table]", {
|
cy.get("[data-cy=new-table]", {
|
||||||
timeout: 20000,
|
timeout: 20000,
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form on:submit|preventDefault>
|
<form on:submit|preventDefault data-cy="login-form">
|
||||||
<Spacer large />
|
<Spacer large />
|
||||||
<Label small>Email</Label>
|
<Label small>Email</Label>
|
||||||
<Input outline bind:value={username} />
|
<Input outline bind:value={username} />
|
||||||
|
|
Loading…
Reference in New Issue