|
|
@ -1,6 +1,10 @@ |
|
|
|
import { mainPage, settingsPage } from "../../support/page_objects/mainPage"; |
|
|
|
import { mainPage, settingsPage } from "../../support/page_objects/mainPage"; |
|
|
|
import { loginPage, projectsPage } from "../../support/page_objects/navigation"; |
|
|
|
import { loginPage, projectsPage } from "../../support/page_objects/navigation"; |
|
|
|
import { isTestSuiteActive, sakilaSqlViews, sakilaTables } from "../../support/page_objects/projectConstants"; |
|
|
|
import { |
|
|
|
|
|
|
|
isTestSuiteActive, |
|
|
|
|
|
|
|
sakilaSqlViews, |
|
|
|
|
|
|
|
sakilaTables, |
|
|
|
|
|
|
|
} from "../../support/page_objects/projectConstants"; |
|
|
|
|
|
|
|
|
|
|
|
export const genTest = (apiType, dbType) => { |
|
|
|
export const genTest = (apiType, dbType) => { |
|
|
|
if (!isTestSuiteActive(apiType, dbType)) return; |
|
|
|
if (!isTestSuiteActive(apiType, dbType)) return; |
|
|
@ -14,11 +18,11 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
beforeEach(() => { |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
afterEach(() => { |
|
|
|
cy.saveLocalStorage(); |
|
|
|
cy.saveLocalStorage(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
after(() => { |
|
|
|
after(() => { |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
@ -38,312 +42,408 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
it(`Verify ERD Context menu in all table view`, () => { |
|
|
|
it(`Verify ERD Context menu in all table view`, () => { |
|
|
|
mainPage.openErdTab(); |
|
|
|
mainPage.openErdTab(); |
|
|
|
cy.get('.nc-erd-context-menu').should('be.visible'); |
|
|
|
cy.get(".nc-erd-context-menu").should("be.visible"); |
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-histogram').should('be.visible'); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
cy.get('.nc-erd-context-menu').find('.ant-checkbox').should('have.length', 3); |
|
|
|
.get(".nc-erd-histogram") |
|
|
|
cy.get('.nc-erd-context-menu').find('.ant-checkbox').eq(0).should('have.class', 'ant-checkbox-checked'); |
|
|
|
.should("be.visible"); |
|
|
|
cy.get('.nc-erd-context-menu').find('.ant-checkbox').eq(1).should('have.class', 'ant-checkbox-checked'); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
cy.get('.nc-erd-context-menu').find('.ant-checkbox').eq(2).should('not.have.class', 'ant-checkbox-checked'); |
|
|
|
.find(".ant-checkbox") |
|
|
|
|
|
|
|
.should("have.length", 3); |
|
|
|
cy.get('.nc-erd-context-menu').find('.nc-erd-showColumns-label').dblclick(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
cy.get('.nc-erd-context-menu').find('.ant-checkbox').should('have.length', 5); |
|
|
|
.find(".ant-checkbox") |
|
|
|
|
|
|
|
.eq(0) |
|
|
|
|
|
|
|
.should("have.class", "ant-checkbox-checked"); |
|
|
|
|
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.find(".ant-checkbox") |
|
|
|
|
|
|
|
.eq(1) |
|
|
|
|
|
|
|
.should("have.class", "ant-checkbox-checked"); |
|
|
|
|
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.find(".ant-checkbox") |
|
|
|
|
|
|
|
.eq(2) |
|
|
|
|
|
|
|
.should("not.have.class", "ant-checkbox-checked"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.find(".nc-erd-showColumns-label") |
|
|
|
|
|
|
|
.dblclick(); |
|
|
|
|
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.find(".ant-checkbox") |
|
|
|
|
|
|
|
.should("have.length", 5); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it("Verify ERD of all tables view and verify columns of actor and payment with default config", () => { |
|
|
|
it("Verify ERD of all tables view and verify columns of actor and payment with default config", () => { |
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 12) |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 14) |
|
|
|
.find(".nc-erd-table-node") |
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 11) |
|
|
|
.should("have.length", 12); |
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 17) |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".vue-flow__edge") |
|
|
|
|
|
|
|
.should("have.length", 14); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-circle") |
|
|
|
|
|
|
|
.should("have.length", 11); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-rect") |
|
|
|
|
|
|
|
.should("have.length", 17); |
|
|
|
|
|
|
|
|
|
|
|
for (const tableName of sakilaTables) { |
|
|
|
for (const tableName of sakilaTables) { |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${tableName}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-${tableName}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Actor table
|
|
|
|
// Actor table
|
|
|
|
[ |
|
|
|
[ |
|
|
|
'actor_id', |
|
|
|
"actor_id", |
|
|
|
'first_name', |
|
|
|
"first_name", |
|
|
|
'last_name', |
|
|
|
"last_name", |
|
|
|
'last_update', |
|
|
|
"last_update", |
|
|
|
'film_list' |
|
|
|
"film_list", |
|
|
|
].forEach((colTitle) => { |
|
|
|
].forEach((colTitle) => { |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor`).find(`.nc-erd-table-node-actor-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-actor`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-actor-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Payment table
|
|
|
|
// Payment table
|
|
|
|
[ |
|
|
|
[ |
|
|
|
'payment_id', |
|
|
|
"payment_id", |
|
|
|
'customer_id', |
|
|
|
"customer_id", |
|
|
|
'staff_id', |
|
|
|
"staff_id", |
|
|
|
'rental_id', |
|
|
|
"rental_id", |
|
|
|
'amount', |
|
|
|
"amount", |
|
|
|
'payment_date', |
|
|
|
"payment_date", |
|
|
|
'last_update', |
|
|
|
"last_update", |
|
|
|
'customer', |
|
|
|
"customer", |
|
|
|
'rental', |
|
|
|
"rental", |
|
|
|
'staff' |
|
|
|
"staff", |
|
|
|
].forEach((colTitle) => { |
|
|
|
].forEach((colTitle) => { |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-payment`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-payment-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it("Verify ERD of all tables view and verify columns of actor and payment with default config with showAllColumn disabled", () => { |
|
|
|
it("Verify ERD of all tables view and verify columns of actor and payment with default config with showAllColumn disabled", () => { |
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
cy.get('.nc-erd-showPkAndFk-checkbox-disabled').should('exist'); |
|
|
|
.get(".nc-erd-showColumns-checkbox") |
|
|
|
cy.get('.nc-erd-showPkAndFk-checkbox-unchecked').should('exist'); |
|
|
|
.click(); |
|
|
|
|
|
|
|
cy.get(".nc-erd-showPkAndFk-checkbox-disabled").should("exist"); |
|
|
|
|
|
|
|
cy.get(".nc-erd-showPkAndFk-checkbox-unchecked").should("exist"); |
|
|
|
|
|
|
|
|
|
|
|
// Actor table
|
|
|
|
// Actor table
|
|
|
|
[ |
|
|
|
["film_list"].forEach((colTitle) => { |
|
|
|
'film_list' |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
].forEach((colTitle) => { |
|
|
|
.find(`.nc-erd-table-node-actor`) |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor`).find(`.nc-erd-table-node-actor-column-${colTitle}`).should('exist'); |
|
|
|
.find(`.nc-erd-table-node-actor-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Payment table
|
|
|
|
// Payment table
|
|
|
|
[ |
|
|
|
["customer", "rental", "staff"].forEach((colTitle) => { |
|
|
|
'customer', |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
'rental', |
|
|
|
.find(`.nc-erd-table-node-payment`) |
|
|
|
'staff' |
|
|
|
.find(`.nc-erd-table-node-payment-column-${colTitle}`) |
|
|
|
].forEach((colTitle) => { |
|
|
|
.should("exist"); |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist'); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it("Verify ERD of all tables view and verify columns of actor and payment with default config with showPkAndFk disabled", () => { |
|
|
|
it("Verify ERD of all tables view and verify columns of actor and payment with default config with showPkAndFk disabled", () => { |
|
|
|
// enable showAllColumn
|
|
|
|
// enable showAllColumn
|
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showPkAndFk-checkbox').click(); |
|
|
|
.get(".nc-erd-showColumns-checkbox") |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.get(".nc-erd-showPkAndFk-checkbox") |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
// Actor table
|
|
|
|
// Actor table
|
|
|
|
[ |
|
|
|
["last_name", "last_update", "film_list"].forEach((colTitle) => { |
|
|
|
'last_name', |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
'last_update', |
|
|
|
.find(`.nc-erd-table-node-actor`) |
|
|
|
'film_list' |
|
|
|
.find(`.nc-erd-table-node-actor-column-${colTitle}`) |
|
|
|
].forEach((colTitle) => { |
|
|
|
.should("exist"); |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor`).find(`.nc-erd-table-node-actor-column-${colTitle}`).should('exist'); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Payment table
|
|
|
|
// Payment table
|
|
|
|
[ |
|
|
|
[ |
|
|
|
'amount', |
|
|
|
"amount", |
|
|
|
'payment_date', |
|
|
|
"payment_date", |
|
|
|
'last_update', |
|
|
|
"last_update", |
|
|
|
'customer', |
|
|
|
"customer", |
|
|
|
'rental', |
|
|
|
"rental", |
|
|
|
'staff' |
|
|
|
"staff", |
|
|
|
].forEach((colTitle) => { |
|
|
|
].forEach((colTitle) => { |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-payment`).find(`.nc-erd-table-node-payment-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-payment`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-payment-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it("Verify ERD of all tables view with sql grid on and verify columns of ActorInfo", () => { |
|
|
|
it("Verify ERD of all tables view with sql grid on and verify columns of ActorInfo", () => { |
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showViews-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu").get(".nc-erd-showViews-checkbox").click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 19) |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 14) |
|
|
|
.find(".nc-erd-table-node") |
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 11) |
|
|
|
.should("have.length", 19); |
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 17) |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".vue-flow__edge") |
|
|
|
|
|
|
|
.should("have.length", 14); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-circle") |
|
|
|
|
|
|
|
.should("have.length", 11); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-rect") |
|
|
|
|
|
|
|
.should("have.length", 17); |
|
|
|
|
|
|
|
|
|
|
|
for (const tableName of sakilaTables) { |
|
|
|
for (const tableName of sakilaTables) { |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${tableName}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-${tableName}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (const tableName of sakilaSqlViews) { |
|
|
|
for (const tableName of sakilaSqlViews) { |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-${tableName}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-${tableName}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ActorInfo SQL View
|
|
|
|
// ActorInfo SQL View
|
|
|
|
[ |
|
|
|
["actor_id", "first_name", "last_name", "film_info"].forEach( |
|
|
|
'actor_id', |
|
|
|
(colTitle) => { |
|
|
|
'first_name', |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
'last_name', |
|
|
|
.find(`.nc-erd-table-node-actor_info`) |
|
|
|
'film_info' |
|
|
|
.find(`.nc-erd-table-node-actor_info-column-${colTitle}`) |
|
|
|
].forEach((colTitle) => { |
|
|
|
.should("exist"); |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-actor_info`).find(`.nc-erd-table-node-actor_info-column-${colTitle}`).should('exist'); |
|
|
|
} |
|
|
|
}) |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it("Verify show MM tables", () => { |
|
|
|
it("Verify show MM tables", () => { |
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-store`).should('not.exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-store`) |
|
|
|
|
|
|
|
.should("not.exist"); |
|
|
|
// disable showViews
|
|
|
|
// disable showViews
|
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showViews-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu").get(".nc-erd-showViews-checkbox").click(); |
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showMMTables-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.get(".nc-erd-showMMTables-checkbox") |
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-table-node').should('have.length', 16) |
|
|
|
.click(); |
|
|
|
cy.get('.nc-erd-vue-flow').find('.vue-flow__edge').should('have.length', 26) |
|
|
|
|
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-circle').should('have.length', 22) |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
cy.get('.nc-erd-vue-flow').find('.nc-erd-edge-rect').should('have.length', 30) |
|
|
|
.find(".nc-erd-table-node") |
|
|
|
|
|
|
|
.should("have.length", 16); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".vue-flow__edge") |
|
|
|
|
|
|
|
.should("have.length", 26); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-circle") |
|
|
|
|
|
|
|
.should("have.length", 22); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-rect") |
|
|
|
|
|
|
|
.should("have.length", 30); |
|
|
|
|
|
|
|
|
|
|
|
// Check if store table is present
|
|
|
|
// Check if store table is present
|
|
|
|
cy.get('.nc-erd-vue-flow').find(`.nc-erd-table-node-store`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
}) |
|
|
|
.find(`.nc-erd-table-node-store`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it("Verify show junction table names", () => { |
|
|
|
it("Verify show junction table names", () => { |
|
|
|
// disable showViews
|
|
|
|
// disable showViews
|
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showJunctionTableNames-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.get(".nc-erd-showJunctionTableNames-checkbox") |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-erd-vue-flow').get('.nc-erd-table-label-filmactor-film_actor').should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow") |
|
|
|
|
|
|
|
.get(".nc-erd-table-label-filmactor-film_actor") |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Verify table ERD view of country', () => { |
|
|
|
it("Verify table ERD view of country", () => { |
|
|
|
mainPage.openTableErdView(); |
|
|
|
mainPage.openTableErdView(); |
|
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-erd-vue-flow-single-table').find('.nc-erd-table-node').should('have.length', 2) |
|
|
|
cy.get(".nc-erd-vue-flow-single-table") |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').find('.vue-flow__edge').should('have.length', 1) |
|
|
|
.find(".nc-erd-table-node") |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').find('.nc-erd-edge-circle').should('have.length', 1) |
|
|
|
.should("have.length", 2); |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').find('.nc-erd-edge-rect').should('have.length', 1) |
|
|
|
cy.get(".nc-erd-vue-flow-single-table") |
|
|
|
|
|
|
|
.find(".vue-flow__edge") |
|
|
|
|
|
|
|
.should("have.length", 1); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow-single-table") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-circle") |
|
|
|
|
|
|
|
.should("have.length", 1); |
|
|
|
|
|
|
|
cy.get(".nc-erd-vue-flow-single-table") |
|
|
|
|
|
|
|
.find(".nc-erd-edge-rect") |
|
|
|
|
|
|
|
.should("have.length", 1); |
|
|
|
|
|
|
|
|
|
|
|
const countryColumns = [ |
|
|
|
const countryColumns = [ |
|
|
|
'country_id', |
|
|
|
"country_id", |
|
|
|
'country', |
|
|
|
"country", |
|
|
|
'last_update', |
|
|
|
"last_update", |
|
|
|
'city_list' |
|
|
|
"city_list", |
|
|
|
] |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
// Country table
|
|
|
|
// Country table
|
|
|
|
countryColumns.forEach((colTitle) => { |
|
|
|
countryColumns.forEach((colTitle) => { |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').find(`.nc-erd-table-node-country`).find(`.nc-erd-table-node-country-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow-single-table") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-country`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-country-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const cityColumns = [ |
|
|
|
const cityColumns = [ |
|
|
|
'city_id', |
|
|
|
"city_id", |
|
|
|
'city', |
|
|
|
"city", |
|
|
|
'last_update', |
|
|
|
"last_update", |
|
|
|
'country', |
|
|
|
"country", |
|
|
|
'address_list' |
|
|
|
"address_list", |
|
|
|
] |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
// City table
|
|
|
|
// City table
|
|
|
|
cityColumns.forEach((colTitle) => { |
|
|
|
cityColumns.forEach((colTitle) => { |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').find(`.nc-erd-table-node-city`).find(`.nc-erd-table-node-city-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(".nc-erd-vue-flow-single-table") |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-city`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-city-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('Verify table ERD view of country showAllColumn disabled', () => { |
|
|
|
it("Verify table ERD view of country showAllColumn disabled", () => { |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow-single-table").within(() => { |
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
cy.get('.nc-erd-showPkAndFk-checkbox-disabled').should('exist'); |
|
|
|
.get(".nc-erd-showColumns-checkbox") |
|
|
|
cy.get('.nc-erd-showPkAndFk-checkbox-unchecked').should('exist'); |
|
|
|
.click(); |
|
|
|
|
|
|
|
cy.get(".nc-erd-showPkAndFk-checkbox-disabled").should("exist"); |
|
|
|
|
|
|
|
cy.get(".nc-erd-showPkAndFk-checkbox-unchecked").should("exist"); |
|
|
|
|
|
|
|
|
|
|
|
const countryColumns = [ |
|
|
|
const countryColumns = ["city_list"]; |
|
|
|
'city_list' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Country table
|
|
|
|
// Country table
|
|
|
|
countryColumns.forEach((colTitle) => { |
|
|
|
countryColumns.forEach((colTitle) => { |
|
|
|
cy.get(`.nc-erd-table-node-country`).find(`.nc-erd-table-node-country-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(`.nc-erd-table-node-country`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-country-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const cityColumns = [ |
|
|
|
const cityColumns = ["country", "address_list"]; |
|
|
|
'country', |
|
|
|
|
|
|
|
'address_list' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// City table
|
|
|
|
// City table
|
|
|
|
cityColumns.forEach((colTitle) => { |
|
|
|
cityColumns.forEach((colTitle) => { |
|
|
|
cy.get(`.nc-erd-table-node-city`).find(`.nc-erd-table-node-city-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(`.nc-erd-table-node-city`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-city-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showColumns-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
}) |
|
|
|
.get(".nc-erd-showColumns-checkbox") |
|
|
|
}) |
|
|
|
.click(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Verify table ERD view of country show PK AND FK disabled', () => { |
|
|
|
it("Verify table ERD view of country show PK AND FK disabled", () => { |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow-single-table").within(() => { |
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showPkAndFk-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.get(".nc-erd-showPkAndFk-checkbox") |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
const countryColumns = [ |
|
|
|
const countryColumns = ["country", "last_update", "city_list"]; |
|
|
|
'country', |
|
|
|
|
|
|
|
'last_update', |
|
|
|
|
|
|
|
'city_list' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Country table
|
|
|
|
// Country table
|
|
|
|
countryColumns.forEach((colTitle) => { |
|
|
|
countryColumns.forEach((colTitle) => { |
|
|
|
cy.get(`.nc-erd-table-node-country`).find(`.nc-erd-table-node-country-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(`.nc-erd-table-node-country`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-country-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const cityColumns = [ |
|
|
|
const cityColumns = ["city", "last_update", "country", "address_list"]; |
|
|
|
'city', |
|
|
|
|
|
|
|
'last_update', |
|
|
|
|
|
|
|
'country', |
|
|
|
|
|
|
|
'address_list' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// City table
|
|
|
|
// City table
|
|
|
|
cityColumns.forEach((colTitle) => { |
|
|
|
cityColumns.forEach((colTitle) => { |
|
|
|
cy.get(`.nc-erd-table-node-city`).find(`.nc-erd-table-node-city-column-${colTitle}`).should('exist'); |
|
|
|
cy.get(`.nc-erd-table-node-city`) |
|
|
|
|
|
|
|
.find(`.nc-erd-table-node-city-column-${colTitle}`) |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-erd-context-menu').get('.nc-erd-showPkAndFk-checkbox').click(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.get(".nc-erd-showPkAndFk-checkbox") |
|
|
|
}) |
|
|
|
.click(); |
|
|
|
cy.getActiveModal().find('.nc-modal-close').click({ force: true }); |
|
|
|
}); |
|
|
|
}) |
|
|
|
cy.getActiveModal().find(".nc-modal-close").click({ force: true }); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('create column and check if the change is in the schema', () => { |
|
|
|
it("create column and check if the change is in the schema", () => { |
|
|
|
mainPage.addColumn('test_column', 'country') |
|
|
|
mainPage.addColumn("test_column", "country"); |
|
|
|
|
|
|
|
|
|
|
|
// table view
|
|
|
|
// table view
|
|
|
|
mainPage.openTableErdView(); |
|
|
|
mainPage.openTableErdView(); |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow-single-table").within(() => { |
|
|
|
cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('exist'); |
|
|
|
cy.get(".nc-erd-table-node-country") |
|
|
|
}) |
|
|
|
.find(".nc-erd-table-node-country-column-test_column") |
|
|
|
cy.getActiveModal().find('.nc-modal-close').click({ force: true }); |
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
cy.getActiveModal().find(".nc-modal-close").click({ force: true }); |
|
|
|
|
|
|
|
|
|
|
|
// All table view
|
|
|
|
// All table view
|
|
|
|
mainPage.openErdTab(); |
|
|
|
mainPage.openErdTab(); |
|
|
|
cy.get('.nc-erd-vue-flow').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow").within(() => { |
|
|
|
cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('exist'); |
|
|
|
cy.get(".nc-erd-table-node-country") |
|
|
|
}) |
|
|
|
.find(".nc-erd-table-node-country-column-test_column") |
|
|
|
|
|
|
|
.should("exist"); |
|
|
|
|
|
|
|
}); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainPage.deleteColumn("test_column"); |
|
|
|
mainPage.deleteColumn('test_column') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// table view
|
|
|
|
// table view
|
|
|
|
mainPage.openTableErdView(); |
|
|
|
mainPage.openTableErdView(); |
|
|
|
cy.get('.nc-erd-vue-flow-single-table').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow-single-table").within(() => { |
|
|
|
cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('not.exist'); |
|
|
|
cy.get(".nc-erd-table-node-country") |
|
|
|
}) |
|
|
|
.find(".nc-erd-table-node-country-column-test_column") |
|
|
|
cy.getActiveModal().find('.nc-modal-close').click({ force: true }); |
|
|
|
.should("not.exist"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
cy.getActiveModal().find(".nc-modal-close").click({ force: true }); |
|
|
|
|
|
|
|
|
|
|
|
// All table view
|
|
|
|
// All table view
|
|
|
|
mainPage.openErdTab(); |
|
|
|
mainPage.openErdTab(); |
|
|
|
cy.get('.nc-erd-vue-flow').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow").within(() => { |
|
|
|
cy.get('.nc-erd-table-node-country').find('.nc-erd-table-node-country-column-test_column').should('not.exist'); |
|
|
|
cy.get(".nc-erd-table-node-country") |
|
|
|
}) |
|
|
|
.find(".nc-erd-table-node-country-column-test_column") |
|
|
|
|
|
|
|
.should("not.exist"); |
|
|
|
|
|
|
|
}); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('Create table should reflected in ERD', () => { |
|
|
|
it("Create table should reflected in ERD", () => { |
|
|
|
cy.createTable('new') |
|
|
|
cy.createTable("new"); |
|
|
|
|
|
|
|
|
|
|
|
mainPage.openErdTab(); |
|
|
|
mainPage.openErdTab(); |
|
|
|
cy.get('.nc-erd-vue-flow').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow").within(() => { |
|
|
|
cy.get('.nc-erd-table-node-new').should('exist'); |
|
|
|
cy.get(".nc-erd-table-node-new").should("exist"); |
|
|
|
}) |
|
|
|
}); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
|
|
|
|
|
|
|
|
cy.deleteTable('new') |
|
|
|
cy.deleteTable("new"); |
|
|
|
|
|
|
|
|
|
|
|
mainPage.openErdTab(); |
|
|
|
mainPage.openErdTab(); |
|
|
|
cy.get('.nc-erd-vue-flow').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow").within(() => { |
|
|
|
cy.get('.nc-erd-table-node-new').should('not.exist'); |
|
|
|
cy.get(".nc-erd-table-node-new").should("not.exist"); |
|
|
|
}) |
|
|
|
}); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it(`Disable MM setting Open Table ERD and check easter egg should not work`, () => { |
|
|
|
it(`Disable MM setting Open Table ERD and check easter egg should not work`, () => { |
|
|
|
mainPage.toggleShowMMSetting(); |
|
|
|
mainPage.toggleShowMMSetting(); |
|
|
|
|
|
|
|
|
|
|
|
mainPage.openErdTab(); |
|
|
|
mainPage.openErdTab(); |
|
|
|
cy.get('.nc-erd-vue-flow').within(() => { |
|
|
|
cy.get(".nc-erd-vue-flow").within(() => { |
|
|
|
cy.get('.nc-erd-context-menu').find('.nc-erd-showColumns-label').dblclick(); |
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
cy.get('.nc-erd-context-menu').find('.ant-checkbox').should('have.length', 3); |
|
|
|
.find(".nc-erd-showColumns-label") |
|
|
|
}) |
|
|
|
.dblclick(); |
|
|
|
|
|
|
|
cy.get(".nc-erd-context-menu") |
|
|
|
|
|
|
|
.find(".ant-checkbox") |
|
|
|
|
|
|
|
.should("have.length", 3); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
mainPage.closeMetaTab(); |
|
|
|
mainPage.closeMetaTab(); |
|
|
|
}); |
|
|
|
}); |
|
|
|