1
0
Fork 0
mirror of synced 2024-06-23 08:30:31 +12:00

Update cpyress tests so create and delete app helpers work again

This commit is contained in:
Andrew Kingston 2021-04-28 14:56:31 +01:00
parent f8026e8683
commit 164c4b76c7
3 changed files with 33 additions and 20 deletions

View file

@ -40,20 +40,29 @@ Cypress.Commands.add("createApp", name => {
}
})
.then(() => {
cy.get("input[name=applicationName]")
.type(name)
.should("have.value", name)
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.get("[data-cy=new-table]", {
timeout: 20000,
}).should("be.visible")
cy.get(".spectrum-Modal")
.within(() => {
cy.get("input")
.eq(0)
.type(name)
.should("have.value", name)
.blur()
cy.contains("Next").click()
cy.get("input")
.eq(1)
.type("test@test.com")
.blur()
cy.get("input")
.eq(2)
.type("test")
.blur()
cy.contains("Submit").click()
})
.then(() => {
cy.get("[data-cy=new-table]", {
timeout: 20000,
}).should("be.visible")
})
})
})
@ -62,11 +71,15 @@ Cypress.Commands.add("deleteApp", name => {
cy.get(".apps").then($apps => {
cy.wait(1000)
if ($apps.find(`[data-cy="app-${name}"]`).length) {
cy.get(`[data-cy="app-${name}"] a`).click()
cy.get(`[data-cy="app-${name}"]`)
.contains("Open")
.click()
cy.get("[data-cy=settings-icon]").click()
cy.get(".modal-content").within(() => {
cy.get(".spectrum-Dialog").within(() => {
cy.contains("Danger Zone").click()
cy.get("input").type("DELETE")
cy.get("input")
.type("DELETE")
.blur()
cy.contains("Delete Entire App").click()
})
}

View file

@ -1,6 +1,6 @@
<script>
import SettingsModal from "./SettingsModal.svelte"
import { Modal } from "@budibase/bbui"
import { Modal, Icon } from "@budibase/bbui"
let modal
</script>
@ -9,7 +9,7 @@
class="topnavitemright settings"
data-cy="settings-icon"
on:click={modal.show}>
<i class="ri-settings-3-line" />
<Icon hoverable name="Settings" />
</div>
<Modal bind:this={modal} width="600px">
<SettingsModal />

View file

@ -54,7 +54,7 @@
</Tabs>
<div
class="add-button"
data-cy={`new-${selected === 'External' ? 'datasource' : 'tabel'}`}>
data-cy={`new-${selected === 'External' ? 'datasource' : 'table'}`}>
<Icon hoverable name="AddCircle" on:click={modal.show} />
</div>
</div>