2021-11-15 16:25:58 +01:00
|
|
|
context("Datasource Wizard", () => {
|
|
|
|
before(() => {
|
|
|
|
cy.login()
|
|
|
|
cy.createTestApp()
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should navigate in and out of a datasource via wizard", () => {
|
|
|
|
// Select PostgreSQL and add config (without fetch)
|
2021-12-24 11:38:03 +01:00
|
|
|
const datasource = "Oracle"
|
2021-11-15 16:25:58 +01:00
|
|
|
cy.selectExternalDatasource(datasource)
|
2021-12-24 11:38:03 +01:00
|
|
|
cy.addDatasourceConfig(datasource, true)
|
2021-11-15 16:25:58 +01:00
|
|
|
|
|
|
|
// Navigate back within datasource wizard
|
|
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
|
|
cy.get(".spectrum-Button").contains("Back").click({ force: true })
|
|
|
|
cy.wait(1000)
|
|
|
|
})
|
|
|
|
|
|
|
|
// Select PostgreSQL datasource again
|
|
|
|
cy.get(".item-list").contains(datasource).click()
|
|
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
|
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true })
|
|
|
|
})
|
|
|
|
|
2021-12-24 11:38:03 +01:00
|
|
|
// Fetch tables after selection
|
2021-11-15 16:25:58 +01:00
|
|
|
// Previously entered config should not have been saved
|
2021-12-24 11:38:03 +01:00
|
|
|
// Config is back to default values
|
|
|
|
// Modal will close and provide 500 error
|
|
|
|
cy.intercept('**/datasources').as('datasourceConnection')
|
2021-11-15 16:25:58 +01:00
|
|
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
|
|
|
cy.get(".spectrum-Button").contains("Fetch tables from database").click({ force: true })
|
|
|
|
})
|
2021-12-24 11:38:03 +01:00
|
|
|
cy.wait("@datasourceConnection")
|
|
|
|
cy.get("@datasourceConnection").its('response.body')
|
|
|
|
.should('have.property', 'status', 500)
|
2021-11-15 16:25:58 +01:00
|
|
|
})
|
|
|
|
})
|