Cypress test updates and back button update for the create screen
This commit is contained in:
parent
071e9c3421
commit
3c86bd24f2
|
@ -269,22 +269,76 @@ filterTests(['all'], () => {
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
after(() => {
|
it("Should allow copying of the published application Id", () => {
|
||||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
cy.get(".appTable .app-row-actions button").contains("Edit").eq(0).click({force: true})
|
cy.get(".appTable .app-row-actions").eq(0)
|
||||||
|
.within(() => {
|
||||||
|
cy.get(".spectrum-Button").contains("Edit").click({ force: true })
|
||||||
|
})
|
||||||
|
|
||||||
cy.get(".deployment-top-nav svg[aria-label='Globe']")
|
cy.publishApp("sample-name")
|
||||||
.click({ force: true })
|
|
||||||
|
|
||||||
cy.get("[data-cy='publish-popover-menu']").should("be.visible")
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
cy.get("[data-cy='publish-popover-menu'] [data-cy='publish-popover-action']")
|
cy.get(".appTable .name").eq(0).click()
|
||||||
.click({ force : true })
|
|
||||||
|
cy.get(".app-overview-actions-icon > .icon").click({ force : true })
|
||||||
|
|
||||||
|
cy.get("[data-cy='app-overview-menu-popover']").eq(0).within(() => {
|
||||||
|
cy.get(".spectrum-Menu-item").contains("Copy App ID").click({ force: true })
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.get(".spectrum-Toast-content").contains("App ID copied to clipboard.").should("be.visible")
|
||||||
|
})
|
||||||
|
|
||||||
|
it("Should allow unpublishing of the application", () => {
|
||||||
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
|
cy.get(".appTable .name").eq(0).click()
|
||||||
|
|
||||||
|
cy.get(".app-overview-actions-icon > .icon").click({ force : true })
|
||||||
|
|
||||||
|
cy.get("[data-cy='app-overview-menu-popover']").eq(0).within(() => {
|
||||||
|
cy.get(".spectrum-Menu-item").contains("Unpublish").click({ force: true })
|
||||||
|
cy.wait(500)
|
||||||
|
})
|
||||||
|
|
||||||
cy.get("[data-cy='unpublish-modal']").should("be.visible")
|
cy.get("[data-cy='unpublish-modal']").should("be.visible")
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get(".confirm-wrap button").click({ force: true }
|
cy.get(".confirm-wrap button").click({ force: true }
|
||||||
)})
|
)})
|
||||||
cy.wait(1000)
|
|
||||||
|
cy.get(".overview-tab [data-cy='app-status']").within(() => {
|
||||||
|
cy.get(".status-display").contains("Unpublished")
|
||||||
|
cy.get(".status-display .icon svg[aria-label='GlobeStrike']").should("exist")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it("Should allow deleting of the application", () => {
|
||||||
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
|
cy.get(".appTable .name").eq(0).click()
|
||||||
|
|
||||||
|
cy.get(".app-overview-actions-icon > .icon").click({ force : true })
|
||||||
|
|
||||||
|
cy.get("[data-cy='app-overview-menu-popover']").eq(0).within(() => {
|
||||||
|
cy.get(".spectrum-Menu-item").contains("Delete").click({ force: true })
|
||||||
|
cy.wait(500)
|
||||||
|
})
|
||||||
|
|
||||||
|
//The test application was renamed earlier in the spec
|
||||||
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
||||||
|
cy.get("input").type("sample name")
|
||||||
|
cy.get(".spectrum-Button--warning").click()
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.location().should((loc) => {
|
||||||
|
expect(loc.pathname).to.eq('/builder/portal/apps')
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.get(".appTable").should("not.exist")
|
||||||
|
|
||||||
|
cy.get(".welcome .container h1").contains("Let's create your first app!")
|
||||||
|
})
|
||||||
|
|
||||||
|
after(() => {
|
||||||
cy.deleteAllApps()
|
cy.deleteAllApps()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -29,22 +29,8 @@ filterTests(['all'], () => {
|
||||||
|
|
||||||
it("Should publish an application and correctly reflect that", () => {
|
it("Should publish an application and correctly reflect that", () => {
|
||||||
//Assuming the previous test was run and the unpublished app is open in edit mode.
|
//Assuming the previous test was run and the unpublished app is open in edit mode.
|
||||||
cy.get(".toprightnav button.spectrum-Button").contains("Publish").click({ force : true })
|
|
||||||
|
|
||||||
cy.get(".spectrum-Modal [data-cy='deploy-app-modal']").should("be.visible")
|
cy.publishApp("cypress-tests")
|
||||||
.within(() => {
|
|
||||||
cy.get(".spectrum-Button").contains("Publish").click({ force : true })
|
|
||||||
cy.wait(1000)
|
|
||||||
});
|
|
||||||
|
|
||||||
//Verify that the app url is presented correctly to the user
|
|
||||||
cy.get(".spectrum-Modal [data-cy='deploy-app-success-modal']")
|
|
||||||
.should("be.visible")
|
|
||||||
.within(() => {
|
|
||||||
let appUrl = Cypress.config().baseUrl + '/app/cypress-tests'
|
|
||||||
cy.get("[data-cy='deployed-app-url'] input").should('have.value', appUrl)
|
|
||||||
cy.get(".spectrum-Button").contains("Done").click({ force: true })
|
|
||||||
})
|
|
||||||
|
|
||||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||||
cy.wait(1000)
|
cy.wait(1000)
|
||||||
|
|
|
@ -298,6 +298,29 @@ Cypress.Commands.add("unlockApp", unlock_config => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add("publishApp", resolvedAppPath => {
|
||||||
|
//Assumes you have navigated to an application first
|
||||||
|
cy.get(".toprightnav button.spectrum-Button")
|
||||||
|
.contains("Publish")
|
||||||
|
.click({ force: true })
|
||||||
|
|
||||||
|
cy.get(".spectrum-Modal [data-cy='deploy-app-modal']")
|
||||||
|
.should("be.visible")
|
||||||
|
.within(() => {
|
||||||
|
cy.get(".spectrum-Button").contains("Publish").click({ force: true })
|
||||||
|
cy.wait(1000)
|
||||||
|
})
|
||||||
|
|
||||||
|
//Verify that the app url is presented correctly to the user
|
||||||
|
cy.get(".spectrum-Modal [data-cy='deploy-app-success-modal']")
|
||||||
|
.should("be.visible")
|
||||||
|
.within(() => {
|
||||||
|
let appUrl = Cypress.config().baseUrl + "/app/" + resolvedAppPath
|
||||||
|
cy.get("[data-cy='deployed-app-url'] input").should("have.value", appUrl)
|
||||||
|
cy.get(".spectrum-Button").contains("Done").click({ force: true })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("createTestApp", () => {
|
Cypress.Commands.add("createTestApp", () => {
|
||||||
const appName = "Cypress Tests"
|
const appName = "Cypress Tests"
|
||||||
cy.deleteApp(appName)
|
cy.deleteApp(appName)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
Body,
|
Body,
|
||||||
Modal,
|
Modal,
|
||||||
Divider,
|
Divider,
|
||||||
|
ActionButton,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import CreateAppModal from "components/start/CreateAppModal.svelte"
|
import CreateAppModal from "components/start/CreateAppModal.svelte"
|
||||||
import TemplateDisplay from "components/common/TemplateDisplay.svelte"
|
import TemplateDisplay from "components/common/TemplateDisplay.svelte"
|
||||||
|
@ -60,16 +61,15 @@
|
||||||
<Page wide>
|
<Page wide>
|
||||||
<Layout noPadding gap="XL">
|
<Layout noPadding gap="XL">
|
||||||
<span>
|
<span>
|
||||||
<Button
|
<ActionButton
|
||||||
quiet
|
|
||||||
secondary
|
secondary
|
||||||
icon={"ChevronLeft"}
|
icon={"ArrowLeft"}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
$goto("../")
|
$goto("../")
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Back
|
Back
|
||||||
</Button>
|
</ActionButton>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="title">
|
<div class="title">
|
||||||
|
|
Loading…
Reference in New Issue