2022-01-21 13:43:27 +01:00
|
|
|
import filterTests from "../../support/filterTests"
|
2021-11-15 16:25:58 +01:00
|
|
|
|
2022-01-21 13:43:27 +01:00
|
|
|
filterTests(['all'], () => {
|
2022-02-17 15:06:17 +01:00
|
|
|
context("Datasource Wizard", () => {
|
2022-02-18 19:46:58 +01:00
|
|
|
if (Cypress.env("TEST_ENV")) {
|
2022-01-21 13:43:27 +01:00
|
|
|
before(() => {
|
|
|
|
cy.login()
|
|
|
|
cy.createTestApp()
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should navigate in and out of a datasource via wizard", () => {
|
|
|
|
// Select PostgreSQL and add config (without fetch)
|
|
|
|
const datasource = "Oracle"
|
|
|
|
cy.selectExternalDatasource(datasource)
|
|
|
|
cy.addDatasourceConfig(datasource, true)
|
|
|
|
|
|
|
|
// Navigate back within datasource wizard
|
|
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
|
|
cy.get(".spectrum-Button").contains("Back").click({ force: true })
|
|
|
|
})
|
2021-11-15 16:25:58 +01:00
|
|
|
|
2022-01-21 13:43:27 +01:00
|
|
|
// Select PostgreSQL datasource again
|
2022-06-17 18:41:07 +02:00
|
|
|
cy.get(".item-list", { timeout: 1000 }).contains(datasource).click()
|
2022-01-21 13:43:27 +01:00
|
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
|
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true })
|
|
|
|
})
|
|
|
|
|
|
|
|
// Fetch tables after selection
|
|
|
|
// Previously entered config should not have been saved
|
|
|
|
// Config is back to default values
|
|
|
|
// Modal will close and provide 500 error
|
|
|
|
cy.intercept('**/datasources').as('datasourceConnection')
|
|
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
|
|
cy.get(".spectrum-Button").contains("Save and fetch tables").click({ force: true })
|
|
|
|
})
|
|
|
|
cy.wait("@datasourceConnection")
|
|
|
|
cy.get("@datasourceConnection").its('response.body')
|
|
|
|
.should('have.property', 'status', 500)
|
2022-02-18 19:46:58 +01:00
|
|
|
})
|
|
|
|
}
|
2021-11-15 16:25:58 +01:00
|
|
|
})
|
|
|
|
})
|