2022-01-21 13:43:27 +01:00
|
|
|
import filterTests from "../support/filterTests"
|
|
|
|
|
|
|
|
filterTests(['smoke', 'all'], () => {
|
|
|
|
context("Auto Screens UI", () => {
|
|
|
|
before(() => {
|
|
|
|
cy.login()
|
|
|
|
cy.createTestApp()
|
2021-12-24 11:38:03 +01:00
|
|
|
})
|
2022-01-21 13:43:27 +01:00
|
|
|
|
|
|
|
it("should generate internal table screens", () => {
|
|
|
|
// Create autogenerated screens from the internal table
|
|
|
|
cy.createAutogeneratedScreens(["Cypress Tests"])
|
|
|
|
// Confirm screens have been auto generated
|
2022-01-21 19:40:32 +01:00
|
|
|
cy.get(".nav-items-container").contains("cypress-tests").click({ force: true })
|
2022-01-21 13:43:27 +01:00
|
|
|
cy.get(".nav-items-container").should('contain', 'cypress-tests/:id')
|
|
|
|
.and('contain', 'cypress-tests/new/row')
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should generate multiple internal table screens at once", () => {
|
|
|
|
// Create a second internal table
|
|
|
|
const initialTable = "Cypress Tests"
|
|
|
|
const secondTable = "Table Two"
|
|
|
|
cy.createTable(secondTable)
|
|
|
|
// Create autogenerated screens from the internal tables
|
|
|
|
cy.createAutogeneratedScreens([initialTable, secondTable])
|
|
|
|
// Confirm screens have been auto generated
|
2022-01-21 19:40:32 +01:00
|
|
|
cy.get(".nav-items-container").contains("cypress-tests").click({ force: true })
|
2022-01-21 13:43:27 +01:00
|
|
|
// Previously generated tables are suffixed with numbers - as expected
|
|
|
|
cy.get(".nav-items-container").should('contain', 'cypress-tests-2/:id')
|
|
|
|
.and('contain', 'cypress-tests-2/new/row')
|
|
|
|
cy.get(".nav-items-container").contains("table-two").click()
|
|
|
|
cy.get(".nav-items-container").should('contain', 'table-two/:id')
|
|
|
|
.and('contain', 'table-two/new/row')
|
|
|
|
})
|
|
|
|
|
|
|
|
if (Cypress.env("TEST_ENV")) {
|
|
|
|
it("should generate data source screens", () => {
|
|
|
|
// Using MySQL data source for testing this
|
|
|
|
const datasource = "MySQL"
|
|
|
|
// Select & configure MySQL data source
|
|
|
|
cy.selectExternalDatasource(datasource)
|
|
|
|
cy.addDatasourceConfig(datasource)
|
|
|
|
// Create autogenerated screens from a MySQL table - MySQL contains books table
|
|
|
|
cy.createAutogeneratedScreens(["books"])
|
|
|
|
cy.get(".nav-items-container").contains("books").click()
|
|
|
|
cy.get(".nav-items-container").should('contain', 'books/:id')
|
|
|
|
.and('contain', 'books/new/row')
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
2021-12-24 11:49:47 +01:00
|
|
|
})
|