df43b270dc
-Changes made to reflect the new layouts of the test env --e.g. Changes to the app grid, changes to UI screens -Updated commands --New commands added & some updated -New tests --Revert App --AutoScreensUI --Change app icon and colour --Data source testing In particular to data source testing -I have a file for mySQL, PostgreSQL, Oracle, and REST. --enabled better regression testing for each Other changes made for: -QueryLevelTransformers tests -Table tests -Renaming applications -Automations -Multi-option datastype New env file added too
62 lines
No EOL
2.4 KiB
JavaScript
62 lines
No EOL
2.4 KiB
JavaScript
context("Revert apps", () => {
|
|
before(() => {
|
|
cy.login()
|
|
cy.createTestApp()
|
|
})
|
|
|
|
it("should try to revert an unpublished app", () => {
|
|
// Click revert icon
|
|
cy.get(".toprightnav").within(() => {
|
|
cy.get(".spectrum-Icon").eq(1).click()
|
|
})
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
// Enter app name before revert
|
|
cy.get("input").type("Cypress Tests")
|
|
cy.intercept('**/revert').as('revertApp')
|
|
// Click Revert
|
|
cy.get(".spectrum-Button").contains("Revert").click({ force: true })
|
|
// Intercept Request after button click & apply assertions
|
|
cy.wait("@revertApp")
|
|
cy.get("@revertApp").its('response.body').should('have.property', 'message', "App has not yet been deployed")
|
|
cy.get("@revertApp").its('response.body').should('have.property', 'status', 400)
|
|
})
|
|
})
|
|
|
|
it("should revert a published app", () => {
|
|
// Add initial component - Paragraph
|
|
cy.addComponent("Elements", "Paragraph")
|
|
// Publish app
|
|
cy.get(".spectrum-Button").contains("Publish").click({ force: true })
|
|
cy.get(".spectrum-ButtonGroup").within(() => {
|
|
cy.get(".spectrum-Button").contains("Publish").click({ force: true })
|
|
})
|
|
// Add second component - Button
|
|
cy.addComponent("Elements", "Button")
|
|
// Click Revert
|
|
cy.get(".toprightnav").within(() => {
|
|
cy.get(".spectrum-Icon").eq(1).click()
|
|
})
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
// Click Revert
|
|
cy.get(".spectrum-Button").contains("Revert").click({ force: true })
|
|
cy.wait(1000)
|
|
})
|
|
// Confirm Paragraph component is still visible
|
|
cy.get(".root").contains("New Paragraph")
|
|
// Confirm Button component is not visible
|
|
cy.get(".root").should("not.have.text", "New Button")
|
|
})
|
|
|
|
it("should enter incorrect app name when reverting", () => {
|
|
// Click Revert
|
|
cy.get(".toprightnav").within(() => {
|
|
cy.get(".spectrum-Icon").eq(1).click()
|
|
})
|
|
// Enter incorrect app name
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
cy.get("input").type("Cypress Tests")
|
|
// Revert button within modal should be disabled
|
|
cy.get(".spectrum-Button").eq(1).should('be.disabled')
|
|
})
|
|
})
|
|
}) |