1
0
Fork 0
mirror of synced 2024-08-12 16:41:26 +12:00

Updated PostgreSQL & Oracle Tests

PostgreSQL
- Test fixes (May still fail due to connection issues on smoke build)

Oracle
- Test fixes
- Skipping most tests (Oracle host needs configured)

commands.spec.js
- minor change to addDatasourceConfig function
This commit is contained in:
Mitch-Budibase 2022-04-13 15:54:40 +01:00
parent 57284ec219
commit 45c39cbcc0
3 changed files with 18 additions and 15 deletions

View file

@ -46,9 +46,10 @@ filterTests(["all"], () => {
cy.get("@datasource") cy.get("@datasource")
.its("response.body") .its("response.body")
.should("have.property", "status", 500) .should("have.property", "status", 500)
cy.get(".spectrum-Button").contains("Skip table fetch").click({ force: true })
}) })
it("should add Oracle data source and fetch tables", () => { xit("should add Oracle data source and fetch tables", () => {
// Add & configure Oracle data source // Add & configure Oracle data source
cy.selectExternalDatasource(datasource) cy.selectExternalDatasource(datasource)
cy.intercept("**/datasources").as("datasource") cy.intercept("**/datasources").as("datasource")
@ -64,7 +65,7 @@ filterTests(["all"], () => {
.should("be.gt", 0) .should("be.gt", 0)
}) })
it("should define a One relationship type", () => { xit("should define a One relationship type", () => {
// Select relationship type & configure // Select relationship type & configure
cy.get(".spectrum-Button") cy.get(".spectrum-Button")
.contains("Define relationship") .contains("Define relationship")
@ -93,7 +94,7 @@ filterTests(["all"], () => {
cy.get(".spectrum-Table-cell").should("contain", "COUNTRIES to REGIONS") cy.get(".spectrum-Table-cell").should("contain", "COUNTRIES to REGIONS")
}) })
it("should define a Many relationship type", () => { xit("should define a Many relationship type", () => {
// Select relationship type & configure // Select relationship type & configure
cy.get(".spectrum-Button") cy.get(".spectrum-Button")
.contains("Define relationship") .contains("Define relationship")
@ -127,7 +128,7 @@ filterTests(["all"], () => {
) )
}) })
it("should delete relationships", () => { xit("should delete relationships", () => {
// Delete both relationships // Delete both relationships
cy.get(".spectrum-Table") cy.get(".spectrum-Table")
.eq(1) .eq(1)
@ -156,7 +157,7 @@ filterTests(["all"], () => {
}) })
}) })
it("should add a query", () => { xit("should add a query", () => {
// Add query // Add query
cy.get(".spectrum-Button").contains("Add query").click({ force: true }) cy.get(".spectrum-Button").contains("Add query").click({ force: true })
cy.get(".spectrum-Form-item") cy.get(".spectrum-Form-item")
@ -181,7 +182,7 @@ filterTests(["all"], () => {
cy.get(".nav-item").should("contain", queryName) cy.get(".nav-item").should("contain", queryName)
}) })
it("should duplicate a query", () => { xit("should duplicate a query", () => {
// Get query nav item // Get query nav item
cy.get(".nav-item") cy.get(".nav-item")
.contains(queryName) .contains(queryName)
@ -194,7 +195,7 @@ filterTests(["all"], () => {
cy.get(".nav-item").should("contain", queryName + " (1)") cy.get(".nav-item").should("contain", queryName + " (1)")
}) })
it("should edit a query name", () => { xit("should edit a query name", () => {
// Rename query // Rename query
cy.get(".spectrum-Form-item") cy.get(".spectrum-Form-item")
.eq(0) .eq(0)
@ -206,7 +207,7 @@ filterTests(["all"], () => {
cy.get(".nav-item").should("contain", queryRename) cy.get(".nav-item").should("contain", queryRename)
}) })
it("should delete a query", () => { xit("should delete a query", () => {
// Get query nav item - QueryName // Get query nav item - QueryName
cy.get(".nav-item") cy.get(".nav-item")
.contains(queryName) .contains(queryName)

View file

@ -31,6 +31,7 @@ filterTests(["all"], () => {
cy.get("@datasource") cy.get("@datasource")
.its("response.body") .its("response.body")
.should("have.property", "status", 500) .should("have.property", "status", 500)
cy.get(".spectrum-Button").contains("Skip table fetch").click({ force: true })
}) })
it("should add PostgreSQL data source and fetch tables", () => { it("should add PostgreSQL data source and fetch tables", () => {
@ -113,13 +114,13 @@ filterTests(["all"], () => {
}) })
it("should delete a relationship", () => { it("should delete a relationship", () => {
cy.get(".hierarchy-items-container").contains(datasource).click() cy.get(".hierarchy-items-container").contains("PostgreSQL-2").click()
cy.reload() cy.reload()
// Delete one relationship // Delete one relationship
cy.get(".spectrum-Table") cy.get(".spectrum-Table")
.eq(1) .eq(1)
.within(() => { .within(() => {
cy.get(".spectrum-Table-row").eq(0).click() cy.get(".spectrum-Table-row").eq(0).click({ force: true })
cy.wait(500) cy.wait(500)
}) })
cy.get(".spectrum-Dialog-grid").within(() => { cy.get(".spectrum-Dialog-grid").within(() => {
@ -161,7 +162,7 @@ filterTests(["all"], () => {
it("should switch to schema with no tables", () => { it("should switch to schema with no tables", () => {
// Switch Schema - To one without any tables // Switch Schema - To one without any tables
cy.get(".hierarchy-items-container").contains(datasource).click() cy.get(".hierarchy-items-container").contains("PostgreSQL-2").click()
switchSchema("randomText") switchSchema("randomText")
// No tables displayed // No tables displayed
@ -208,11 +209,12 @@ filterTests(["all"], () => {
}) })
it("should duplicate a query", () => { it("should duplicate a query", () => {
// Get last nav item - The query // Locate previously created query
cy.get(".nav-item") cy.get(".nav-item")
.last() .contains(queryName)
.siblings(".actions")
.within(() => { .within(() => {
cy.get(".icon").eq(1).click({ force: true }) cy.get(".icon").click({ force: true })
}) })
// Select and confirm duplication // Select and confirm duplication
cy.get(".spectrum-Menu").contains("Duplicate").click() cy.get(".spectrum-Menu").contains("Duplicate").click()

View file

@ -415,7 +415,7 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => {
if (datasource == "Oracle") { if (datasource == "Oracle") {
cy.get("input").clear().type(Cypress.env("oracle").HOST) cy.get("input").clear().type(Cypress.env("oracle").HOST)
} else { } else {
cy.get("input").clear().type(Cypress.env("HOST_IP")) cy.get("input").clear({ force: true }).type(Cypress.env("HOST_IP"), { force: true })
} }
}) })
}) })