Browse Source

Merge branch 'develop' into develop

pull/1292/head
Raju Udava 3 years ago committed by GitHub
parent
commit
942ab9232c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 3
      scripts/cypress/cypress.json
  3. 1
      scripts/cypress/integration/common/00_pre_configurations.js
  4. 2
      scripts/cypress/integration/common/1a_table_operations.js
  5. 323
      scripts/cypress/integration/common/1b_table_column_operations.js
  6. 2
      scripts/cypress/integration/common/1d_pg_table_view_drag_drop_reorder.js
  7. 2
      scripts/cypress/integration/common/1d_table_view_drag_drop_reorder.js
  8. 319
      scripts/cypress/integration/common/1e_meta_sync.js
  9. 104
      scripts/cypress/integration/common/2a_table_with_belongs_to_colulmn.js
  10. 151
      scripts/cypress/integration/common/2b_table_with_m2m_column.js
  11. 419
      scripts/cypress/integration/common/3a_filter_sort_fields_operations.js
  12. 3
      scripts/cypress/integration/common/3b_formula_column.js
  13. 190
      scripts/cypress/integration/common/3c_lookup_column.js
  14. 2
      scripts/cypress/integration/common/3d_rollup_column.js
  15. 137
      scripts/cypress/integration/common/4a_table_view_grid_gallery_form.js
  16. 5
      scripts/cypress/integration/common/4b_table_view_share.js
  17. 1
      scripts/cypress/integration/common/4d_table_view_grid_locked.js
  18. 385
      scripts/cypress/integration/common/4e_form_view_share.js
  19. 811
      scripts/cypress/integration/common/4f_grid_view_share.js
  20. 2
      scripts/cypress/integration/common/5a_user_role.js
  21. 2
      scripts/cypress/integration/common/6b_downloadCsv.js
  22. 450
      scripts/cypress/integration/common/6c_swagger_api.js
  23. 7
      scripts/cypress/integration/common/6d_language_validation.js
  24. 115
      scripts/cypress/integration/common/6e_project_operations.js
  25. 205
      scripts/cypress/integration/common/6g_base_share.js
  26. 536
      scripts/cypress/integration/common/7a_create_project_from_excel.js
  27. 64
      scripts/cypress/support/commands.js
  28. 27
      scripts/cypress/support/page_objects/mainPage.js
  29. 8
      scripts/cypress/support/page_objects/navigation.js

1
.gitignore vendored

@ -83,3 +83,4 @@ mongod
# Cypress # Cypress
#========= #=========
shared.json shared.json
/scripts/Cypress/screenshots

3
scripts/cypress/cypress.json

@ -42,7 +42,8 @@
"host": "127.0.0.1", "host": "127.0.0.1",
"user": "root", "user": "root",
"password": "password" "password": "password"
} },
"screenshot": false
}, },
"fixturesFolder": "scripts/cypress/fixtures", "fixturesFolder": "scripts/cypress/fixtures",
"integrationFolder": "scripts/cypress/integration", "integrationFolder": "scripts/cypress/integration",

1
scripts/cypress/integration/common/00_pre_configurations.js

@ -166,6 +166,7 @@ export const genTest = (apiType, dbType) => {
const createProject = (proj) => { const createProject = (proj) => {
it(`Create ${proj.basic.name} project`, () => { it(`Create ${proj.basic.name} project`, () => {
cy.snip("ProjectPage");
// click home button // click home button
cy.get(".nc-noco-brand-icon").click(); cy.get(".nc-noco-brand-icon").click();

2
scripts/cypress/integration/common/1a_table_operations.js

@ -34,6 +34,8 @@ export const genTest = (apiType, dbType) => {
it("Open Audit tab", () => { it("Open Audit tab", () => {
mainPage.navigationDraw(mainPage.AUDIT).click(); mainPage.navigationDraw(mainPage.AUDIT).click();
cy.snip("AuditPage");
// wait for column headers to appear // wait for column headers to appear
// //
cy.get("thead > tr > th.caption").should("have.length", 5); cy.get("thead > tr > th.caption").should("have.length", 5);

323
scripts/cypress/integration/common/1b_table_column_operations.js

@ -1,165 +1,176 @@
import { mainPage } from "../../support/page_objects/mainPage"; import { mainPage } from "../../support/page_objects/mainPage";
import { import {
isTestSuiteActive, isTestSuiteActive,
isXcdb, isXcdb,
} from "../../support/page_objects/projectConstants"; } 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;
function addNewRow(index, cellValue) { function addNewRow(index, cellValue) {
cy.get(".nc-add-new-row-btn:visible").should("exist"); cy.get(".nc-add-new-row-btn:visible").should("exist");
cy.get(".nc-add-new-row-btn").click({ force: true }); cy.get(".nc-add-new-row-btn").click({ force: true });
cy.get("#data-table-form-Title > input").first().type(cellValue); cy.get("#data-table-form-Title > input").first().type(cellValue);
cy.getActiveModal() cy.snipActiveModal("Modal_AddNewRow");
.find("button") cy.getActiveModal()
.contains("Save Row") .find("button")
.click({ force: true }); .contains("Save Row")
.click({ force: true });
cy.toastWait("updated successfully");
mainPage.getCell("Title", index).contains(cellValue).should("exist"); cy.toastWait("updated successfully");
} mainPage.getCell("Title", index).contains(cellValue).should("exist");
}
describe(`${apiType.toUpperCase()} api - Table Column`, () => {
const name = "tablex"; describe(`${apiType.toUpperCase()} api - Table Column`, () => {
const colName = "column_name_a"; const name = "tablex";
const updatedColName = "updated_column_name"; const colName = "column_name_a";
const randVal = "Test@1234.com"; const updatedColName = "updated_column_name";
const updatedRandVal = "Updated@1234.com"; const randVal = "Test@1234.com";
const updatedRandVal = "Updated@1234.com";
before(() => {
cy.createTable(name); before(() => {
cy.createTable(name);
});
// delete table
after(() => {
cy.deleteTable(name, dbType);
});
it("Create Table Column", () => {
cy.get(`.project-tab:contains(${name}):visible`).should("exist");
mainPage.addColumn(colName, name);
cy.get(`th:contains(${colName})`).should("exist");
});
// edit the newly created column
it("Edit table column - change datatype", () => {
if (!isXcdb()) {
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
// change column type and verify
cy.get(".nc-ui-dt-dropdown").click();
cy.contains("LongText").click();
cy.get(".nc-col-create-or-edit-card").contains("Save").click();
cy.toastWait("Update table successful");
cy.get(`th[data-col="${colName}"] .mdi-text-subject`).should(
"exist"
);
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
}
});
// edit the newly created column
it("Edit table column - rename", () => {
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
// rename column and verify
cy.get(".nc-column-name-input input").clear().type(updatedColName);
cy.get(".nc-col-create-or-edit-card").contains("Save").click();
cy.toastWait("Update table successful");
cy.get(`th:contains(${colName})`).should("not.exist");
cy.get(`th:contains(${updatedColName})`).should("exist");
});
// delete the newly created column
it("Delete table column", () => {
cy.get(`th:contains(${updatedColName})`).should("exist");
cy.get(`th:contains(${updatedColName}) .mdi-menu-down`)
.trigger("mouseover")
.click();
cy.get(".nc-column-delete").click();
cy.get("button:contains(Confirm)").click();
cy.toastWait("Update table successful");
cy.get(`th:contains(${updatedColName})`).should("not.exist");
});
it("Add new row", () => {
addNewRow(1, randVal);
});
it("Update row", () => {
mainPage
.getRow(1)
.find(".nc-row-expand-icon")
.click({ force: true });
cy.get("#data-table-form-Title > input")
.first()
.clear()
.type(updatedRandVal);
cy.getActiveModal()
.find("button")
.contains("Save Row")
.click({ force: true });
cy.toastWait("updated successfully");
mainPage.getCell("Title", 1).contains(randVal).should("not.exist");
mainPage
.getCell("Title", 1)
.contains(updatedRandVal)
.should("exist");
});
it("Delete row", () => {
mainPage
.getCell("Title", 1)
.contains(updatedRandVal)
.rightclick({ force: true });
// delete row
cy.getActiveMenu()
.find('.v-list-item:contains("Delete Row")')
.first()
.click({ force: true });
// cy.toastWait('Deleted row successfully')
cy.get("td").contains(randVal).should("not.exist");
});
it("Select all row check-box validation", () => {
// add multiple rows
addNewRow(1, "a1");
addNewRow(2, "a2");
addNewRow(3, "a3");
addNewRow(4, "a4");
addNewRow(5, "a5");
// check-box, select-all. 0 indicates table header
mainPage
.getRow(0)
.find(".mdi-checkbox-blank-outline")
.click({ force: true });
// delete selected rows
mainPage.getCell("Title", 1).rightclick({ force: true });
cy.getActiveMenu()
.contains("Delete Selected Row")
.click({ force: true });
// verify if everything is wiped off
mainPage.getCell("Title", 1).contains("a1").should("not.exist");
});
}); });
// delete table
after(() => {
cy.deleteTable(name, dbType);
});
it("Create Table Column", () => {
cy.get(`.project-tab:contains(${name}):visible`).should("exist");
mainPage.addColumn(colName, name);
cy.get(`th:contains(${colName})`).should("exist");
});
// edit the newly created column
it("Edit table column - change datatype", () => {
if (!isXcdb()) {
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
// change column type and verify
cy.get(".nc-ui-dt-dropdown").click();
cy.contains("LongText").click();
cy.get(".nc-col-create-or-edit-card").contains("Save").click();
cy.toastWait("Update table successful");
cy.get(`th[data-col="${colName}"] .mdi-text-subject`).should("exist");
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
}
});
// edit the newly created column
it("Edit table column - rename", () => {
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
// rename column and verify
cy.get(".nc-column-name-input input").clear().type(updatedColName);
cy.get(".nc-col-create-or-edit-card").contains("Save").click();
cy.toastWait("Update table successful");
cy.get(`th:contains(${colName})`).should("not.exist");
cy.get(`th:contains(${updatedColName})`).should("exist");
});
// delete the newly created column
it("Delete table column", () => {
cy.get(`th:contains(${updatedColName})`).should("exist");
cy.get(`th:contains(${updatedColName}) .mdi-menu-down`)
.trigger("mouseover")
.click();
cy.get(".nc-column-delete").click();
cy.get("button:contains(Confirm)").click();
cy.toastWait("Update table successful");
cy.get(`th:contains(${updatedColName})`).should("not.exist");
});
it("Add new row", () => {
addNewRow(1, randVal);
});
it("Update row", () => {
mainPage.getRow(1).find(".nc-row-expand-icon").click({ force: true });
cy.get("#data-table-form-Title > input")
.first()
.clear()
.type(updatedRandVal);
cy.getActiveModal()
.find("button")
.contains("Save Row")
.click({ force: true });
cy.toastWait("updated successfully");
mainPage.getCell("Title", 1).contains(randVal).should("not.exist");
mainPage.getCell("Title", 1).contains(updatedRandVal).should("exist");
});
it("Delete row", () => {
mainPage
.getCell("Title", 1)
.contains(updatedRandVal)
.rightclick({ force: true });
// delete row
cy.getActiveMenu()
.find('.v-list-item:contains("Delete Row")')
.first()
.click({ force: true });
// cy.toastWait('Deleted row successfully')
cy.get("td").contains(randVal).should("not.exist");
});
it("Select all row check-box validation", () => {
// add multiple rows
addNewRow(1, "a1");
addNewRow(2, "a2");
addNewRow(3, "a3");
addNewRow(4, "a4");
addNewRow(5, "a5");
// check-box, select-all. 0 indicates table header
mainPage
.getRow(0)
.find(".mdi-checkbox-blank-outline")
.click({ force: true });
// delete selected rows
mainPage.getCell("Title", 1).rightclick({ force: true });
cy.getActiveMenu().contains("Delete Selected Row").click({ force: true });
// verify if everything is wiped off
mainPage.getCell("Title", 1).contains("a1").should("not.exist");
});
});
}; };
/** /**

2
scripts/cypress/integration/common/1d_pg_table_view_drag_drop_reorder.js

@ -87,6 +87,8 @@ export const genTest = (apiType, dbType) => {
// click on 'Grid/Gallery' button on Views bar // click on 'Grid/Gallery' button on Views bar
cy.get(`.nc-create-${viewType}-view`).click(); cy.get(`.nc-create-${viewType}-view`).click();
cy.snipActiveModal(`Modal_createView_${viewType}`);
// Pop up window, click Submit (accepting default name for view) // Pop up window, click Submit (accepting default name for view)
cy.getActiveModal().find("button:contains(Submit)").click(); cy.getActiveModal().find("button:contains(Submit)").click();

2
scripts/cypress/integration/common/1d_table_view_drag_drop_reorder.js

@ -80,6 +80,8 @@ export const genTest = (apiType, dbType) => {
// click on 'Grid/Gallery' button on Views bar // click on 'Grid/Gallery' button on Views bar
cy.get(`.nc-create-${viewType}-view`).click(); cy.get(`.nc-create-${viewType}-view`).click();
cy.snipActiveModal(`Modal_createView_${viewType}`);
// Pop up window, click Submit (accepting default name for view) // Pop up window, click Submit (accepting default name for view)
cy.getActiveModal().find("button:contains(Submit)").click(); cy.getActiveModal().find("button:contains(Submit)").click();

319
scripts/cypress/integration/common/1e_meta_sync.js

@ -1,165 +1,174 @@
import { mainPage } from "../../support/page_objects/mainPage"; import { mainPage } from "../../support/page_objects/mainPage";
import { loginPage } from "../../support/page_objects/navigation"; import { loginPage } from "../../support/page_objects/navigation";
import { import {
getCurrentMode, getCurrentMode,
getProjectString, getProjectString,
isTestSuiteActive, isTestSuiteActive,
isXcdb, isXcdb,
} from "../../support/page_objects/projectConstants"; } 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;
let projPrefix = `sakila.`; let projPrefix = `sakila.`;
let dbCmd = `queryDb`; let dbCmd = `queryDb`;
let tblDisplayPrefix = ``; let tblDisplayPrefix = ``;
describe(`${apiType.toUpperCase()} api - Meta Sync`, () => { describe(`${apiType.toUpperCase()} api - Meta Sync`, () => {
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
// //
before(() => { before(() => {
if (isXcdb()) { if (isXcdb()) {
cy.log(getProjectString()); cy.log(getProjectString());
projPrefix = `nc_${getProjectString()}__`; projPrefix = `nc_${getProjectString()}__`;
dbCmd = `sqliteExec`; dbCmd = `sqliteExec`;
tblDisplayPrefix = `nc_${getProjectString()}__`; tblDisplayPrefix = `nc_${getProjectString()}__`;
} }
mainPage.openMetaTab(); mainPage.openMetaTab();
});
after(() => {
mainPage.closeMetaTab();
});
it(`Create table`, () => {
// Create Table
cy.task(
dbCmd,
`CREATE TABLE ${projPrefix}table1 (id INT NOT NULL, col1 INT NULL, PRIMARY KEY (id))`
);
cy.task(
dbCmd,
`CREATE TABLE ${projPrefix}table2 (id INT NOT NULL, col1 INT NULL, PRIMARY KEY (id))`
);
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "New table");
});
it(`Add relation`, () => {
// working with relations in sqlite requires table to be deleted & recreated
//
if (!isXcdb()) {
// Add relation (FK)
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 ADD INDEX fk1_idx (col1 ASC) VISIBLE`
);
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 ADD CONSTRAINT fk1 FOREIGN KEY (col1) REFERENCES ${projPrefix}table2 (id) ON DELETE NO ACTION ON UPDATE NO ACTION`
);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New relation added"
);
}
});
it(`Remove relation`, () => {
// working with relations in sqlite requires table to be deleted & recreated
//
if (!isXcdb()) {
// Remove relation (FK)
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 DROP FOREIGN KEY fk1`
);
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 DROP INDEX fk1_idx`
);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"Relation removed"
);
}
});
it(`Add column`, () => {
// Add Column
let queryString = `ALTER TABLE ${projPrefix}table1 ADD COLUMN newCol VARCHAR(45) NULL AFTER id`;
if (isXcdb())
queryString = `ALTER TABLE ${projPrefix}table1 ADD COLUMN newCol TEXT NULL`;
cy.task(dbCmd, queryString);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New column(newCol)"
);
});
it(`Rename column`, () => {
// Rename Column
let queryString = `ALTER TABLE ${projPrefix}table1 CHANGE COLUMN newCol newColName VARCHAR(45) NULL DEFAULT NULL`;
if (isXcdb())
queryString = `ALTER TABLE ${projPrefix}table1 RENAME COLUMN newCol TO newColName`;
cy.task(dbCmd, queryString);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New column(newColName), Column removed(newCol)"
);
});
it(`Delete column`, () => {
// Remove Column
// to be fixed for SQLITE
if (!isXcdb()) {
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 DROP COLUMN newColName`
);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"Column removed(newColName)"
);
}
});
it(`Delete table`, () => {
// DROP TABLE
cy.task(dbCmd, `DROP TABLE ${projPrefix}table1`);
cy.task(dbCmd, `DROP TABLE ${projPrefix}table2`);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"Table removed"
);
});
it(`Hide, Filter, Sort`, () => {
cy.task(
dbCmd,
`CREATE TABLE ${projPrefix}table1 (id INT NOT NULL, col1 INT NULL, col2 INT NULL, col3 INT NULL, col4 INT NULL, PRIMARY KEY (id))`
);
cy.task(
dbCmd,
`INSERT INTO ${projPrefix}table1 (id, col1, col2, col3, col4) VALUES (1,1,1,1,1), (2,2,2,2,2), (3,3,3,3,3), (4,4,4,4,4), (5,5,5,5,5), (6,6,6,6,6), (7,7,7,7,7), (8,8,8,8,8), (9,9,9,9,9);`
);
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "New table");
mainPage.closeMetaTab();
cy.openTableTab("Table1", 9);
mainPage.hideField("Col1");
mainPage.sortField("Col1", "Z -> A");
mainPage.filterField(`Col1`, ">=", "5");
cy.get(".nc-grid-row").should("have.length", 5);
cy.closeTableTab("Table1");
});
it(`Verify`, () => {
mainPage.openMetaTab();
// Rename Column
let queryString = `ALTER TABLE ${projPrefix}table1 CHANGE COLUMN col1 newCol INT NULL DEFAULT NULL`;
if (isXcdb())
queryString = `ALTER TABLE ${projPrefix}table1 RENAME COLUMN col1 TO newCol`;
cy.task(dbCmd, queryString);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New column(newCol), Column removed(col1)"
);
cy.openTableTab("Table1", 9);
cy.deleteTable("Table1", dbType);
});
}); });
after(() => {
mainPage.closeMetaTab();
});
it(`Create table`, () => {
// Create Table
cy.task(
dbCmd,
`CREATE TABLE ${projPrefix}table1 (id INT NOT NULL, col1 INT NULL, PRIMARY KEY (id))`
);
cy.task(
dbCmd,
`CREATE TABLE ${projPrefix}table2 (id INT NOT NULL, col1 INT NULL, PRIMARY KEY (id))`
);
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "New table");
});
it(`Add relation`, () => {
// working with relations in sqlite requires table to be deleted & recreated
//
if (!isXcdb()) {
// Add relation (FK)
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 ADD INDEX fk1_idx (col1 ASC) VISIBLE`
);
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 ADD CONSTRAINT fk1 FOREIGN KEY (col1) REFERENCES ${projPrefix}table2 (id) ON DELETE NO ACTION ON UPDATE NO ACTION`
);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New relation added"
);
}
});
it(`Remove relation`, () => {
// working with relations in sqlite requires table to be deleted & recreated
//
if (!isXcdb()) {
// Remove relation (FK)
cy.task(dbCmd, `ALTER TABLE ${projPrefix}table1 DROP FOREIGN KEY fk1`);
cy.task(dbCmd, `ALTER TABLE ${projPrefix}table1 DROP INDEX fk1_idx`);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"Relation removed"
);
}
});
it(`Add column`, () => {
// Add Column
let queryString = `ALTER TABLE ${projPrefix}table1 ADD COLUMN newCol VARCHAR(45) NULL AFTER id`;
if (isXcdb())
queryString = `ALTER TABLE ${projPrefix}table1 ADD COLUMN newCol TEXT NULL`;
cy.task(dbCmd, queryString);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New column(newCol)"
);
});
it(`Rename column`, () => {
// Rename Column
let queryString = `ALTER TABLE ${projPrefix}table1 CHANGE COLUMN newCol newColName VARCHAR(45) NULL DEFAULT NULL`;
if (isXcdb())
queryString = `ALTER TABLE ${projPrefix}table1 RENAME COLUMN newCol TO newColName`;
cy.task(dbCmd, queryString);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New column(newColName), Column removed(newCol)"
);
});
it(`Delete column`, () => {
// Remove Column
// to be fixed for SQLITE
if (!isXcdb()) {
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 DROP COLUMN newColName`
);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"Column removed(newColName)"
);
}
});
it(`Delete table`, () => {
// DROP TABLE
cy.task(dbCmd, `DROP TABLE ${projPrefix}table1`);
cy.task(dbCmd, `DROP TABLE ${projPrefix}table2`);
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "Table removed");
});
it(`Hide, Filter, Sort`, () => {
cy.task(
dbCmd,
`CREATE TABLE ${projPrefix}table1 (id INT NOT NULL, col1 INT NULL, col2 INT NULL, col3 INT NULL, col4 INT NULL, PRIMARY KEY (id))`
);
cy.task(
dbCmd,
`INSERT INTO ${projPrefix}table1 (id, col1, col2, col3, col4) VALUES (1,1,1,1,1), (2,2,2,2,2), (3,3,3,3,3), (4,4,4,4,4), (5,5,5,5,5), (6,6,6,6,6), (7,7,7,7,7), (8,8,8,8,8), (9,9,9,9,9);`
);
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "New table");
mainPage.closeMetaTab();
cy.openTableTab("Table1", 9);
mainPage.hideField("Col1");
mainPage.sortField("Col1", "Z -> A");
mainPage.filterField(`Col1`, ">=", "5");
cy.get(".nc-grid-row").should("have.length", 5);
cy.closeTableTab("Table1");
});
it(`Verify`, () => {
mainPage.openMetaTab();
// Rename Column
let queryString = `ALTER TABLE ${projPrefix}table1 CHANGE COLUMN col1 newCol INT NULL DEFAULT NULL`;
if (isXcdb())
queryString = `ALTER TABLE ${projPrefix}table1 RENAME COLUMN col1 TO newCol`;
cy.task(dbCmd, queryString);
mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"New column(newCol), Column removed(col1)"
);
cy.openTableTab("Table1", 9);
cy.deleteTable("Table1", dbType);
});
});
}; };
/** /**

104
scripts/cypress/integration/common/2a_table_with_belongs_to_colulmn.js

@ -1,60 +1,72 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } 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;
describe(`${apiType.toUpperCase()} api - Table: belongs to, link record`, () => { describe(`${apiType.toUpperCase()} api - Table: belongs to, link record`, () => {
before(() => { before(() => {
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
}); });
after(() => { after(() => {
cy.closeTableTab("Country"); cy.closeTableTab("Country");
}); });
it("Table column header, URL validation", () => { it("Table column header, URL validation", () => {
// column name validation // column name validation
cy.get(`.project-tab:contains(Country):visible`).should("exist"); cy.get(`.project-tab:contains(Country):visible`).should("exist");
// URL validation // URL validation
cy.url().should("contain", `name=Country`); cy.url().should("contain", `name=Country`);
}); });
it("Expand belongs-to column", () => { it("Expand belongs-to column", () => {
// expand first row // expand first row
cy.get('td[data-col="Country => City"] div:visible', { timeout: 12000 }) cy.get('td[data-col="Country => City"] div:visible', {
.first() timeout: 12000,
.click(); })
cy.get('td[data-col="Country => City"] div .mdi-arrow-expand:visible') .first()
.first() .click();
.click(); cy.get(
}); 'td[data-col="Country => City"] div .mdi-arrow-expand:visible'
)
.first()
.click();
cy.snipActiveModal("Modal_BelongsTo");
});
it("Expand Link record, validate", () => {
cy.getActiveModal()
.find("button:contains(Link to 'City')")
.click()
.then(() => {
cy.snipActiveModal("Modal_BT_LinkRecord");
it("Expand Link record, validate", () => { // Link record form validation
cy.getActiveModal() cy.getActiveModal().contains("Link Record").should("exist");
.find("button:contains(Link to 'City')") cy.getActiveModal()
.click() .find("button.mdi-reload")
.then(() => { .should("exist");
// Link record form validation cy.getActiveModal()
cy.getActiveModal().contains("Link Record").should("exist"); .find('button:contains("New Record")')
cy.getActiveModal().find("button.mdi-reload").should("exist"); .should("exist");
cy.getActiveModal() cy.getActiveModal()
.find('button:contains("New Record")') .find(".child-card")
.should("exist"); .eq(0)
cy.getActiveModal() .contains("A Corua (La Corua)")
.find(".child-card") .should("exist");
.eq(0)
.contains("A Corua (La Corua)")
.should("exist");
cy.getActiveModal() cy.getActiveModal()
.find("button.mdi-close") .find("button.mdi-close")
.click() .click()
.then(() => { .then(() => {
cy.getActiveModal().find("button.mdi-close").click(); cy.getActiveModal()
}); .find("button.mdi-close")
.click();
});
});
}); });
}); });
});
}; };
/** /**

151
scripts/cypress/integration/common/2b_table_with_m2m_column.js

@ -1,88 +1,97 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } 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;
describe(`${apiType.toUpperCase()} api - M2M Column validation`, () => { describe(`${apiType.toUpperCase()} api - M2M Column validation`, () => {
before(() => { before(() => {
cy.openTableTab("Actor", 25); cy.openTableTab("Actor", 25);
}); });
after(() => { after(() => {
cy.closeTableTab("Actor"); cy.closeTableTab("Actor");
}); });
it("Table column header, URL validation", () => { it("Table column header, URL validation", () => {
// column name validation // column name validation
cy.get(`.project-tab:contains(Actor):visible`).should("exist"); cy.get(`.project-tab:contains(Actor):visible`).should("exist");
// URL validation // URL validation
cy.url().should("contain", `name=Actor`); cy.url().should("contain", `name=Actor`);
}); });
it("Expand m2m column", () => { it("Expand m2m column", () => {
// expand first row // expand first row
cy.get('td[data-col="Actor <=> Film"] div', { timeout: 12000 }) cy.get('td[data-col="Actor <=> Film"] div', { timeout: 12000 })
.first() .first()
.click({ force: true }); .click({ force: true });
cy.get('td[data-col="Actor <=> Film"] div .mdi-arrow-expand') cy.get('td[data-col="Actor <=> Film"] div .mdi-arrow-expand')
.first() .first()
.click({ force: true }); .click({ force: true });
// validations cy.snipActiveModal("Modal_ManyToMany");
cy.getActiveModal().contains("Film").should("exist");
cy.getActiveModal().find("button.mdi-reload").should("exist");
cy.getActiveModal()
.find("button:contains(Link to 'Film')")
.should("exist");
cy.getActiveModal()
.find(".child-card")
.eq(0)
.contains("ACADEMY DINOSAUR")
.should("exist");
});
it('Expand "Link to" record, validate', () => { // validations
cy.getActiveModal() cy.getActiveModal().contains("Film").should("exist");
.find("button:contains(Link to 'Film')") cy.getActiveModal().find("button.mdi-reload").should("exist");
.click() cy.getActiveModal()
.then(() => { .find("button:contains(Link to 'Film')")
// Link record form validation .should("exist");
cy.getActiveModal().contains("Link Record").should("exist"); cy.getActiveModal()
cy.getActiveModal().find("button.mdi-reload").should("exist"); .find(".child-card")
cy.getActiveModal() .eq(0)
.find('button:contains("New Record")') .contains("ACADEMY DINOSAUR")
.should("exist"); .should("exist");
cy.getActiveModal() });
.find(".child-card")
.eq(0) it('Expand "Link to" record, validate', () => {
.contains("ACE GOLDFINGER") cy.getActiveModal()
.should("exist"); .find("button:contains(Link to 'Film')")
cy.get("body").type("{esc}"); .click()
.then(() => {
cy.snipActiveModal("Modal_M2M_LinkToRecord");
// Link record form validation
cy.getActiveModal().contains("Link Record").should("exist");
cy.getActiveModal()
.find("button.mdi-reload")
.should("exist");
cy.getActiveModal()
.find('button:contains("New Record")')
.should("exist");
cy.getActiveModal()
.find(".child-card")
.eq(0)
.contains("ACE GOLDFINGER")
.should("exist");
cy.get("body").type("{esc}");
});
}); });
});
it("Expand first linked card, validate", () => { it("Expand first linked card, validate", () => {
cy.getActiveModal() cy.getActiveModal()
.find(".child-card") .find(".child-card")
.eq(0) .eq(0)
.contains("ACADEMY DINOSAUR", { timeout: 2000 }) .contains("ACADEMY DINOSAUR", { timeout: 2000 })
.click() .click()
.then(() => { .then(() => {
// Link card validation // Link card validation
cy.getActiveModal() cy.getActiveModal()
.find("h5") .find("h5")
.contains("ACADEMY DINOSAUR") .contains("ACADEMY DINOSAUR")
.should("exist"); .should("exist");
cy.getActiveModal() cy.getActiveModal()
.find('button:contains("Save Row")') .find('button:contains("Save Row")')
.should("exist"); .should("exist");
cy.getActiveModal().find('button:contains("Cancel")').should("exist"); cy.getActiveModal()
.find('button:contains("Cancel")')
.should("exist");
cy.getActiveModal().find('button:contains("Cancel")').click(); cy.getActiveModal()
cy.getActiveModal().find("button.mdi-close").click(); .find('button:contains("Cancel")')
.click();
cy.getActiveModal().find("button.mdi-close").click();
});
}); });
}); });
});
}; };
/** /**

419
scripts/cypress/integration/common/3a_filter_sort_fields_operations.js

@ -2,212 +2,221 @@ import { mainPage } from "../../support/page_objects/mainPage";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } 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;
describe(`${apiType.toUpperCase()} api - Filter, Fields, Sort`, () => { describe(`${apiType.toUpperCase()} api - Filter, Fields, Sort`, () => {
before(() => { before(() => {
// open country table // open country table
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
}); });
after(() => { after(() => {
cy.closeTableTab("Country"); cy.closeTableTab("Country");
}); });
describe(`Pagination`, () => { describe(`Pagination`, () => {
// check pagination // check pagination
it("Check country table - Pagination", () => { it("Check country table - Pagination", () => {
cy.get(".nc-pagination").should("exist"); cy.get(".nc-pagination").should("exist");
// verify > pagination option // verify > pagination option
mainPage.getPagination(">").click(); mainPage.getPagination(">").click();
mainPage mainPage
.getPagination(2) .getPagination(2)
.should("have.class", "v-pagination__item--active"); .should("have.class", "v-pagination__item--active");
// verify < pagination option // verify < pagination option
mainPage.getPagination("<").click(); mainPage.getPagination("<").click();
mainPage mainPage
.getPagination(1) .getPagination(1)
.should("have.class", "v-pagination__item--active"); .should("have.class", "v-pagination__item--active");
}); });
}); });
describe(`Row operations`, () => { describe(`Row operations`, () => {
// create new row using + button in header // create new row using + button in header
// //
it("Add row using tool header button", () => { it("Add row using tool header button", () => {
// add a row to end of Country table // add a row to end of Country table
cy.get(".nc-add-new-row-btn").click(); cy.get(".nc-add-new-row-btn").click();
cy.get("#data-table-form-Country > input").first().type("Test Country"); cy.get("#data-table-form-Country > input")
cy.contains("Save Row").filter("button").click(); .first()
.type("Test Country");
cy.toastWait("updated successfully"); cy.contains("Save Row").filter("button").click();
// verify cy.toastWait("updated successfully");
mainPage.getPagination(5).click();
mainPage // verify
.getCell("Country", 10) mainPage.getPagination(5).click();
.contains("Test Country") mainPage
.should("exist"); .getCell("Country", 10)
}); .contains("Test Country")
.should("exist");
// delete slingle row });
//
it("Delete row", () => { // delete slingle row
// delete row added in previous step //
mainPage.getCell("Country", 10).rightclick(); it("Delete row", () => {
cy.getActiveMenu().contains("Delete Row").click(); // delete row added in previous step
mainPage.getCell("Country", 10).rightclick();
// cy.toastWait('Deleted row successfully') cy.getActiveMenu().contains("Delete Row").click();
// verify // cy.toastWait('Deleted row successfully')
mainPage.getCell("Country", 10).should("not.exist");
}); // verify
mainPage.getCell("Country", 10).should("not.exist");
// create new row using right click menu option });
//
it("Add row using rightclick menu option", () => { // create new row using right click menu option
mainPage.getCell("Country", 9).rightclick({ force: true }); //
cy.getActiveMenu().contains("Insert New Row").click({ force: true }); it("Add row using rightclick menu option", () => {
mainPage mainPage.getCell("Country", 9).rightclick({ force: true });
.getCell("Country", 10)
.dblclick() cy.snipActiveMenu("Menu_GridRightClick");
.find("input")
.type("Test Country-1{enter}"); cy.getActiveMenu()
.contains("Insert New Row")
// cy.toastWait('saved successfully') .click({ force: true });
mainPage
mainPage.getCell("Country", 10).rightclick({ force: true }); .getCell("Country", 10)
cy.getActiveMenu().contains("Insert New Row").click({ force: true }); .dblclick()
mainPage .find("input")
.getCell("Country", 11) .type("Test Country-1{enter}");
.dblclick()
.find("input") // cy.toastWait('saved successfully')
.type("Test Country-2{enter}");
mainPage.getCell("Country", 10).rightclick({ force: true });
// cy.toastWait('saved successfully') cy.getActiveMenu()
.contains("Insert New Row")
// verify .click({ force: true });
mainPage mainPage
.getCell("Country", 10) .getCell("Country", 11)
.contains("Test Country-1") .dblclick()
.should("exist"); .find("input")
mainPage .type("Test Country-2{enter}");
.getCell("Country", 11)
.contains("Test Country-2") // cy.toastWait('saved successfully')
.should("exist");
}); // verify
mainPage
// delete selected rows (multiple) .getCell("Country", 10)
// .contains("Test Country-1")
it("Delete Selected", () => { .should("exist");
mainPage mainPage
.getRow(10) .getCell("Country", 11)
.find(".mdi-checkbox-blank-outline") .contains("Test Country-2")
.click({ force: true }); .should("exist");
mainPage });
.getRow(11)
.find(".mdi-checkbox-blank-outline") // delete selected rows (multiple)
.click({ force: true }); //
it("Delete Selected", () => {
mainPage.getCell("Country", 10).rightclick({ force: true }); mainPage
cy.getActiveMenu() .getRow(10)
.contains("Delete Selected Row") .find(".mdi-checkbox-blank-outline")
.click({ force: true }); .click({ force: true });
mainPage
// cy.toastWait('Deleted 2 selected rows successfully') .getRow(11)
.find(".mdi-checkbox-blank-outline")
// verify .click({ force: true });
mainPage.getCell("Country", 10).should("not.exist");
mainPage.getCell("Country", 11).should("not.exist"); mainPage.getCell("Country", 10).rightclick({ force: true });
cy.getActiveMenu()
mainPage.getPagination(1).click(); .contains("Delete Selected Row")
}); .click({ force: true });
});
// cy.toastWait('Deleted 2 selected rows successfully')
describe(`Sort operations`, () => {
it("Enable sort", () => { // verify
mainPage.sortField('Country', "Z -> A") mainPage.getCell("Country", 10).should("not.exist");
mainPage.getCell("Country", 11).should("not.exist");
// Sort menu operations (Country Column, Z->A)
// cy.get(".nc-sort-menu-btn").click(); mainPage.getPagination(1).click();
// cy.contains("Add Sort Option").click(); });
// cy.get(".nc-sort-field-select div").first().click(); });
// cy.get(
// ".menuable__content__active .v-list-item:contains(Country)" describe(`Sort operations`, () => {
// ).click(); it("Enable sort", () => {
// cy.get(".nc-sort-dir-select div").first().click(); mainPage.sortField("Country", "Z -> A");
// cy.get(
// '.menuable__content__active .v-list-item:contains("Z -> A")' // Sort menu operations (Country Column, Z->A)
// ).click(); // cy.get(".nc-sort-menu-btn").click();
// cy.contains("Add Sort Option").click();
cy.contains("Zambia").should("exist"); // cy.get(".nc-sort-field-select div").first().click();
}); // cy.get(
// ".menuable__content__active .v-list-item:contains(Country)"
it("Disable sort", () => { // ).click();
// remove sort and validate // cy.get(".nc-sort-dir-select div").first().click();
// cy.get(".nc-sort-item-remove-btn").click(); // cy.get(
mainPage.clearSort(); // '.menuable__content__active .v-list-item:contains("Z -> A")'
cy.contains("Zambia").should("not.exist"); // ).click();
});
}); cy.contains("Zambia").should("exist");
});
describe("Field Operation", () => {
it("Hide field", () => { it("Disable sort", () => {
cy.get("th:contains(LastUpdate)").should("be.visible"); // remove sort and validate
// cy.get(".nc-sort-item-remove-btn").click();
// toggle and confirm it's hidden mainPage.clearSort();
// cy.get(".nc-fields-menu-btn").click(); cy.contains("Zambia").should("not.exist");
// cy.get( });
// ".menuable__content__active .v-list-item label:contains(LastUpdate)" });
// ).click();
// cy.get(".nc-fields-menu-btn").click(); describe("Field Operation", () => {
mainPage.hideField('LastUpdate') it("Hide field", () => {
cy.get("th:contains(LastUpdate)").should("not.be.visible"); cy.get("th:contains(LastUpdate)").should("be.visible");
});
// toggle and confirm it's hidden
it("Show field", () => { // cy.get(".nc-fields-menu-btn").click();
// cy.get(".nc-fields-menu-btn").click(); // cy.get(
// cy.get( // ".menuable__content__active .v-list-item label:contains(LastUpdate)"
// ".menuable__content__active .v-list-item label:contains(LastUpdate)" // ).click();
// ).click(); // cy.get(".nc-fields-menu-btn").click();
// cy.get(".nc-fields-menu-btn").click(); mainPage.hideField("LastUpdate");
mainPage.unhideField('LastUpdate') cy.get("th:contains(LastUpdate)").should("not.be.visible");
cy.get("th:contains(LastUpdate)").should("be.visible"); });
});
}); it("Show field", () => {
// cy.get(".nc-fields-menu-btn").click();
describe("Filter operations", () => { // cy.get(
it("Create Filter", () => { // ".menuable__content__active .v-list-item label:contains(LastUpdate)"
mainPage.filterField('Country', 'is equal', 'India'); // ).click();
cy.get("td:contains(India)").should("exist"); // cy.get(".nc-fields-menu-btn").click();
mainPage.unhideField("LastUpdate");
// cy.get(".nc-filter-menu-btn").click(); cy.get("th:contains(LastUpdate)").should("be.visible");
// cy.contains("Add Filter").click(); });
});
// cy.get(".nc-filter-field-select").last().click();
// cy.getActiveMenu().find(".v-list-item:contains(Country)").click(); describe("Filter operations", () => {
// cy.get(".nc-filter-operation-select").last().click(); it("Create Filter", () => {
// cy.getActiveMenu().find('.v-list-item:contains("is equal")').click(); mainPage.filterField("Country", "is equal", "India");
// cy.get(".nc-filter-value-select input:text").last().type("India"); cy.get("td:contains(India)").should("exist");
// cy.get(".nc-filter-menu-btn")
// .click() // cy.get(".nc-filter-menu-btn").click();
// .then(() => { // cy.contains("Add Filter").click();
// cy.get("td:contains(India)").should("exist");
// }); // cy.get(".nc-filter-field-select").last().click();
}); // cy.getActiveMenu().find(".v-list-item:contains(Country)").click();
// cy.get(".nc-filter-operation-select").last().click();
it("Delete Filter", () => { // cy.getActiveMenu().find('.v-list-item:contains("is equal")').click();
// remove sort and check // cy.get(".nc-filter-value-select input:text").last().type("India");
mainPage.filterReset(); // cy.get(".nc-filter-menu-btn")
// cy.get(".nc-filter-menu-btn").click(); // .click()
// cy.get(".nc-filter-item-remove-btn").click(); // .then(() => {
// cy.get(".nc-filter-menu-btn").click(); // cy.get("td:contains(India)").should("exist");
cy.contains("td:contains(India)").should("not.exist"); // });
}); });
it("Delete Filter", () => {
// remove sort and check
mainPage.filterReset();
// cy.get(".nc-filter-menu-btn").click();
// cy.get(".nc-filter-item-remove-btn").click();
// cy.get(".nc-filter-menu-btn").click();
cy.contains("td:contains(India)").should("not.exist");
});
});
}); });
});
}; };
/** /**

3
scripts/cypress/integration/common/3b_formula_column.js

@ -49,6 +49,9 @@ export const genTest = (apiType, dbType) => {
// Column data type: to be set to formula in this context // Column data type: to be set to formula in this context
cy.get(".nc-ui-dt-dropdown").click().type("Formula"); cy.get(".nc-ui-dt-dropdown").click().type("Formula");
cy.snipActiveMenu("Formula");
cy.getActiveMenu().contains("Formula").click({ force: true }); cy.getActiveMenu().contains("Formula").click({ force: true });
// Configure formula // Configure formula

190
scripts/cypress/integration/common/3c_lookup_column.js

@ -1,101 +1,103 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } 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;
describe(`${apiType.toUpperCase()} api - LookUp column`, () => { describe(`${apiType.toUpperCase()} api - LookUp column`, () => {
// to retrieve few v-input nodes from their label // to retrieve few v-input nodes from their label
// //
const fetchParentFromLabel = (label) => { const fetchParentFromLabel = (label) => {
cy.get("label").contains(label).parents(".v-input").click(); cy.get("label").contains(label).parents(".v-input").click();
}; };
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
// //
before(() => { before(() => {
// open a table to work on views // open a table to work on views
// //
cy.openTableTab("City", 25); cy.openTableTab("City", 25);
});
after(() => {
cy.closeTableTab("City");
});
// Routine to create a new look up column
//
const addLookUpColumn = (childTable, childCol) => {
// (+) icon at end of column header (to add a new column)
// opens up a pop up window
//
cy.get(".new-column-header").click();
// Redundant to feed column name. as alias is displayed & referred for
cy.get(".nc-column-name-input input").clear().type(childCol);
// Column data type: to be set to lookup in this context
cy.get(".nc-ui-dt-dropdown").click();
cy.getActiveMenu().contains("Lookup").click();
// Configure Child table & column names
fetchParentFromLabel("Child Table");
cy.getActiveMenu().contains(childTable).click();
fetchParentFromLabel("Child column");
cy.getActiveMenu().contains(childCol).click();
cy.snipActiveMenu("LookUp");
// click on Save
cy.get(".nc-col-create-or-edit-card").contains("Save").click();
// Verify if column exists.
//
cy.get(`th:contains(${childCol})`).should("exist");
};
// routine to delete column
//
const deleteColumnByName = (childCol) => {
// verify if column exists before delete
cy.get(`th:contains(${childCol})`).should("exist");
// delete opiton visible on mouse-over
cy.get(`th:contains(${childCol}) .mdi-menu-down`)
.trigger("mouseover")
.click();
// delete/ confirm on pop-up
cy.get(".nc-column-delete").click();
cy.getActiveModal().find("button:contains(Confirm)").click();
// validate if deleted (column shouldnt exist)
cy.get(`th:contains(${childCol})`).should("not.exist");
};
///////////////////////////////////////////////////
// Test case
it("Add Lookup column (Address, PostalCode) & Delete", () => {
addLookUpColumn("Address", "PostalCode");
// Verify first entry, will be displayed as alias here 'childColumn (from childTable)'
cy.get(`tbody > :nth-child(1) > [data-col="PostalCode"]`)
.contains("4166")
.should("exist");
deleteColumnByName("PostalCode");
});
it.skip("Add Lookup column (Country, CountryId) & Delete", () => {
addLookUpColumn("Country", "CountryId");
// Verify first entry, will be displayed as alias here 'childColumn (from childTable)'
cy.get(`tbody > :nth-child(1) > [data-col="CountryId"]`)
.contains("87")
.should("exist");
deleteColumnByName("CountryId");
});
}); });
after(() => {
cy.closeTableTab("City");
});
// Routine to create a new look up column
//
const addLookUpColumn = (childTable, childCol) => {
// (+) icon at end of column header (to add a new column)
// opens up a pop up window
//
cy.get(".new-column-header").click();
// Redundant to feed column name. as alias is displayed & referred for
cy.get(".nc-column-name-input input").clear().type(childCol);
// Column data type: to be set to lookup in this context
cy.get(".nc-ui-dt-dropdown").click();
cy.getActiveMenu().contains("Lookup").click();
// Configure Child table & column names
fetchParentFromLabel("Child Table");
cy.getActiveMenu().contains(childTable).click();
fetchParentFromLabel("Child column");
cy.getActiveMenu().contains(childCol).click();
// click on Save
cy.get(".nc-col-create-or-edit-card").contains("Save").click();
// Verify if column exists.
//
cy.get(`th:contains(${childCol})`).should("exist");
};
// routine to delete column
//
const deleteColumnByName = (childCol) => {
// verify if column exists before delete
cy.get(`th:contains(${childCol})`).should("exist");
// delete opiton visible on mouse-over
cy.get(`th:contains(${childCol}) .mdi-menu-down`)
.trigger("mouseover")
.click();
// delete/ confirm on pop-up
cy.get(".nc-column-delete").click();
cy.getActiveModal().find("button:contains(Confirm)").click();
// validate if deleted (column shouldnt exist)
cy.get(`th:contains(${childCol})`).should("not.exist");
};
///////////////////////////////////////////////////
// Test case
it("Add Lookup column (Address, PostalCode) & Delete", () => {
addLookUpColumn("Address", "PostalCode");
// Verify first entry, will be displayed as alias here 'childColumn (from childTable)'
cy.get(`tbody > :nth-child(1) > [data-col="PostalCode"]`)
.contains("4166")
.should("exist");
deleteColumnByName("PostalCode");
});
it.skip("Add Lookup column (Country, CountryId) & Delete", () => {
addLookUpColumn("Country", "CountryId");
// Verify first entry, will be displayed as alias here 'childColumn (from childTable)'
cy.get(`tbody > :nth-child(1) > [data-col="CountryId"]`)
.contains("87")
.should("exist");
deleteColumnByName("CountryId");
});
});
}; };
// genTest('rest', false) // genTest('rest', false)

2
scripts/cypress/integration/common/3d_rollup_column.js

@ -55,6 +55,8 @@ export const genTest = (apiType, dbType) => {
fetchParentFromLabel("Aggregate function"); fetchParentFromLabel("Aggregate function");
cy.getActiveMenu().contains(aggregateFunc).click(); cy.getActiveMenu().contains(aggregateFunc).click();
cy.snipActiveMenu("RollUp");
// click on Save // click on Save
cy.get(".nc-col-create-or-edit-card").contains("Save").click(); cy.get(".nc-col-create-or-edit-card").contains("Save").click();

137
scripts/cypress/integration/common/4a_table_view_grid_gallery_form.js

@ -1,76 +1,81 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } 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;
describe(`${apiType.toUpperCase()} api - Table views: Create/Edit/Delete`, () => { describe(`${apiType.toUpperCase()} api - Table views: Create/Edit/Delete`, () => {
const name = "Test" + Date.now(); const name = "Test" + Date.now();
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
// //
before(() => { before(() => {
// open a table to work on views // open a table to work on views
// //
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
}); });
after(() => { after(() => {
cy.closeTableTab("Country"); cy.closeTableTab("Country");
}); });
// Common routine to create/edit/delete GRID & GALLERY view
// Input: viewType - 'grid'/'gallery'
//
const viewTest = (viewType) => {
it(`Create ${viewType} view`, () => {
// click on 'Grid/Gallery' button on Views bar
cy.get(`.nc-create-${viewType}-view`).click();
// Pop up window, click Submit (accepting default name for view)
cy.getActiveModal().find("button:contains(Submit)").click();
cy.toastWait("View created successfully");
// validate if view was creted && contains default name 'Country1'
cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("Country1")
.should("exist");
cy.snip(`View_${viewType}`);
});
it(`Edit ${viewType} view name`, () => {
// click on edit-icon (becomes visible on hovering mouse)
cy.get(".nc-view-edit-icon").click({
force: true,
timeout: 1000,
});
// Common routine to create/edit/delete GRID & GALLERY view // feed new name
// Input: viewType - 'grid'/'gallery' cy.get(`.nc-${viewType}-view-item input`).type(
// `${viewType}View-1{enter}`
const viewTest = (viewType) => { );
it(`Create ${viewType} view`, () => { cy.toastWait("View renamed successfully");
// click on 'Grid/Gallery' button on Views bar
cy.get(`.nc-create-${viewType}-view`).click(); // validate
cy.get(`.nc-view-item.nc-${viewType}-view-item`)
// Pop up window, click Submit (accepting default name for view) .contains(`${viewType}View-1`)
cy.getActiveModal().find("button:contains(Submit)").click(); .should("exist");
cy.toastWait("View created successfully"); });
// validate if view was creted && contains default name 'Country1' it(`Delete ${viewType} view`, () => {
cy.get(`.nc-view-item.nc-${viewType}-view-item`) // number of view entries should be 2 before we delete
.contains("Country1") cy.get(".nc-view-item").its("length").should("eq", 2);
.should("exist");
}); // click on delete icon (becomes visible on hovering mouse)
cy.get(".nc-view-delete-icon").click({ force: true });
it(`Edit ${viewType} view name`, () => { cy.toastWait("View deleted successfully");
// click on edit-icon (becomes visible on hovering mouse)
cy.get(".nc-view-edit-icon").click({ force: true, timeout: 1000 }); // confirm if the number of veiw entries is reduced by 1
cy.get(".nc-view-item").its("length").should("eq", 1);
// feed new name });
cy.get(`.nc-${viewType}-view-item input`).type( };
`${viewType}View-1{enter}`
); // below four scenario's will be invoked twice, once for rest & then for graphql
cy.toastWait("View renamed successfully"); viewTest("grid");
viewTest("gallery");
// validate viewTest("form");
cy.get(`.nc-view-item.nc-${viewType}-view-item`) // viewTest("kanban");
.contains(`${viewType}View-1`) });
.should("exist");
});
it(`Delete ${viewType} view`, () => {
// number of view entries should be 2 before we delete
cy.get(".nc-view-item").its("length").should("eq", 2);
// click on delete icon (becomes visible on hovering mouse)
cy.get(".nc-view-delete-icon").click({ force: true });
cy.toastWait("View deleted successfully");
// confirm if the number of veiw entries is reduced by 1
cy.get(".nc-view-item").its("length").should("eq", 1);
});
};
// below four scenario's will be invoked twice, once for rest & then for graphql
viewTest("grid");
viewTest("gallery");
viewTest("form");
// viewTest("kanban");
});
}; };
/** /**

5
scripts/cypress/integration/common/4b_table_view_share.js

@ -11,11 +11,16 @@ const generateLinkWithPwd = () => {
// .click(); // .click();
mainPage.shareView().click(); mainPage.shareView().click();
cy.snipActiveModal("Modal_ShareView")
// enable checkbox & feed pwd, save // enable checkbox & feed pwd, save
cy.getActiveModal() cy.getActiveModal()
.find('[role="switch"][type="checkbox"]') .find('[role="switch"][type="checkbox"]')
.click({ force: true }); .click({ force: true });
cy.getActiveModal().find('input[type="password"]').type("1"); cy.getActiveModal().find('input[type="password"]').type("1");
cy.snipActiveModal("Modal_ShareView_Password");
cy.getActiveModal().find('button:contains("Save password")').click(); cy.getActiveModal().find('button:contains("Save password")').click();
cy.toastWait("Successfully updated"); cy.toastWait("Successfully updated");

1
scripts/cypress/integration/common/4d_table_view_grid_locked.js

@ -25,6 +25,7 @@ export const genTest = (apiType, dbType) => {
// on menu, collaboration view appears first (at index 0) // on menu, collaboration view appears first (at index 0)
// followed by Locked view (at index 1) // followed by Locked view (at index 1)
cy.get(".xc-toolbar").find(".nc-view-lock-menu:enabled").click(); cy.get(".xc-toolbar").find(".nc-view-lock-menu:enabled").click();
cy.snipActiveMenu("Menu_Collaboration")
cy.getActiveMenu().find('[role="menuitem"]').eq(menuOption).click(); cy.getActiveMenu().find('[role="menuitem"]').eq(menuOption).click();
// expected toolbar for Lock view: Only lock-view menu, reload, toggle-nav-drawer to be enabled // expected toolbar for Lock view: Only lock-view menu, reload, toggle-nav-drawer to be enabled

385
scripts/cypress/integration/common/4e_form_view_share.js

@ -4,193 +4,222 @@ import { mainPage } from "../../support/page_objects/mainPage";
let storedURL = ""; let storedURL = "";
export const genTest = (apiType, dbType) => { export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return; if (!isTestSuiteActive(apiType, dbType)) return;
describe(`${apiType.toUpperCase()} api - FORM view (Share)`, () => { describe(`${apiType.toUpperCase()} api - FORM view (Share)`, () => {
const name = "Test" + Date.now(); const name = "Test" + Date.now();
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
// //
before(() => { before(() => {
// open a table to work on views // open a table to work on views
// //
cy.openTableTab("City", 25); cy.openTableTab("City", 25);
}); });
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => { beforeEach(() => {
cy.saveLocalStorage(); cy.restoreLocalStorage();
}); });
after(() => { afterEach(() => {
cy.closeTableTab("City"); cy.saveLocalStorage();
}); });
// Common routine to create/edit/delete GRID & GALLERY view after(() => {
// Input: viewType - 'grid'/'gallery' cy.closeTableTab("City");
//
const viewTest = (viewType) => {
it(`Create ${viewType} view`, () => {
// click on 'Grid/Gallery' button on Views bar
cy.get(`.nc-create-${viewType}-view`).click();
// Pop up window, click Submit (accepting default name for view)
cy.getActiveModal().find("button:contains(Submit)").click();
cy.toastWait("View created successfully");
// Prepare form
// add header, description
// add post submission message
// swap position for City, LastUpdate fields
// remove City=>Address field
cy.get(".nc-form > .mx-auto").find('[type="checkbox"]').eq(1).click();
cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]')
.eq(1)
.should("be.checked");
cy.get(".nc-form").find('[placeholder="Form Title"]').type("A B C D");
cy.get(".nc-form")
.find('[placeholder="Add form description"]')
.type("Some description about form comes here");
cy.get(".nc-form > .mx-auto").find("textarea").type("Congratulations!");
cy.get("#data-table-form-City").drag("#data-table-form-LastUpdate");
cy.get('[title="City => Address"]').drag(".nc-drag-n-drop-to-hide");
cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]')
.eq(1)
.should("be.checked");
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
}); });
});
// Common routine to create/edit/delete GRID & GALLERY view
it(`Share form view`, () => { // Input: viewType - 'grid'/'gallery'
cy.get(".nc-form > .mx-auto") //
.find('[type="checkbox"]') const viewTest = (viewType) => {
.eq(1) it(`Create ${viewType} view`, () => {
.should("be.checked"); // click on 'Grid/Gallery' button on Views bar
cy.get(`.nc-view-item.nc-${viewType}-view-item`) cy.get(`.nc-create-${viewType}-view`).click();
.contains("City1")
.click(); // Pop up window, click Submit (accepting default name for view)
// cy.get(".v-navigation-drawer__content > .container") cy.getActiveModal().find("button:contains(Submit)").click();
// .find(".v-list > .v-list-item")
// .contains("Share View") cy.toastWait("View created successfully");
// .click();
mainPage.shareView().click(); // Prepare form
// add header, description
// copy link text, visit URL // add post submission message
cy.getActiveModal() // swap position for City, LastUpdate fields
.find(".share-link-box") // remove City=>Address field
.contains("/nc/form/", { timeout: 10000 }) cy.get(".nc-form > .mx-auto")
.then(($obj) => { .find('[type="checkbox"]')
let linkText = $obj.text().trim(); .eq(1)
cy.log(linkText); .click();
cy.visit(linkText, { cy.get(".nc-form > .mx-auto")
baseUrl: null, .find('[type="checkbox"]')
.eq(1)
.should("be.checked");
cy.get(".nc-form")
.find('[placeholder="Form Title"]')
.type("A B C D");
cy.get(".nc-form")
.find('[placeholder="Add form description"]')
.type("Some description about form comes here");
cy.get(".nc-form > .mx-auto")
.find("textarea")
.type("Congratulations!");
cy.get("#data-table-form-City").drag(
"#data-table-form-LastUpdate"
);
cy.get('[title="City => Address"]').drag(
".nc-drag-n-drop-to-hide"
);
cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]')
.eq(1)
.should("be.checked");
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
});
}); });
// wait for share view page to load! it(`Share form view`, () => {
cy.get(".nc-form").should("exist"); cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]')
// New form appeared? Header & description should exist .eq(1)
cy.get(".nc-form", { timeout: 10000 }) .should("be.checked");
.find("h2") cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("A B C D") .contains("City1")
.should("exist"); .click();
cy.get(".nc-form", { timeout: 10000 }) // cy.get(".v-navigation-drawer__content > .container")
.find(".body-1") // .find(".v-list > .v-list-item")
.contains("Some description about form comes here") // .contains("Share View")
.should("exist"); // .click();
mainPage.shareView().click();
// all fields, barring removed field should exist
cy.get('[title="City"]').should("exist"); cy.snipActiveModal("Modal_ShareView");
cy.get('[title="LastUpdate"]').should("exist");
cy.get('[title="Country <= City"]').should("exist"); // copy link text, visit URL
cy.get('[title="City => Address"]').should("not.exist"); cy.getActiveModal()
.find(".share-link-box")
// order of LastUpdate & City field is retained .contains("/nc/form/", { timeout: 10000 })
cy.get(".nc-field-wrapper") .then(($obj) => {
.eq(0) let linkText = $obj.text().trim();
.contains("LastUpdate") cy.log(linkText);
.should("exist"); cy.visit(linkText, {
cy.get(".nc-field-wrapper").eq(1).contains("City").should("exist"); baseUrl: null,
});
// submit form, to read message
cy.get("#data-table-form-City").type("_abc"); // wait for share view page to load!
cy.get("#data-table-form-LastUpdate").click(); cy.get(".nc-form").should("exist");
cy.getActiveModal().find("button").contains("19").click();
cy.getActiveModal().find("button").contains("OK").click(); cy.snip("ShareView_Form");
cy.get("button").contains("Link to 'Country'").click();
cy.getActiveModal() // New form appeared? Header & description should exist
.find(".child-card") cy.get(".nc-form", { timeout: 10000 })
.contains("Afghanistan") .find("h2")
.click(); .contains("A B C D")
.should("exist");
// submit button & validate cy.get(".nc-form", { timeout: 10000 })
cy.get(".nc-form").find("button").contains("Submit").click(); .find(".body-1")
cy.toastWait("Congratulations"); .contains("Some description about form comes here")
cy.get(".v-alert") .should("exist");
.contains("Congratulations")
.should("exist") // all fields, barring removed field should exist
.then(() => { cy.get('[title="City"]').should("exist");
cy.get(".nc-form").should("exist"); cy.get('[title="LastUpdate"]').should("exist");
cy.get('[title="Country <= City"]').should("exist");
// validate if form has appeared again cy.get('[title="City => Address"]').should("not.exist");
cy.get(".nc-form", { timeout: 10000 })
.find("h2") // order of LastUpdate & City field is retained
.contains("A B C D") cy.get(".nc-field-wrapper")
.should("exist"); .eq(0)
cy.get(".nc-form", { timeout: 10000 }) .contains("LastUpdate")
.find(".body-1") .should("exist");
.contains("Some description about form comes here") cy.get(".nc-field-wrapper")
.should("exist"); .eq(1)
}); .contains("City")
}); .should("exist");
});
// submit form, to read message
it(`Delete ${viewType} view`, () => { cy.get("#data-table-form-City").type("_abc");
// go back to base page cy.get("#data-table-form-LastUpdate").click();
cy.visit(storedURL, { cy.getActiveModal()
baseUrl: null, .find("button")
}); .contains("19")
.click();
cy.getActiveModal()
.find("button")
.contains("OK")
.click();
cy.get("button").contains("Link to 'Country'").click();
cy.getActiveModal()
.find(".child-card")
.contains("Afghanistan")
.click();
// submit button & validate
cy.get(".nc-form")
.find("button")
.contains("Submit")
.click();
cy.toastWait("Congratulations");
cy.get(".v-alert")
.contains("Congratulations")
.should("exist")
.then(() => {
cy.get(".nc-form").should("exist");
// validate if form has appeared again
cy.get(".nc-form", { timeout: 10000 })
.find("h2")
.contains("A B C D")
.should("exist");
cy.get(".nc-form", { timeout: 10000 })
.find(".body-1")
.contains(
"Some description about form comes here"
)
.should("exist");
});
});
});
// number of view entries should be 2 before we delete it(`Delete ${viewType} view`, () => {
cy.get(".nc-view-item").its("length").should("eq", 2); // go back to base page
cy.visit(storedURL, {
// click on delete icon (becomes visible on hovering mouse) baseUrl: null,
cy.get(".nc-view-delete-icon").click({ force: true }); });
cy.toastWait("View deleted successfully");
// number of view entries should be 2 before we delete
// confirm if the number of veiw entries is reduced by 1 cy.get(".nc-view-item").its("length").should("eq", 2);
cy.get(".nc-view-item").its("length").should("eq", 1);
// click on delete icon (becomes visible on hovering mouse)
// clean up newly added rows into Country table operations cy.get(".nc-view-delete-icon").click({ force: true });
// this auto verifies successfull addition of rows to table as well cy.toastWait("View deleted successfully");
mainPage.getPagination(25).click();
cy.get(".nc-grid-row").should("have.length", 1); // confirm if the number of veiw entries is reduced by 1
mainPage cy.get(".nc-view-item").its("length").should("eq", 1);
.getRow(1)
.find(".mdi-checkbox-blank-outline") // clean up newly added rows into Country table operations
.click({ force: true }); // this auto verifies successfull addition of rows to table as well
mainPage.getPagination(25).click();
mainPage.getCell("City", 1).rightclick(); cy.get(".nc-grid-row").should("have.length", 1);
cy.getActiveMenu().contains("Delete Selected Row").click(); mainPage
// cy.toastWait('Deleted selected rows successfully') .getRow(1)
}); .find(".mdi-checkbox-blank-outline")
}; .click({ force: true });
// below scenario's will be invoked twice, once for rest & then for graphql mainPage.getCell("City", 1).rightclick();
viewTest("form"); cy.getActiveMenu().contains("Delete Selected Row").click();
}); // cy.toastWait('Deleted selected rows successfully')
});
};
// below scenario's will be invoked twice, once for rest & then for graphql
viewTest("form");
});
}; };
/** /**

811
scripts/cypress/integration/common/4f_grid_view_share.js

@ -12,418 +12,443 @@ let storedURL = "";
let viewURL = {}; let viewURL = {};
export const genTest = (apiType, dbType) => { export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return; if (!isTestSuiteActive(apiType, dbType)) return;
const generateViewLink = (viewName) => {
// click on share view
// cy.get(".v-navigation-drawer__content > .container")
// .find(".v-list > .v-list-item")
// .contains("Share View")
// .click();
mainPage.shareView().click();
// wait, as URL initially will be /undefined
cy.getActiveModal()
.find(".share-link-box")
.contains("/nc/view/", { timeout: 10000 })
.should("exist");
// copy link text, visit URL
cy.getActiveModal()
.find(".share-link-box")
.contains("/nc/view/", { timeout: 10000 })
.then(($obj) => {
cy.get("body").type("{esc}");
// viewURL.push($obj.text())
viewURL[viewName] = $obj.text().trim();
});
};
describe(`${apiType.toUpperCase()} api - GRID view (Share)`, () => {
// Run once before test- create project (rest/graphql)
//
before(() => {
// open a table to work on views
//
cy.openTableTab("Address", 25);
cy.saveLocalStorage();
});
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => {
cy.saveLocalStorage();
});
after(() => {
// close table
// mainPage.deleteCreatedViews()
cy.closeTableTab("Address");
});
// Common routine to create/edit/delete GRID & GALLERY view const generateViewLink = (viewName) => {
// Input: viewType - 'grid'/'gallery' // click on share view
//
const viewTest = (viewType) => {
it(`Create ${viewType.toUpperCase()} view`, () => {
// create a normal public view
cy.get(`.nc-create-${viewType}-view`).click();
cy.getActiveModal().find("button:contains(Submit)").click();
cy.toastWait("View created successfully");
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
});
});
it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => {
cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("Address1")
.click();
mainPage.hideField("Address2");
mainPage.sortField("District", "Z -> A");
mainPage.filterField("Address", "is like", "Ab");
generateViewLink("combined");
cy.log(viewURL["combined"]);
});
it(`Share GRID view : ensure we have only one link even if shared multiple times`, () => {
// generate view link multiple times
generateViewLink("combined");
generateViewLink("combined");
// verify if only one link exists in table
// cy.get(".v-navigation-drawer__content > .container") // cy.get(".v-navigation-drawer__content > .container")
// .find(".v-list > .v-list-item") // .find(".v-list > .v-list-item")
// .contains("Share View") // .contains("Share View")
// .parent()
// .find("button.mdi-dots-vertical")
// .click(); // .click();
mainPage.shareViewList().click(); mainPage.shareView().click();
// cy.getActiveMenu().find(".v-list-item").contains("Views List").click();
cy.get('th:contains("View Link")').should("exist");
cy.get('th:contains("View Link")')
.parent()
.parent()
.next()
.find("tr")
.its("length")
.should("eq", 1)
.then(() => {
// cy.get(".v-overlay__content > .d-flex > .v-icon").click();
// close modal (fix me! add a close button to share view list modal)
cy.get('.v-overlay--active > .v-overlay__scrim').click({force: true});
});
});
it(`Share ${viewType.toUpperCase()} view : Visit URL, Verify title`, () => {
// visit public view
cy.visit(viewURL["combined"], {
baseUrl: null,
});
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 18);
// verify title
cy.get("div.model-name").contains("Address1").should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify fields hidden/open`, () => {
// verify column headers
cy.get('[data-col="Address"]').should("exist");
cy.get('[data-col="Address2"]').should("not.exist");
cy.get('[data-col="District"]').should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify fields sort/ filter`, () => {
// country column content verification before sort
mainPage
.getCell("District", 1)
.contains("West Bengali")
.should("exist");
mainPage.getCell("District", 2).contains("Tutuila").should("exist");
mainPage.getCell("District", 3).contains("Tamil Nadu").should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify download CSV`, () => {
mainPage.hideField("LastUpdate");
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`Address,District,PostalCode,Phone,Location,Address => Customer,Address => Staff,City <= Address,Address <=> Staff`,
`1013 Tabuk Boulevard,West Bengali,96203,158399646978,[object Object],2,,Kanchrapara,`,
`1892 Nabereznyje Telny Lane,Tutuila,28396,478229987054,[object Object],2,,Tafuna,`,
`1993 Tabuk Lane,Tamil Nadu,64221,648482415405,[object Object],2,,Tambaram,`,
`1661 Abha Drive,Tamil Nadu,14400,270456873752,[object Object],1,,Pudukkottai,`,
];
for (let i = 0; i < storedRecords.length; i++) {
let strCol = storedRecords[i].split(",");
let retCol = retrievedRecords[i].split(",");
for (let j = 0; j < 4; j++) {
expect(strCol[j]).to.be.equal(retCol[j]);
}
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i])
}
};
// download & verify // wait, as URL initially will be /undefined
mainPage.downloadAndVerifyCsv(`Address_exported_1.csv`, verifyCsv);
mainPage.unhideField("LastUpdate");
});
it(`Share ${viewType.toUpperCase()} view : Disable sort`, () => {
// remove sort and validate
mainPage.clearSort();
mainPage
.getCell("District", 1)
.contains("Southern Mindanao")
.should("exist");
});
it(`Share ${viewType.toUpperCase()} view : Enable sort`, () => {
// Sort menu operations (Country Column, Z->A)
mainPage.sortField("District", "Z -> A");
mainPage
.getCell("District", 1)
.contains("West Bengali")
.should("exist");
});
it(`Share ${viewType.toUpperCase()} view : Create Filter`, () => {
// add filter & validate
mainPage.filterField("District", "is like", "Tamil");
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 2);
mainPage.getCell("District", 1).contains("Tamil").should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify download CSV after local filter`, () => {
mainPage.hideField("LastUpdate");
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`Address,District,PostalCode,Phone,Location,Address => Customer,Address => Staff,City <= Address,Address <=> Staff`,
`1993 Tabuk Lane,Tamil Nadu,64221,648482415405,[object Object],2,,Tambaram,`,
`1661 Abha Drive,Tamil Nadu,14400,270456873752,[object Object],1,,Pudukkottai,`,
];
// for (let i = 0; i < storedRecords.length; i++) {
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i])
// }
for (let i = 0; i < storedRecords.length; i++) {
let strCol = storedRecords[i].split(",");
let retCol = retrievedRecords[i].split(",");
for (let j = 0; j < 4; j++) {
expect(strCol[j]).to.be.equal(retCol[j]);
}
}
};
mainPage.downloadAndVerifyCsv(`Address_exported_1.csv`, verifyCsv);
mainPage.unhideField("LastUpdate");
});
it(`Share ${viewType.toUpperCase()} view : Delete Filter`, () => {
// Remove sort and Validate
mainPage.filterReset();
mainPage
.getCell("District", 1)
.contains("West Bengali")
.should("exist");
});
it(`Share GRID view : Virtual column validation > has many`, () => {
// verify column headers
cy.get('[data-col="Address => Customer"]').should("exist");
cy.get('[data-col="Address => Staff"]').should("exist");
cy.get('[data-col="City <= Address"]').should("exist");
cy.get('[data-col="Address <=> Staff"]').should("exist");
// has many field validation
mainPage
.getCell("Address => Customer", 3)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("Address => Customer", 3)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("Address => Customer", 3)
.click()
.find("button.mdi-arrow-expand")
.click();
cy.getActiveModal().find("button.mdi-reload").should("exist");
cy.getActiveModal() cy.getActiveModal()
.find("button") .find(".share-link-box")
.contains("Link to") .contains("/nc/view/", { timeout: 10000 })
.should("not.exist"); .should("exist");
cy.getActiveModal().find(".child-card").contains("2").should("exist");
cy.getActiveModal() // copy link text, visit URL
.find(".child-card")
.find("button")
.should("not.exist");
cy.get("body").type("{esc}");
});
it(`Share GRID view : Virtual column validation > belongs to`, () => {
// belongs to field validation
mainPage
.getCell("City <= Address", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("City <= Address", 1)
.click()
.find("button.mdi-arrow-expand")
.should("not.exist");
mainPage
.getCell("City <= Address", 1)
.find(".v-chip")
.contains("Kanchrapara")
.should("exist");
});
it(`Share GRID view : Virtual column validation > many to many`, () => {
// many-to-many field validation
mainPage
.getCell("Address <=> Staff", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("Address <=> Staff", 1)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("Address <=> Staff", 1)
.click()
.find("button.mdi-arrow-expand")
.click();
cy.getActiveModal().find("button.mdi-reload").should("exist");
cy.getActiveModal() cy.getActiveModal()
.find("button") .find(".share-link-box")
.contains("Link to") .contains("/nc/view/", { timeout: 10000 })
.should("not.exist"); .then(($obj) => {
cy.get("body").type("{esc}"); cy.get("body").type("{esc}");
}); // viewURL.push($obj.text())
viewURL[viewName] = $obj.text().trim();
it(`Delete ${viewType.toUpperCase()} view`, () => { });
// go back to base page };
cy.visit(storedURL, {
baseUrl: null, describe(`${apiType.toUpperCase()} api - GRID view (Share)`, () => {
// Run once before test- create project (rest/graphql)
//
before(() => {
// open a table to work on views
//
cy.openTableTab("Address", 25);
cy.saveLocalStorage();
}); });
// number of view entries should be 2 before we delete beforeEach(() => {
cy.get(".nc-view-item").its("length").should("eq", 2); cy.restoreLocalStorage();
});
cy.get(".nc-view-delete-icon").eq(0).click({ force: true }); afterEach(() => {
cy.toastWait("View deleted successfully"); cy.saveLocalStorage();
});
// confirm if the number of veiw entries is reduced by 1 after(() => {
cy.get(".nc-view-item").its("length").should("eq", 1); // close table
}); // mainPage.deleteCreatedViews()
}; cy.closeTableTab("Address");
});
// below scenario's will be invoked twice, once for rest & then for graphql // Common routine to create/edit/delete GRID & GALLERY view
viewTest("grid"); // Input: viewType - 'grid'/'gallery'
}); //
const viewTest = (viewType) => {
describe(`${apiType.toUpperCase()} api - Grid view/ row-column update verification`, () => { it(`Create ${viewType.toUpperCase()} view`, () => {
before(() => { // create a normal public view
// Address table has belongs to, has many & many-to-many cy.get(`.nc-create-${viewType}-view`).click();
cy.openTableTab("Country", 25); cy.getActiveModal().find("button:contains(Submit)").click();
cy.toastWait("View created successfully");
cy.saveLocalStorage();
// store base URL- to re-visit and delete form view later // store base URL- to re-visit and delete form view later
cy.url().then((url) => { cy.url().then((url) => {
storedURL = url; storedURL = url;
generateViewLink("rowColUpdate"); });
}); });
});
it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => {
cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("Address1")
.click();
mainPage.hideField("Address2");
mainPage.sortField("District", "Z -> A");
mainPage.filterField("Address", "is like", "Ab");
generateViewLink("combined");
cy.log(viewURL["combined"]);
});
it(`Share GRID view : ensure we have only one link even if shared multiple times`, () => {
// generate view link multiple times
generateViewLink("combined");
generateViewLink("combined");
// verify if only one link exists in table
// cy.get(".v-navigation-drawer__content > .container")
// .find(".v-list > .v-list-item")
// .contains("Share View")
// .parent()
// .find("button.mdi-dots-vertical")
// .click();
mainPage.shareViewList().click();
// cy.getActiveMenu().find(".v-list-item").contains("Views List").click();
cy.get('th:contains("View Link")').should("exist");
cy.get('th:contains("View Link")')
.parent()
.parent()
.next()
.find("tr")
.its("length")
.should("eq", 1)
.then(() => {
// cy.get(".v-overlay__content > .d-flex > .v-icon").click();
// close modal (fix me! add a close button to share view list modal)
cy.get(".v-overlay--active > .v-overlay__scrim").click({
force: true,
});
});
});
it(`Share ${viewType.toUpperCase()} view : Visit URL, Verify title`, () => {
// visit public view
cy.visit(viewURL["combined"], {
baseUrl: null,
});
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 18);
cy.snip("ShareView_Grid");
// verify title
cy.get("div.model-name").contains("Address1").should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify fields hidden/open`, () => {
// verify column headers
cy.get('[data-col="Address"]').should("exist");
cy.get('[data-col="Address2"]').should("not.exist");
cy.get('[data-col="District"]').should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify fields sort/ filter`, () => {
// country column content verification before sort
mainPage
.getCell("District", 1)
.contains("West Bengali")
.should("exist");
mainPage
.getCell("District", 2)
.contains("Tutuila")
.should("exist");
mainPage
.getCell("District", 3)
.contains("Tamil Nadu")
.should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify download CSV`, () => {
mainPage.hideField("LastUpdate");
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`Address,District,PostalCode,Phone,Location,Address => Customer,Address => Staff,City <= Address,Address <=> Staff`,
`1013 Tabuk Boulevard,West Bengali,96203,158399646978,[object Object],2,,Kanchrapara,`,
`1892 Nabereznyje Telny Lane,Tutuila,28396,478229987054,[object Object],2,,Tafuna,`,
`1993 Tabuk Lane,Tamil Nadu,64221,648482415405,[object Object],2,,Tambaram,`,
`1661 Abha Drive,Tamil Nadu,14400,270456873752,[object Object],1,,Pudukkottai,`,
];
for (let i = 0; i < storedRecords.length; i++) {
let strCol = storedRecords[i].split(",");
let retCol = retrievedRecords[i].split(",");
for (let j = 0; j < 4; j++) {
expect(strCol[j]).to.be.equal(retCol[j]);
}
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i])
}
};
// download & verify
mainPage.downloadAndVerifyCsv(
`Address_exported_1.csv`,
verifyCsv
);
mainPage.unhideField("LastUpdate");
});
it(`Share ${viewType.toUpperCase()} view : Disable sort`, () => {
// remove sort and validate
mainPage.clearSort();
mainPage
.getCell("District", 1)
.contains("Southern Mindanao")
.should("exist");
});
it(`Share ${viewType.toUpperCase()} view : Enable sort`, () => {
// Sort menu operations (Country Column, Z->A)
mainPage.sortField("District", "Z -> A");
mainPage
.getCell("District", 1)
.contains("West Bengali")
.should("exist");
});
it(`Share ${viewType.toUpperCase()} view : Create Filter`, () => {
// add filter & validate
mainPage.filterField("District", "is like", "Tamil");
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 2);
mainPage
.getCell("District", 1)
.contains("Tamil")
.should("exist");
});
it(`Share ${viewType.toUpperCase()} view : verify download CSV after local filter`, () => {
mainPage.hideField("LastUpdate");
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`Address,District,PostalCode,Phone,Location,Address => Customer,Address => Staff,City <= Address,Address <=> Staff`,
`1993 Tabuk Lane,Tamil Nadu,64221,648482415405,[object Object],2,,Tambaram,`,
`1661 Abha Drive,Tamil Nadu,14400,270456873752,[object Object],1,,Pudukkottai,`,
];
// for (let i = 0; i < storedRecords.length; i++) {
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i])
// }
for (let i = 0; i < storedRecords.length; i++) {
let strCol = storedRecords[i].split(",");
let retCol = retrievedRecords[i].split(",");
for (let j = 0; j < 4; j++) {
expect(strCol[j]).to.be.equal(retCol[j]);
}
}
};
mainPage.downloadAndVerifyCsv(
`Address_exported_1.csv`,
verifyCsv
);
mainPage.unhideField("LastUpdate");
});
it(`Share ${viewType.toUpperCase()} view : Delete Filter`, () => {
// Remove sort and Validate
mainPage.filterReset();
mainPage
.getCell("District", 1)
.contains("West Bengali")
.should("exist");
});
it(`Share GRID view : Virtual column validation > has many`, () => {
// verify column headers
cy.get('[data-col="Address => Customer"]').should("exist");
cy.get('[data-col="Address => Staff"]').should("exist");
cy.get('[data-col="City <= Address"]').should("exist");
cy.get('[data-col="Address <=> Staff"]').should("exist");
// has many field validation
mainPage
.getCell("Address => Customer", 3)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("Address => Customer", 3)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("Address => Customer", 3)
.click()
.find("button.mdi-arrow-expand")
.click();
cy.getActiveModal().find("button.mdi-reload").should("exist");
cy.getActiveModal()
.find("button")
.contains("Link to")
.should("not.exist");
cy.getActiveModal()
.find(".child-card")
.contains("2")
.should("exist");
cy.getActiveModal()
.find(".child-card")
.find("button")
.should("not.exist");
cy.get("body").type("{esc}");
});
it(`Share GRID view : Virtual column validation > belongs to`, () => {
// belongs to field validation
mainPage
.getCell("City <= Address", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("City <= Address", 1)
.click()
.find("button.mdi-arrow-expand")
.should("not.exist");
mainPage
.getCell("City <= Address", 1)
.find(".v-chip")
.contains("Kanchrapara")
.should("exist");
});
it(`Share GRID view : Virtual column validation > many to many`, () => {
// many-to-many field validation
mainPage
.getCell("Address <=> Staff", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("Address <=> Staff", 1)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("Address <=> Staff", 1)
.click()
.find("button.mdi-arrow-expand")
.click();
cy.getActiveModal().find("button.mdi-reload").should("exist");
cy.getActiveModal()
.find("button")
.contains("Link to")
.should("not.exist");
cy.get("body").type("{esc}");
});
it(`Delete ${viewType.toUpperCase()} view`, () => {
// go back to base page
cy.visit(storedURL, {
baseUrl: null,
});
// number of view entries should be 2 before we delete
cy.get(".nc-view-item").its("length").should("eq", 2);
cy.get(".nc-view-delete-icon").eq(0).click({ force: true });
cy.toastWait("View deleted successfully");
// confirm if the number of veiw entries is reduced by 1
cy.get(".nc-view-item").its("length").should("eq", 1);
});
};
after(() => { // below scenario's will be invoked twice, once for rest & then for graphql
// close table viewTest("grid");
cy.restoreLocalStorage();
cy.visit(storedURL, {
baseUrl: null,
});
// delete row
mainPage.getPagination(5).click();
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10);
mainPage
.getRow(10)
.find(".mdi-checkbox-blank-outline")
.click({ force: true });
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu().contains("Delete Selected Row").click();
// delete column
cy.get(`th:contains('dummy') .mdi-menu-down`)
.trigger("mouseover")
.click();
cy.get(".nc-column-delete").click();
cy.get("button:contains(Confirm)").click();
cy.toastWait("Update table successful");
mainPage.deleteCreatedViews();
// close table
cy.closeTableTab("Country");
}); });
it(`Generate default Shared GRID view URL`, () => { describe(`${apiType.toUpperCase()} api - Grid view/ row-column update verification`, () => {
// add row before(() => {
cy.get(".nc-add-new-row-btn").click({ force: true }); // Address table has belongs to, has many & many-to-many
cy.get("#data-table-form-Country > input").first().click().type("a"); cy.openTableTab("Country", 25);
cy.contains("Save Row").filter("button").click({ force: true });
cy.toastWait("updated successfully"); cy.saveLocalStorage();
// store base URL- to re-visit and delete form view later
// add column cy.url().then((url) => {
mainPage.addColumn("dummy", "Country"); storedURL = url;
generateViewLink("rowColUpdate");
// visit public view });
cy.log(viewURL["rowColUpdate"]); });
cy.restoreLocalStorage();
cy.visit(viewURL["rowColUpdate"], {
baseUrl: null,
}); //5
// wait for public view page to load!
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 25);
});
it(`Share GRID view : new row visible`, () => { after(() => {
// verify row // close table
cy.get(`.v-pagination > li:contains('5') button`).click(); cy.restoreLocalStorage();
// wait for page rendering to complete cy.visit(storedURL, {
cy.get(".nc-grid-row").should("have.length", 10); baseUrl: null,
mainPage.getCell("Country", 10).contains("a").should("exist"); });
});
// delete row
mainPage.getPagination(5).click();
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10);
mainPage
.getRow(10)
.find(".mdi-checkbox-blank-outline")
.click({ force: true });
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu().contains("Delete Selected Row").click();
// delete column
cy.get(`th:contains('dummy') .mdi-menu-down`)
.trigger("mouseover")
.click();
cy.get(".nc-column-delete").click();
cy.get("button:contains(Confirm)").click();
cy.toastWait("Update table successful");
mainPage.deleteCreatedViews();
// close table
cy.closeTableTab("Country");
});
it(`Generate default Shared GRID view URL`, () => {
// add row
cy.get(".nc-add-new-row-btn").click({ force: true });
cy.get("#data-table-form-Country > input")
.first()
.click()
.type("a");
cy.contains("Save Row").filter("button").click({ force: true });
cy.toastWait("updated successfully");
// add column
mainPage.addColumn("dummy", "Country");
// visit public view
cy.log(viewURL["rowColUpdate"]);
cy.restoreLocalStorage();
cy.visit(viewURL["rowColUpdate"], {
baseUrl: null,
}); //5
// wait for public view page to load!
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 25);
});
it(`Share GRID view : new row visible`, () => {
// verify row
cy.get(`.v-pagination > li:contains('5') button`).click();
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10);
mainPage.getCell("Country", 10).contains("a").should("exist");
});
it.skip(`Share GRID view : new column visible`, () => { it.skip(`Share GRID view : new column visible`, () => {
// verify column headers // verify column headers
cy.get('[data-col="dummy"]').should("exist"); cy.get('[data-col="dummy"]').should("exist");
});
}); });
});
}; };
/** /**

2
scripts/cypress/integration/common/5a_user_role.js

@ -62,6 +62,8 @@ export const genTest = (apiType, dbType) => {
cy.get(".nc-exp-imp-metadata").dblclick({ force: true }); cy.get(".nc-exp-imp-metadata").dblclick({ force: true });
cy.get(".nc-ui-acl-tab").click({ force: true }); cy.get(".nc-ui-acl-tab").click({ force: true });
cy.snip("Meta_Tab3");
// validate if it has 19 entries representing tables & views // validate if it has 19 entries representing tables & views
if (isPostgres()) if (isPostgres())
cy.get(".nc-acl-table-row").should("have.length", 24); cy.get(".nc-acl-table-row").should("have.length", 24);

2
scripts/cypress/integration/common/6b_downloadCsv.js

@ -9,12 +9,10 @@ export const genTest = (apiType, dbType) => {
before(() => { before(() => {
// loginPage.loginAndOpenProject(type) // loginPage.loginAndOpenProject(type)
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
cy.screenshot("6b-before");
}); });
after(() => { after(() => {
cy.closeTableTab("Country"); cy.closeTableTab("Country");
cy.screenshot("6b-after");
}); });
it("Download verification- base view, default columns", () => { it("Download verification- base view, default columns", () => {

450
scripts/cypress/integration/common/6c_swagger_api.js

@ -4,224 +4,248 @@ import { roles } from "../../support/page_objects/projectConstants";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } 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;
describe(`${apiType.toUpperCase()} : API List - Test preparation`, () => { describe(`${apiType.toUpperCase()} : API List - Test preparation`, () => {
before(() => { before(() => {
loginPage.loginAndOpenProject(apiType, dbType); loginPage.loginAndOpenProject(apiType, dbType);
}); });
it("Open project & record swagger URL, AuthToken", () => { it("Open project & record swagger URL, AuthToken", () => {
let authToken = mainPage.getAuthToken(); let authToken = mainPage.getAuthToken();
cy.url().then((url) => { cy.url().then((url) => {
// retrieve project name from URL & use it to construct Swagger URL // retrieve project name from URL & use it to construct Swagger URL
// URL on homepage: http://localhost:3000/#/nc/externalrest_weUO?type=roles&dbalias=&name=Team%20%26%20Auth%20 // URL on homepage: http://localhost:3000/#/nc/externalrest_weUO?type=roles&dbalias=&name=Team%20%26%20Auth%20
// [REST] Swagger URL: http://localhost:8080/nc/externalrest_weUO/db/swagger // [REST] Swagger URL: http://localhost:8080/nc/externalrest_weUO/db/swagger
// [GQL] http://localhost:8080/nc/externalgql_dgwx/v1/graphql // [GQL] http://localhost:8080/nc/externalgql_dgwx/v1/graphql
const projectName = url.split("/")[5].split("?")[0]; const projectName = url.split("/")[5].split("?")[0];
let swaggerURL = ``; let swaggerURL = ``;
if ("rest" == apiType) { if ("rest" == apiType) {
swaggerURL = `http://localhost:8080/nc/${projectName}/db/swagger`; swaggerURL = `http://localhost:8080/nc/${projectName}/db/swagger`;
} else { } else {
swaggerURL = `http://localhost:8080/nc/${projectName}/v1/graphql`; swaggerURL = `http://localhost:8080/nc/${projectName}/v1/graphql`;
} }
// exchange information between two tests using a file // exchange information between two tests using a file
// https://stackoverflow.com/questions/52050657/what-is-the-best-practice-of-pass-states-between-tests-in-cypress // https://stackoverflow.com/questions/52050657/what-is-the-best-practice-of-pass-states-between-tests-in-cypress
// //
cy.writeFile("shared.json", { cy.writeFile("shared.json", {
SWAGGER_URL: swaggerURL, SWAGGER_URL: swaggerURL,
AUTH_TOKEN: authToken, AUTH_TOKEN: authToken,
});
});
}); });
});
}); });
});
if ("rest" == apiType) {
if ("rest" == apiType) { describe(`Swagger page, base verification`, () => {
describe(`Swagger page, base verification`, () => { // returns swagger button intended for
// returns swagger button intended for //
// const getSwaggerButton = (tag, idx, desc) => {
const getSwaggerButton = (tag, idx, desc) => { return cy
return cy .get(`#operations-tag-${tag}`)
.get(`#operations-tag-${tag}`) .next()
.next() .find(".opblock")
.find(".opblock") .eq(idx)
.eq(idx) .find(`button:contains(${desc})`);
.find(`button:contains(${desc})`); };
};
let Token;
let Token;
// basic authentication tag verification
// basic authentication tag verification //
// it("Swagger URL access & basic validation", () => {
it("Swagger URL access & basic validation", () => { // retrieve information stored in previous IT block
// retrieve information stored in previous IT block //
// cy.readFile("shared.json").then((jsonPayload) => {
cy.readFile("shared.json").then((jsonPayload) => { let URL = jsonPayload.SWAGGER_URL;
let URL = jsonPayload.SWAGGER_URL; Token = jsonPayload.AUTH_TOKEN;
Token = jsonPayload.AUTH_TOKEN;
cy.visit(URL, {
cy.visit(URL, { baseUrl: null,
baseUrl: null, }).then(() => {
}).then(() => { // wait to allow time for SWAGGER Library loading to finish
// wait to allow time for SWAGGER Library loading to finish cy.log(Token);
cy.log(Token);
// cy.snip("Swagger");
// validate; API order assumed
cy.get("#operations-tag-Authentication", { timeout: 20000 }) // validate; API order assumed
.should("exist") cy.get("#operations-tag-Authentication", {
.next() timeout: 20000,
.find(".opblock") })
.should("has.length", 9); .should("exist")
getSwaggerButton("Authentication", 0, "User login").should("exist"); .next()
getSwaggerButton("Authentication", 1, "User signup").should( .find(".opblock")
"exist" .should("has.length", 9);
); getSwaggerButton(
getSwaggerButton("Authentication", 2, "Password Forgot").should( "Authentication",
"exist" 0,
); "User login"
getSwaggerButton("Authentication", 3, "Email validate link").should( ).should("exist");
"exist" getSwaggerButton(
); "Authentication",
getSwaggerButton( 1,
"Authentication", "User signup"
4, ).should("exist");
"Validate password reset token" getSwaggerButton(
).should("exist"); "Authentication",
getSwaggerButton("Authentication", 5, "Password reset").should( 2,
"exist" "Password Forgot"
); ).should("exist");
getSwaggerButton("Authentication", 6, "User details").should( getSwaggerButton(
"exist" "Authentication",
); 3,
getSwaggerButton("Authentication", 7, "Update user details").should( "Email validate link"
"exist" ).should("exist");
); getSwaggerButton(
getSwaggerButton("Authentication", 8, "Update user details").should( "Authentication",
"exist" 4,
); "Validate password reset token"
}); ).should("exist");
getSwaggerButton(
"Authentication",
5,
"Password reset"
).should("exist");
getSwaggerButton(
"Authentication",
6,
"User details"
).should("exist");
getSwaggerButton(
"Authentication",
7,
"Update user details"
).should("exist");
getSwaggerButton(
"Authentication",
8,
"Update user details"
).should("exist");
});
});
});
it("Authorize success: Valid token", () => {
// authorize button, feed token, click authorize
cy.get('[class="btn authorize unlocked"]').click();
cy.get("input").type(Token);
cy.get(".auth-btn-wrapper > .authorize").click();
// Response: "Authorized" should exist on DOM
cy.get(".auth-container")
.contains("Authorized")
.should("exist");
cy.get(".btn-done").click();
// Authorize button is LOCKED now
cy.get('[class="btn authorize locked"]').should("exist");
});
it("Execute Authentication (valid token case) > GET: User details API", () => {
// Auth> User details API
getSwaggerButton("Authentication", 6, "User details").click();
// "Try it out" button, followed by "Execute"
cy.get(".try-out > .btn").click();
cy.get(".execute-wrapper > .btn").click();
// check response: validate email credentials
cy.get(".highlight-code > .microlight")
.contains("email")
.should("exist");
cy.get(".highlight-code > .microlight")
.contains(roles.owner.credentials.username)
.should("exist");
// reset operations (clear, cancel, windback User details tab)
cy.get(".btn-clear").click();
cy.get(".try-out > .btn").click();
getSwaggerButton("Authentication", 6, "User details").click();
});
it("Logout post authorization", () => {
// authorize button, logout
cy.get('[class="btn authorize locked"]').click();
cy.get('.auth-btn-wrapper > button:contains("Logout")').click();
cy.get(".btn-done").click();
// Authorize button is UNLOCKED now
cy.get('[class="btn authorize unlocked"]').should("exist");
});
it("Execute Authentication (logout case) > GET: User details API", () => {
// Auth> User details API
getSwaggerButton("Authentication", 6, "User details").click();
// "Try it out" button, followed by "Execute"
cy.get(".try-out > .btn").click();
cy.get(".execute-wrapper > .btn").click();
// check response: email credentials shouldnt exist. should display 'guest:true'
cy.get(".highlight-code > .microlight")
.contains("guest")
.should("exist");
cy.get(".highlight-code > .microlight")
.contains("email")
.should("not.exist");
cy.get(".highlight-code > .microlight")
.contains(roles.owner.credentials.username)
.should("not.exist");
// reset operations (clear, cancel, windback User details tab)
cy.get(".btn-clear").click();
cy.get(".try-out > .btn").click();
getSwaggerButton("Authentication", 6, "User details").click();
});
it("Authorize failure: invalid token", () => {
// authorize button, feed *invalid* token, click authorize
cy.get('[class="btn authorize unlocked"]').click();
cy.get("input").type("xyz");
cy.get(".auth-btn-wrapper > .authorize").click();
// Response: "Authorized" should *not* exist on DOM
// TBD: cy.get('.auth-container').contains('Authorized').should('not.exist')
cy.get(".btn-done").click();
// Authorize button should be UNLOCKED now
// TBD: cy.get('[class="btn authorize unlocked"]').should('exist')
});
it("Execute Authentication (invalid token case) > GET: User details API", () => {
// Auth> User details API
getSwaggerButton("Authentication", 6, "User details").click();
// "Try it out" button, followed by "Execute"
cy.get(".try-out > .btn").click();
cy.get(".execute-wrapper > .btn").click();
// check response: email credentials shouldnt exist. should display 'guest:true'
cy.get(".highlight-code > .microlight")
.contains("guest")
.should("exist");
cy.get(".highlight-code > .microlight")
.contains("email")
.should("not.exist");
cy.get(".highlight-code > .microlight")
.contains(roles.owner.credentials.username)
.should("not.exist");
// reset operations (clear, cancel, windback User details tab)
cy.get(".btn-clear").click();
cy.get(".try-out > .btn").click();
getSwaggerButton("Authentication", 6, "User details").click();
});
// clean-up created file (shared.json)
// after(() => {
// cy.exec("del shared.json").then(()=> {
// cy.log("file cleaned up!")
// })
// })
}); });
}); }
it("Authorize success: Valid token", () => {
// authorize button, feed token, click authorize
cy.get('[class="btn authorize unlocked"]').click();
cy.get("input").type(Token);
cy.get(".auth-btn-wrapper > .authorize").click();
// Response: "Authorized" should exist on DOM
cy.get(".auth-container").contains("Authorized").should("exist");
cy.get(".btn-done").click();
// Authorize button is LOCKED now
cy.get('[class="btn authorize locked"]').should("exist");
});
it("Execute Authentication (valid token case) > GET: User details API", () => {
// Auth> User details API
getSwaggerButton("Authentication", 6, "User details").click();
// "Try it out" button, followed by "Execute"
cy.get(".try-out > .btn").click();
cy.get(".execute-wrapper > .btn").click();
// check response: validate email credentials
cy.get(".highlight-code > .microlight")
.contains("email")
.should("exist");
cy.get(".highlight-code > .microlight")
.contains(roles.owner.credentials.username)
.should("exist");
// reset operations (clear, cancel, windback User details tab)
cy.get(".btn-clear").click();
cy.get(".try-out > .btn").click();
getSwaggerButton("Authentication", 6, "User details").click();
});
it("Logout post authorization", () => {
// authorize button, logout
cy.get('[class="btn authorize locked"]').click();
cy.get('.auth-btn-wrapper > button:contains("Logout")').click();
cy.get(".btn-done").click();
// Authorize button is UNLOCKED now
cy.get('[class="btn authorize unlocked"]').should("exist");
});
it("Execute Authentication (logout case) > GET: User details API", () => {
// Auth> User details API
getSwaggerButton("Authentication", 6, "User details").click();
// "Try it out" button, followed by "Execute"
cy.get(".try-out > .btn").click();
cy.get(".execute-wrapper > .btn").click();
// check response: email credentials shouldnt exist. should display 'guest:true'
cy.get(".highlight-code > .microlight")
.contains("guest")
.should("exist");
cy.get(".highlight-code > .microlight")
.contains("email")
.should("not.exist");
cy.get(".highlight-code > .microlight")
.contains(roles.owner.credentials.username)
.should("not.exist");
// reset operations (clear, cancel, windback User details tab)
cy.get(".btn-clear").click();
cy.get(".try-out > .btn").click();
getSwaggerButton("Authentication", 6, "User details").click();
});
it("Authorize failure: invalid token", () => {
// authorize button, feed *invalid* token, click authorize
cy.get('[class="btn authorize unlocked"]').click();
cy.get("input").type("xyz");
cy.get(".auth-btn-wrapper > .authorize").click();
// Response: "Authorized" should *not* exist on DOM
// TBD: cy.get('.auth-container').contains('Authorized').should('not.exist')
cy.get(".btn-done").click();
// Authorize button should be UNLOCKED now
// TBD: cy.get('[class="btn authorize unlocked"]').should('exist')
});
it("Execute Authentication (invalid token case) > GET: User details API", () => {
// Auth> User details API
getSwaggerButton("Authentication", 6, "User details").click();
// "Try it out" button, followed by "Execute"
cy.get(".try-out > .btn").click();
cy.get(".execute-wrapper > .btn").click();
// check response: email credentials shouldnt exist. should display 'guest:true'
cy.get(".highlight-code > .microlight")
.contains("guest")
.should("exist");
cy.get(".highlight-code > .microlight")
.contains("email")
.should("not.exist");
cy.get(".highlight-code > .microlight")
.contains(roles.owner.credentials.username)
.should("not.exist");
// reset operations (clear, cancel, windback User details tab)
cy.get(".btn-clear").click();
cy.get(".try-out > .btn").click();
getSwaggerButton("Authentication", 6, "User details").click();
});
// clean-up created file (shared.json)
// after(() => {
// cy.exec("del shared.json").then(()=> {
// cy.log("file cleaned up!")
// })
// })
});
}
}; };
/** /**

7
scripts/cypress/integration/common/6d_language_validation.js

@ -9,7 +9,7 @@ export const genTest = (apiType, dbType) => {
before(() => { before(() => {
//loginPage.signIn(roles.owner.credentials) //loginPage.signIn(roles.owner.credentials)
mainPage.toolBarTopLeft(mainPage.HOME).click(); mainPage.toolBarTopLeft(mainPage.HOME).click();
cy.screenshot("6d-1"); cy.screenshot("Debug 6d-1", { overwrite: true });
}); });
const langVerification = (idx, lang) => { const langVerification = (idx, lang) => {
@ -19,9 +19,12 @@ export const genTest = (apiType, dbType) => {
// toggle menu as per index // toggle menu as per index
cy.get(".nc-menu-translate").click(); cy.get(".nc-menu-translate").click();
cy.snipActiveMenu("Menu_Translation");
cy.getActiveMenu().find(".v-list-item").eq(idx).click(); cy.getActiveMenu().find(".v-list-item").eq(idx).click();
cy.screenshot("6d-2"); cy.screenshot("Debug 6d-2", { overwrite: true });
// basic validations // basic validations
// 1. Page title: "My Projects" // 1. Page title: "My Projects"

115
scripts/cypress/integration/common/6e_project_operations.js

@ -3,69 +3,78 @@ import { isXcdb, roles } from "../../support/page_objects/projectConstants";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
export const genTest = (apiType, dbType) => { export const genTest = (apiType, dbType) => {
describe(`${apiType.toUpperCase()} Project operations`, () => { describe(`${apiType.toUpperCase()} Project operations`, () => {
if (!isTestSuiteActive(apiType, dbType)) return; if (!isTestSuiteActive(apiType, dbType)) return;
before(() => { before(() => {
loginPage.signIn(roles.owner.credentials); loginPage.signIn(roles.owner.credentials);
}); });
it("Stop Project", () => { it("Stop Project", () => {
//cy.visit('./#/projects') //cy.visit('./#/projects')
cy.get(`.nc-${apiType}-project-row .mdi-stop-circle-outline`, { cy.get(`.nc-${apiType}-project-row .mdi-stop-circle-outline`, {
timeout: 10000, timeout: 10000,
}) })
.should("exist") .should("exist")
.last() .last()
.invoke("show") .invoke("show")
.click(); .click();
cy.contains("Submit").closest("button").click(); cy.snipActiveModal("Modal_StopProject");
cy.contains("Submit").closest("button").click();
cy.toastWait("stopped successfully"); cy.toastWait("stopped successfully");
}); });
it("Start Project", () => { it("Start Project", () => {
//cy.visit('./#/projects') //cy.visit('./#/projects')
cy.get(`.nc-${apiType}-project-row .mdi-play-circle-outline`, { cy.get(`.nc-${apiType}-project-row .mdi-play-circle-outline`, {
timeout: 10000, timeout: 10000,
}) })
.should("exist") .should("exist")
.last() .last()
.invoke("show") .invoke("show")
.click(); .click();
cy.contains("Submit").closest("button").click(); cy.snipActiveModal("Modal_StartProject");
cy.toastWait("started successfully"); cy.contains("Submit").closest("button").click();
});
it("Restart Project", () => { cy.toastWait("started successfully");
if (!isXcdb()) { });
//cy.visit('./#/projects')
cy.get(`.nc-${apiType}-project-row .mdi-restart`, { timeout: 10000 })
.should("exist")
.last()
.invoke("show")
.click();
cy.contains("Submit").closest("button").click();
cy.toastWait("restarted successfully"); it("Restart Project", () => {
} if (!isXcdb()) {
}); //cy.visit('./#/projects')
cy.get(`.nc-${apiType}-project-row .mdi-restart`, {
timeout: 10000,
})
.should("exist")
.last()
.invoke("show")
.click();
cy.snipActiveModal("Modal_RestartProject");
cy.contains("Submit").closest("button").click();
cy.toastWait("restarted successfully");
}
});
it("Delete Project", () => {
//cy.visit('./#/projects')
cy.get(`.nc-${apiType}-project-row .mdi-delete-circle-outline`, {
timeout: 10000,
})
.should("exist")
.last()
.invoke("show")
.click();
cy.snipActiveModal("Modal_DeleteProject");
it("Delete Project", () => { cy.contains("Submit").closest("button").click();
//cy.visit('./#/projects')
cy.get(`.nc-${apiType}-project-row .mdi-delete-circle-outline`, {
timeout: 10000,
})
.should("exist")
.last()
.invoke("show")
.click();
cy.contains("Submit").closest("button").click();
cy.toastWait("deleted successfully"); cy.toastWait("deleted successfully");
});
}); });
});
}; };
/** /**

205
scripts/cypress/integration/common/6g_base_share.js

@ -3,75 +3,78 @@ import { projectsPage } from "../../support/page_objects/navigation";
import { loginPage } from "../../support/page_objects/navigation"; import { loginPage } from "../../support/page_objects/navigation";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
import { import {
_advSettings, _advSettings,
_editSchema, _editSchema,
_editData, _editData,
_editComment, _editComment,
_viewMenu, _viewMenu,
_topRightMenu, _topRightMenu,
} from "../spec/roleValidation.spec"; } from "../spec/roleValidation.spec";
let linkText = ""; let linkText = "";
export const genTest = (apiType, dbType) => { export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return; if (!isTestSuiteActive(apiType, dbType)) return;
const permissionValidation = (roleType) => { const permissionValidation = (roleType) => {
it(`${roleType}: Visit base shared URL`, () => { it(`${roleType}: Visit base shared URL`, () => {
cy.log(linkText); cy.log(linkText);
// visit URL & wait for page load to complete // visit URL & wait for page load to complete
cy.visit(linkText, { cy.visit(linkText, {
baseUrl: null, baseUrl: null,
}); });
projectsPage.waitHomePageLoad(); projectsPage.waitHomePageLoad();
cy.closeTableTab("Actor"); cy.closeTableTab("Actor");
}); });
it(`${roleType}: Validate access permissions: advance menu`, () => { it(`${roleType}: Validate access permissions: advance menu`, () => {
_advSettings(roleType, false); _advSettings(roleType, false);
}); });
it(`${roleType}: Validate access permissions: edit schema`, () => { it(`${roleType}: Validate access permissions: edit schema`, () => {
_editSchema(roleType, false); _editSchema(roleType, false);
}); });
it(`${roleType}: Validate access permissions: edit data`, () => { it(`${roleType}: Validate access permissions: edit data`, () => {
_editData(roleType, false); _editData(roleType, false);
}); });
it(`${roleType}: Validate access permissions: edit comments`, () => { it(`${roleType}: Validate access permissions: edit comments`, () => {
_editComment(roleType, false); _editComment(roleType, false);
}); });
it(`${roleType}: Validate access permissions: view's menu`, () => { it(`${roleType}: Validate access permissions: view's menu`, () => {
_viewMenu(roleType, false); _viewMenu(roleType, false);
}); });
}; };
describe(`${apiType.toUpperCase()} Base VIEW share`, () => { describe(`${apiType.toUpperCase()} Base VIEW share`, () => {
it(`Generate base share URL`, () => { it(`Generate base share URL`, () => {
// click SHARE // click SHARE
cy.get(".nc-topright-menu").find(".nc-menu-share").click(); cy.get(".nc-topright-menu").find(".nc-menu-share").click();
// Click on readonly base text cy.snipActiveModal("Modal_BaseShare");
cy.getActiveModal().find(".nc-disable-shared-base").click();
// Click on readonly base text
// Select 'Readonly link' cy.getActiveModal().find(".nc-disable-shared-base").click();
cy.getActiveMenu()
.find(".caption") // Select 'Readonly link'
.contains("Anyone with the link") cy.snipActiveMenu("Menu_ShareLink");
.click(); cy.getActiveMenu()
.find(".caption")
// Copy URL .contains("Anyone with the link")
cy.getActiveModal() .click();
.find(".nc-url")
.then(($obj) => { // Copy URL
cy.log($obj[0]); cy.getActiveModal()
linkText = $obj[0].innerText.trim(); .find(".nc-url")
.then(($obj) => {
const htmlFile = ` cy.log($obj[0]);
linkText = $obj[0].innerText.trim();
const htmlFile = `
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<body> <body>
@ -87,55 +90,63 @@ style="background: transparent; "></iframe>
</body> </body>
</html> </html>
`; `;
cy.writeFile( cy.writeFile(
"scripts/cypress/fixtures/sampleFiles/iFrame.html", "scripts/cypress/fixtures/sampleFiles/iFrame.html",
htmlFile htmlFile
); );
});
}); });
});
permissionValidation("viewer"); permissionValidation("viewer");
it("Update to EDITOR base share link", () => { it("Update to EDITOR base share link", () => {
loginPage.loginAndOpenProject(apiType, dbType); loginPage.loginAndOpenProject(apiType, dbType);
// click SHARE // click SHARE
cy.get(".nc-topright-menu").find(".nc-menu-share").click(); cy.get(".nc-topright-menu").find(".nc-menu-share").click();
cy.getActiveModal().find(".nc-shared-base-role").click(); cy.getActiveModal().find(".nc-shared-base-role").click();
cy.getActiveMenu().find('[role="menuitem"]').contains("Editor").click(); cy.getActiveMenu()
}); .find('[role="menuitem"]')
.contains("Editor")
.click();
});
permissionValidation("editor"); permissionValidation("editor");
it("Generate & verify embed HTML IFrame", { baseUrl: null }, () => { it("Generate & verify embed HTML IFrame", { baseUrl: null }, () => {
// open iFrame html // open iFrame html
cy.visit("scripts/cypress/fixtures/sampleFiles/iFrame.html"); cy.visit("scripts/cypress/fixtures/sampleFiles/iFrame.html");
// wait for iFrame to load // wait for iFrame to load
cy.frameLoaded(".nc-embed"); cy.frameLoaded(".nc-embed");
// for GQL- additionally close GQL Client window // for GQL- additionally close GQL Client window
if (apiType === "graphql") { if (apiType === "graphql") {
cy.iframe().find(`[title="Graphql Client"] > button.mdi-close`).click(); cy.iframe()
} .find(`[title="Graphql Client"] > button.mdi-close`)
.click();
// validation for base menu opitons }
cy.iframe().find(".nc-project-tree").should("exist");
cy.iframe().find(".nc-fields-menu-btn").should("exist"); // validation for base menu opitons
cy.iframe().find(".nc-sort-menu-btn").should("exist"); cy.iframe().find(".nc-project-tree").should("exist");
cy.iframe().find(".nc-filter-menu-btn").should("exist"); cy.iframe().find(".nc-fields-menu-btn").should("exist");
cy.iframe().find(".nc-actions-menu-btn").should("exist"); cy.iframe().find(".nc-sort-menu-btn").should("exist");
cy.iframe().find(".nc-filter-menu-btn").should("exist");
// validate data (row-1) cy.iframe().find(".nc-actions-menu-btn").should("exist");
mainPage
.getIFrameCell("FirstName", 1) // validate data (row-1)
.contains("PENELOPE") mainPage
.should("exist"); .getIFrameCell("FirstName", 1)
mainPage.getIFrameCell("LastName", 1).contains("GUINESS").should("exist"); .contains("PENELOPE")
.should("exist");
mainPage
.getIFrameCell("LastName", 1)
.contains("GUINESS")
.should("exist");
});
}); });
});
}; };
/** /**

536
scripts/cypress/integration/common/7a_create_project_from_excel.js

@ -4,8 +4,8 @@
import { projectsPage } from "../../support/page_objects/navigation"; import { projectsPage } from "../../support/page_objects/navigation";
import { mainPage } from "../../support/page_objects/mainPage"; import { mainPage } from "../../support/page_objects/mainPage";
import { import {
roles, roles,
isTestSuiteActive, isTestSuiteActive,
} from "../../support/page_objects/projectConstants"; } from "../../support/page_objects/projectConstants";
// stores sheet names (table name) // stores sheet names (table name)
@ -21,29 +21,29 @@ let filepath = `sampleFiles/simple.xlsx`;
// let UrlFilePath = `sampleFiles/Financial Sample.xlsx` // let UrlFilePath = `sampleFiles/Financial Sample.xlsx`
let expectedData = { let expectedData = {
0: ["number", "Number"], 0: ["number", "Number"],
1: ["float", "Decimal"], 1: ["float", "Decimal"],
2: ["text", "SingleLineText"], 2: ["text", "SingleLineText"],
}; };
// column names with spaces will be converted to include _ // column names with spaces will be converted to include _
let UrlFileExpectedData = { let UrlFileExpectedData = {
0: ["Segment", "SingleSelect", ["Government"]], 0: ["Segment", "SingleSelect", ["Government"]],
1: ["Country", "SingleSelect", ["Canada"]], 1: ["Country", "SingleSelect", ["Canada"]],
2: ["Product", "SingleSelect", ["Carretera"]], 2: ["Product", "SingleSelect", ["Carretera"]],
3: ["Discount_Band", "SingleSelect", ["None"]], 3: ["Discount_Band", "SingleSelect", ["None"]],
4: ["Units_Sold", "Decimal", [1618.5]], 4: ["Units_Sold", "Decimal", [1618.5]],
5: ["Manufacturing_Price", "Number", [3]], 5: ["Manufacturing_Price", "Number", [3]],
6: ["Sale_Price", "Number", [20]], 6: ["Sale_Price", "Number", [20]],
7: ["Gross_Sales", "Decimal", [32370]], 7: ["Gross_Sales", "Decimal", [32370]],
8: ["Discounts", "Decimal", [0]], 8: ["Discounts", "Decimal", [0]],
9: ["Sales", "Decimal", [32370]], 9: ["Sales", "Decimal", [32370]],
10: ["COGS", "Decimal", [16185]], 10: ["COGS", "Decimal", [16185]],
11: ["Profit", "Decimal", [16185]], 11: ["Profit", "Decimal", [16185]],
12: ["Date", "Date", ["2014-01-01"]], 12: ["Date", "Date", ["2014-01-01"]],
13: ["Month_Number", "Number", [1]], 13: ["Month_Number", "Number", [1]],
14: ["Month_Name", "SingleSelect", ["January"]], 14: ["Month_Name", "SingleSelect", ["January"]],
15: ["Year", "SingleSelect", [2014]], 15: ["Year", "SingleSelect", [2014]],
}; };
// let filepath = `sampleFiles/sample.xlsx` // let filepath = `sampleFiles/sample.xlsx`
@ -64,259 +64,281 @@ let UrlFileExpectedData = {
// } // }
export const genTest = (apiType, dbType) => { export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return; if (!isTestSuiteActive(apiType, dbType)) return;
describe(`Import from excel`, () => { describe(`Import from excel`, () => {
before(() => { before(() => {
cy.task("readSheetList", { cy.task("readSheetList", {
file: `./scripts/cypress/fixtures/${filepath}`, file: `./scripts/cypress/fixtures/${filepath}`,
}).then((rows) => { }).then((rows) => {
cy.log(rows); cy.log(rows);
sheetList = rows; sheetList = rows;
}); });
cy.task("readXlsx", {
file: `./scripts/cypress/fixtures/${filepath}`,
sheet: "Sheet2",
}).then((rows) => {
cy.log(rows);
sheetData = rows;
});
// cy.task('readXlsx', { file: `./scripts/cypress/fixtures/${UrlFilePath}`, sheet: "Sheet1" })
// .then((rows) => {
// cy.log(rows)
// UrlSheetData = rows
// })
});
it("File Upload: Upload excel as template", () => { cy.task("readXlsx", {
mainPage.toolBarTopLeft(mainPage.HOME).click(); file: `./scripts/cypress/fixtures/${filepath}`,
sheet: "Sheet2",
}).then((rows) => {
cy.log(rows);
sheetData = rows;
});
// click on "New Project" // cy.task('readXlsx', { file: `./scripts/cypress/fixtures/${UrlFilePath}`, sheet: "Sheet1" })
cy.get(":nth-child(5) > .v-btn", { timeout: 20000 }).click(); // .then((rows) => {
// cy.log(rows)
// UrlSheetData = rows
// })
});
// Subsequent form, select (+ Create) option it("File Upload: Upload excel as template", () => {
cy.get(".nc-create-project-from-excel", { timeout: 20000 }).click({ mainPage.toolBarTopLeft(mainPage.HOME).click();
force: true,
});
cy.get(".nc-excel-import-input").attachFile(filepath); // click on "New Project"
cy.get(".nc-btn-use-template", { timeout: 120000 }).should("exist"); cy.get(":nth-child(5) > .v-btn", { timeout: 20000 }).click();
});
it("File Upload: Verify pre-load template page", () => { // Subsequent form, select (+ Create) option
cy.getActiveContentModal() cy.get(".nc-create-project-from-excel", { timeout: 20000 }).click({
.find(".v-expansion-panel") force: true,
.then((sheets) => { });
for (let i = 0; i < sheets.length; i++) {
// verify if all sheet names are correct cy.snipActiveModal("Modal_CreateFromExcel");
// cy.wrap(sheets[i]).find('.title').then((blk) => {
// cy.log(blk.text().trim())
// expect(blk.text().trim()).to.equal(sheetList[i])
// })
cy.wrap(sheets[i]).contains(sheetList[i]).should("exist"); cy.get(".nc-excel-import-input").attachFile(filepath);
cy.get(".nc-btn-use-template", { timeout: 120000 }).should("exist");
// for each sheet, expand to verify table names & their data types
cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
// wait for 4 DOM rows to become visible, corresponding to 4 column names in excel
// change to avoid static wait
cy.get(".v-data-table").find("tr:visible").should("have.length", 4);
cy.get(".v-data-table")
.find("tr:visible")
.then((row) => {
for (let j = 1; j < row.length; j++) {
// column name to match input in excel
cy.wrap(row[j])
.find('[placeholder="Column name"]')
.then((obj) => {
cy.log(obj[0].value);
expect(obj[0].value).to.equal(expectedData[j - 1][0]);
});
// datatype to match expected output
cy.wrap(row[j])
.find("span.caption")
.then((obj) => {
cy.log(obj[0].innerText);
expect(obj[0].innerText).to.equal(expectedData[j - 1][1]);
});
}
});
// unwind
cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
}
}); });
});
it("File Upload: Verify loaded data", () => { it("File Upload: Verify pre-load template page", () => {
// create rest/ gql project cy.snip("ExcelImport");
cy.get(".nc-btn-use-template", { timeout: 120000 }).click(); cy.getActiveContentModal()
// if (type == 'rest') { .find(".v-expansion-panel")
// cy.getActiveMenu().find('[role="menuitem"]').contains('REST').click() .then((sheets) => {
// } else { for (let i = 0; i < sheets.length; i++) {
// cy.getActiveMenu().find('[role="menuitem"]').contains('GQL').click() // verify if all sheet names are correct
// } // cy.wrap(sheets[i]).find('.title').then((blk) => {
// cy.log(blk.text().trim())
// wait for loading to be completed // expect(blk.text().trim()).to.equal(sheetList[i])
projectsPage.waitHomePageLoad(); // })
// open sheet & validate contents cy.wrap(sheets[i])
// sheetData contains data read from excel in format .contains(sheetList[i])
// 0: { float: 1.1, number: 1, text: "abc" } .should("exist");
// 1: { float: 1.2, number: 0, text: "def" }
// for each sheet, expand to verify table names & their data types
cy.openTableTab("Sheet2", 2); cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
for (const [key, value] of Object.entries(expectedData)) {
mainPage // wait for 4 DOM rows to become visible, corresponding to 4 column names in excel
.getCell(value[0], 1) // change to avoid static wait
.contains(sheetData[0][value[0]]) cy.get(".v-data-table")
.should("exist"); .find("tr:visible")
mainPage .should("have.length", 4);
.getCell(value[0], 2)
.contains(sheetData[1][value[0]]) cy.get(".v-data-table")
.should("exist"); .find("tr:visible")
} .then((row) => {
cy.closeTableTab("Sheet2"); for (let j = 1; j < row.length; j++) {
// column name to match input in excel
cy.openTableTab("Sheet3", 2); cy.wrap(row[j])
for (const [key, value] of Object.entries(expectedData)) { .find('[placeholder="Column name"]')
mainPage .then((obj) => {
.getCell(value[0], 1) cy.log(obj[0].value);
.contains(sheetData[0][value[0]]) expect(obj[0].value).to.equal(
.should("exist"); expectedData[j - 1][0]
mainPage );
.getCell(value[0], 2) });
.contains(sheetData[1][value[0]])
.should("exist"); // datatype to match expected output
} cy.wrap(row[j])
cy.closeTableTab("Sheet3"); .find("span.caption")
.then((obj) => {
// delete project once all operations are completed cy.log(obj[0].innerText);
mainPage.toolBarTopLeft(mainPage.HOME).click(); expect(obj[0].innerText).to.equal(
cy.get(`.nc-${apiType}-project-row .mdi-delete-circle-outline`, { expectedData[j - 1][1]
timeout: 10000, );
}) });
.should("exist") }
.last() });
.invoke("show")
.click(); // unwind
cy.contains("Submit").closest("button").click(); cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
}); }
});
});
it("URL: Upload excel as template", () => { it("File Upload: Verify loaded data", () => {
// click on "New Project" // create rest/ gql project
cy.get(":nth-child(5) > .v-btn", { timeout: 20000 }).click(); cy.get(".nc-btn-use-template", { timeout: 120000 }).click();
// if (type == 'rest') {
// Subsequent form, select (+ Create) option // cy.getActiveMenu().find('[role="menuitem"]').contains('REST').click()
cy.get(".nc-create-project-from-excel", { timeout: 20000 }).click({ // } else {
force: true, // cy.getActiveMenu().find('[role="menuitem"]').contains('GQL').click()
}); // }
cy.getActiveModal().find(".caption").contains("URL").click(); // wait for loading to be completed
cy.get(".nc-excel-import-tab-item") projectsPage.waitHomePageLoad();
.find('input[type="url"]')
.click() // open sheet & validate contents
.type(URL); // sheetData contains data read from excel in format
cy.get(".nc-excel-import-tab-item") // 0: { float: 1.1, number: 1, text: "abc" }
.find("button") // 1: { float: 1.2, number: 0, text: "def" }
.contains("Load")
.click(); cy.openTableTab("Sheet2", 2);
for (const [key, value] of Object.entries(expectedData)) {
cy.get(".nc-btn-use-template", { timeout: 120000 }).should("exist"); mainPage
}); .getCell(value[0], 1)
.contains(sheetData[0][value[0]])
.should("exist");
mainPage
.getCell(value[0], 2)
.contains(sheetData[1][value[0]])
.should("exist");
}
cy.closeTableTab("Sheet2");
cy.openTableTab("Sheet3", 2);
for (const [key, value] of Object.entries(expectedData)) {
mainPage
.getCell(value[0], 1)
.contains(sheetData[0][value[0]])
.should("exist");
mainPage
.getCell(value[0], 2)
.contains(sheetData[1][value[0]])
.should("exist");
}
cy.closeTableTab("Sheet3");
// delete project once all operations are completed
mainPage.toolBarTopLeft(mainPage.HOME).click();
cy.get(`.nc-${apiType}-project-row .mdi-delete-circle-outline`, {
timeout: 10000,
})
.should("exist")
.last()
.invoke("show")
.click();
cy.contains("Submit").closest("button").click();
});
it("URL: Verify pre-load template page", () => { it("URL: Upload excel as template", () => {
cy.getActiveContentModal() // click on "New Project"
.find(".v-expansion-panel") cy.get(":nth-child(5) > .v-btn", { timeout: 20000 }).click();
.then((sheets) => {
for (let i = 0; i < sheets.length; i++) {
// verify if all sheet names are correct
// cy.wrap(sheets[i]).find('.title').then((blk) => {
// cy.log(blk.text().trim())
// expect(blk.text().trim()).to.equal('Sheet1')
// })
cy.wrap(sheets[i]).contains("Sheet1").should("exist"); // Subsequent form, select (+ Create) option
cy.get(".nc-create-project-from-excel", { timeout: 20000 }).click({
// for each sheet, expand to verify table names & their data types force: true,
cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
cy.wait(3000).then(() => {
cy.get(".v-data-table")
.find("tr:visible")
.then((row) => {
// verification restricting to 10, as others need to be scrolled back into view
for (let j = 1; j <= 10 /*row.length*/; j++) {
// column name to match input in excel
cy.wrap(row[j])
.find('[placeholder="Column name"]')
.then((obj) => {
cy.log(obj[0].value);
expect(obj[0].value).to.equal(
UrlFileExpectedData[j - 1][0]
);
});
// datatype to match expected output
cy.wrap(row[j])
.find("span.caption")
.then((obj) => {
cy.log(obj[0].innerText);
expect(obj[0].innerText).to.equal(
UrlFileExpectedData[j - 1][1]
);
});
}
});
}); });
// unwind cy.snipActiveModal("Modal_ImportExcelURL");
cy.wrap(sheets[i]).find(".mdi-chevron-down").click(); cy.getActiveModal().find(".caption").contains("URL").click();
} cy.get(".nc-excel-import-tab-item")
.find('input[type="url"]')
.click()
.type(URL);
cy.get(".nc-excel-import-tab-item")
.find("button")
.contains("Load")
.click();
cy.get(".nc-btn-use-template", { timeout: 120000 }).should("exist");
}); });
});
it("URL: Verify loaded data", () => { it("URL: Verify pre-load template page", () => {
// create rest/ gql project cy.getActiveContentModal()
cy.get(".nc-btn-use-template", { timeout: 120000 }).click(); .find(".v-expansion-panel")
.then((sheets) => {
// wait for loading to be completed for (let i = 0; i < sheets.length; i++) {
projectsPage.waitHomePageLoad(); // verify if all sheet names are correct
// cy.wrap(sheets[i]).find('.title').then((blk) => {
// open sheet & validate contents // cy.log(blk.text().trim())
// sheetData contains data read from excel in format // expect(blk.text().trim()).to.equal('Sheet1')
// 0: { float: 1.1, number: 1, text: "abc" } // })
// 1: { float: 1.2, number: 0, text: "def" }
cy.wrap(sheets[i]).contains("Sheet1").should("exist");
cy.openTableTab("Sheet1", 25);
let idx = 0; // for each sheet, expand to verify table names & their data types
for (const [key, value] of Object.entries(UrlFileExpectedData)) { cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
if (UrlFileExpectedData[idx][1] != "Date") cy.wait(3000).then(() => {
mainPage cy.get(".v-data-table")
.getCell(value[0], 1) .find("tr:visible")
.contains(UrlFileExpectedData[idx++][2][0]) .then((row) => {
.should("exist"); // verification restricting to 10, as others need to be scrolled back into view
} for (
cy.closeTableTab("Sheet1"); let j = 1;
}); j <= 10 /*row.length*/;
j++
) {
// column name to match input in excel
cy.wrap(row[j])
.find('[placeholder="Column name"]')
.then((obj) => {
cy.log(obj[0].value);
expect(obj[0].value).to.equal(
UrlFileExpectedData[
j - 1
][0]
);
});
// datatype to match expected output
cy.wrap(row[j])
.find("span.caption")
.then((obj) => {
cy.log(obj[0].innerText);
expect(
obj[0].innerText
).to.equal(
UrlFileExpectedData[
j - 1
][1]
);
});
}
});
});
// unwind
cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
}
});
});
after(() => { it("URL: Verify loaded data", () => {
// delete project once all operations are completed // create rest/ gql project
mainPage.toolBarTopLeft(mainPage.HOME).click(); cy.get(".nc-btn-use-template", { timeout: 120000 }).click();
cy.get(`.nc-${apiType}-project-row .mdi-delete-circle-outline`, {
timeout: 10000, // wait for loading to be completed
}) projectsPage.waitHomePageLoad();
.should("exist")
.last() // open sheet & validate contents
.invoke("show") // sheetData contains data read from excel in format
.click(); // 0: { float: 1.1, number: 1, text: "abc" }
cy.contains("Submit").closest("button").click(); // 1: { float: 1.2, number: 0, text: "def" }
cy.openTableTab("Sheet1", 25);
let idx = 0;
for (const [key, value] of Object.entries(UrlFileExpectedData)) {
if (UrlFileExpectedData[idx][1] != "Date")
mainPage
.getCell(value[0], 1)
.contains(UrlFileExpectedData[idx++][2][0])
.should("exist");
}
cy.closeTableTab("Sheet1");
});
after(() => {
// delete project once all operations are completed
mainPage.toolBarTopLeft(mainPage.HOME).click();
cy.get(`.nc-${apiType}-project-row .mdi-delete-circle-outline`, {
timeout: 10000,
})
.should("exist")
.last()
.invoke("show")
.click();
cy.contains("Submit").closest("button").click();
});
}); });
});
}; };
// if (typeof require !== 'undefined') XLSX = require('xlsx'); // if (typeof require !== 'undefined') XLSX = require('xlsx');

64
scripts/cypress/support/commands.js

@ -56,11 +56,13 @@ Cypress.Commands.add("signinOrSignup", (_args) => {
if ($body.find(".welcome-page").length > 0) { if ($body.find(".welcome-page").length > 0) {
cy.wait(8000); cy.wait(8000);
cy.get("body").trigger("mousemove"); cy.get("body").trigger("mousemove");
cy.snip("LetsBegin");
cy.contains("Let's Begin").click(); cy.contains("Let's Begin").click();
cy.get('input[type="text"]', { timeout: 12000 }).type( cy.get('input[type="text"]', { timeout: 12000 }).type(
args.username args.username
); );
cy.get('input[type="password"]').type(args.password); cy.get('input[type="password"]').type(args.password);
cy.snip("SignUp");
cy.get('button:contains("SIGN UP")').click(); cy.get('button:contains("SIGN UP")').click();
// handle signin // handle signin
@ -69,6 +71,7 @@ Cypress.Commands.add("signinOrSignup", (_args) => {
args.username args.username
); );
cy.get('input[type="password"]').type(args.password); cy.get('input[type="password"]').type(args.password);
cy.snip("SignIn");
cy.get('button:contains("SIGN IN")').click(); cy.get('button:contains("SIGN IN")').click();
} }
} }
@ -86,6 +89,7 @@ Cypress.Commands.add("openOrCreateRestProject", (_args) => {
// signin/signup // signin/signup
cy.signinOrSignup(); cy.signinOrSignup();
cy.get(".nc-new-project-menu").should("exist"); cy.get(".nc-new-project-menu").should("exist");
cy.snip("ProjectPage");
cy.get("body").then(($body) => { cy.get("body").then(($body) => {
const filter = args.meta const filter = args.meta
? ".nc-meta-project-row" ? ".nc-meta-project-row"
@ -164,6 +168,8 @@ Cypress.Commands.add("openTableTab", (tn, rc) => {
if (rc != 0) { if (rc != 0) {
cy.get(".nc-grid-row").should("have.length", rc); cy.get(".nc-grid-row").should("have.length", rc);
} }
cy.snip(`GridView_${tn}`);
}); });
Cypress.Commands.add("closeTableTab", (tn) => { Cypress.Commands.add("closeTableTab", (tn) => {
@ -254,6 +260,9 @@ Cypress.Commands.add("createTable", (name) => {
// .should("have.value", name.toLowerCase()); // .should("have.value", name.toLowerCase());
// } // }
cy.snip("CreateTable");
cy.snipActiveModal("Modal_CreateTable");
cy.get(".nc-create-table-card .nc-create-table-submit").first().click(); cy.get(".nc-create-table-card .nc-create-table-submit").first().click();
cy.toastWait(`Create table successful`); cy.toastWait(`Create table successful`);
cy.get(`.project-tab:contains(${name})`).should("exist"); cy.get(`.project-tab:contains(${name})`).should("exist");
@ -271,6 +280,7 @@ Cypress.Commands.add("deleteTable", (name, dbType) => {
.click({ force: true }); .click({ force: true });
cy.get(`.project-tab:contains(${name}):visible`).should("exist"); cy.get(`.project-tab:contains(${name}):visible`).should("exist");
cy.get(".nc-table-delete-btn:visible").click(); cy.get(".nc-table-delete-btn:visible").click();
cy.snipActiveModal("Modal_DeleteTable");
cy.get("button:contains(Submit)").click(); cy.get("button:contains(Submit)").click();
// only for postgre project // only for postgre project
@ -301,6 +311,7 @@ Cypress.Commands.add("renameTable", (oldName, newName) => {
// feed new name // feed new name
cy.getActiveContentModal().find("input").clear().type(newName); cy.getActiveContentModal().find("input").clear().type(newName);
cy.snipActiveModal("Modal_RenameTable");
// submit // submit
cy.getActiveContentModal().find("button").contains("Submit").click(); cy.getActiveContentModal().find("button").contains("Submit").click();
@ -327,6 +338,7 @@ Cypress.Commands.add("createColumn", (table, columnName) => {
force: true, force: true,
}); });
cy.get(".nc-column-name-input input").clear().type(columnName); cy.get(".nc-column-name-input input").clear().type(columnName);
cy.getActiveMenu("Menu_CreateColumn");
cy.get(".nc-col-create-or-edit-card").contains("Save").click(); cy.get(".nc-col-create-or-edit-card").contains("Save").click();
cy.get("th:contains(new_column)").should("exist"); cy.get("th:contains(new_column)").should("exist");
}); });
@ -375,6 +387,58 @@ Cypress.Commands.add("closeViewsTab", (vn) => {
.click({ force: true }); .click({ force: true });
}); });
// Support for screen-shots
//
let screenShotDb = [];
// snip entire screen
Cypress.Commands.add("snip", (filename) => {
if (
true === Cypress.env("screenshot") &&
false === screenShotDb.includes(filename)
) {
let storeName = `${screenShotDb.length}_${filename}`;
screenShotDb.push(filename);
cy.wait(1000);
cy.screenshot(storeName, { overwrite: true });
}
});
// snip current modal
Cypress.Commands.add("snipActiveModal", (filename) => {
if (
true === Cypress.env("screenshot") &&
false === screenShotDb.includes(filename)
) {
let storeName = `${screenShotDb.length}_${filename}`;
screenShotDb.push(filename);
cy.wait(1000);
// cy.getActiveModal().screenshot(filename, {
// padding: 0,
// overwrite: true,
// });
cy.screenshot(storeName, { overwrite: true });
}
});
// snip current menu
Cypress.Commands.add("snipActiveMenu", (filename) => {
if (
true === Cypress.env("screenshot") &&
false === screenShotDb.includes(filename)
) {
let storeName = `${screenShotDb.length}_${filename}`;
screenShotDb.push(filename);
cy.wait(1000);
// cy.getActiveMenu().screenshot(filename, {
// padding: 0,
// overwrite: true,
// });
cy.screenshot(storeName, { overwrite: true });
}
});
// Drag n Drop // Drag n Drop
// refer: https://stackoverflow.com/a/55409853 // refer: https://stackoverflow.com/a/55409853
/* /*

27
scripts/cypress/support/page_objects/mainPage.js

@ -89,19 +89,25 @@ export class _mainPage {
// click on New User button, feed details // click on New User button, feed details
cy.get('button:contains("New User")').first().click(); cy.get('button:contains("New User")').first().click();
cy.snip("NewUser");
cy.get('label:contains("E-mail")') cy.get('label:contains("E-mail")')
.next("input") .next("input")
.type(userCred.username) .type(userCred.username)
.trigger("input"); .trigger("input");
cy.get('label:contains("Select User roles")').click(); cy.get('label:contains("Select User roles")').click();
// opt-in requested role & submit // opt-in requested role & submit
cy.snipActiveMenu("Menu_RoleType");
cy.getActiveMenu().contains(roleType).click(); cy.getActiveMenu().contains(roleType).click();
cy.get(".nc-invite-or-save-btn").click(); cy.get(".nc-invite-or-save-btn").click();
cy.toastWait("Successfully updated the user details"); cy.toastWait("Successfully updated the user details");
// get URL, invoke // get URL, invoke
cy.snipActiveModal("Modal_NewUserURL");
cy.getActiveModal() cy.getActiveModal()
.find(".v-alert") .find(".v-alert")
.then(($obj) => { .then(($obj) => {
@ -257,6 +263,9 @@ export class _mainPage {
hideField = (field) => { hideField = (field) => {
cy.get(".nc-grid-header-cell").contains(field).should("be.visible"); cy.get(".nc-grid-header-cell").contains(field).should("be.visible");
cy.get(".nc-fields-menu-btn").click(); cy.get(".nc-fields-menu-btn").click();
cy.snipActiveMenu("Menu_HideField");
cy.get( cy.get(
`.menuable__content__active .v-list-item label:contains(${field})` `.menuable__content__active .v-list-item label:contains(${field})`
).click(); ).click();
@ -277,11 +286,16 @@ export class _mainPage {
sortField = (field, criteria) => { sortField = (field, criteria) => {
cy.get(".nc-sort-menu-btn").click(); cy.get(".nc-sort-menu-btn").click();
cy.contains("Add Sort Option").click(); cy.contains("Add Sort Option").click();
cy.snipActiveMenu("Menu_SortField");
cy.get(".nc-sort-field-select div").first().click(); cy.get(".nc-sort-field-select div").first().click();
cy.snipActiveMenu("Menu_SortField_fieldSelection");
cy.get(`.menuable__content__active .v-list-item:contains(${field})`) cy.get(`.menuable__content__active .v-list-item:contains(${field})`)
.first() .first()
.click(); .click();
cy.get(".nc-sort-dir-select div").first().click(); cy.get(".nc-sort-dir-select div").first().click();
cy.snipActiveMenu("Menu_SortField_criteriaSelection");
cy.get( cy.get(
`.menuable__content__active .v-list-item:contains(${criteria})` `.menuable__content__active .v-list-item:contains(${criteria})`
).click(); ).click();
@ -297,13 +311,18 @@ export class _mainPage {
filterField = (field, operation, value) => { filterField = (field, operation, value) => {
cy.get(".nc-filter-menu-btn").click(); cy.get(".nc-filter-menu-btn").click();
cy.contains("Add Filter").click(); cy.contains("Add Filter").click();
cy.snipActiveMenu("Menu_FilterField");
cy.get(".nc-filter-field-select").last().click(); cy.get(".nc-filter-field-select").last().click();
cy.snipActiveMenu("Menu_FilterField-fieldSelect");
cy.getActiveMenu() cy.getActiveMenu()
.find(`.v-list-item:contains(${field})`) .find(`.v-list-item:contains(${field})`)
.first() .first()
.click(); .click();
cy.get(".nc-filter-operation-select").last().click(); cy.get(".nc-filter-operation-select").last().click();
cy.snipActiveMenu("Menu_FilterField-operationSelect");
cy.getActiveMenu().find(`.v-list-item:contains(${operation})`).click(); cy.getActiveMenu().find(`.v-list-item:contains(${operation})`).click();
if (operation != "is null" && operation != "is not null") { if (operation != "is null" && operation != "is not null") {
cy.get(".nc-filter-value-select input:text") cy.get(".nc-filter-value-select input:text")
@ -343,6 +362,8 @@ export class _mainPage {
// cy.getActiveMenu().find(".v-list-item").contains("Views List").click(); // cy.getActiveMenu().find(".v-list-item").contains("Views List").click();
this.shareViewList().click(); this.shareViewList().click();
cy.snipActiveModal("Modal_ShareViewList");
cy.wait(1000); cy.wait(1000);
// cy.get('.container').find('button.mdi-delete-outline') // cy.get('.container').find('button.mdi-delete-outline')
@ -379,6 +400,7 @@ export class _mainPage {
// //
downloadAndVerifyCsv = (filename, verifyCsv) => { downloadAndVerifyCsv = (filename, verifyCsv) => {
cy.get(".nc-actions-menu-btn").click(); cy.get(".nc-actions-menu-btn").click();
cy.snipActiveMenu("Menu_ActionsMenu");
cy.get( cy.get(
`.menuable__content__active .v-list-item span:contains("Download as CSV")` `.menuable__content__active .v-list-item span:contains("Download as CSV")`
).click(); ).click();
@ -422,6 +444,9 @@ export class _mainPage {
// open Project metadata tab // open Project metadata tab
// //
this.navigationDraw(this.PROJ_METADATA).click(); this.navigationDraw(this.PROJ_METADATA).click();
cy.snip("Meta_Tab0");
cy.get(".nc-meta-mgmt-metadata-tab") cy.get(".nc-meta-mgmt-metadata-tab")
.should("exist") .should("exist")
.click({ force: true }); .click({ force: true });
@ -429,6 +454,8 @@ export class _mainPage {
cy.get(".nc-meta-mgmt-metadata-tab") cy.get(".nc-meta-mgmt-metadata-tab")
.should("exist") .should("exist")
.click({ force: true }); .click({ force: true });
cy.snip("Meta_Tab1");
} }
closeMetaTab() { closeMetaTab() {

8
scripts/cypress/support/page_objects/navigation.js

@ -141,6 +141,8 @@ export class _projectsPage {
cy.contains("GRAPHQL APIs").closest("label").click(); cy.contains("GRAPHQL APIs").closest("label").click();
} }
cy.snip("XcdbCreate");
// Submit // Submit
cy.contains("button", "Create", { timeout: 20000 }).click(); cy.contains("button", "Create", { timeout: 20000 }).click();
@ -211,15 +213,21 @@ export class _projectsPage {
.clear() .clear()
.type(cred.databaseName); .type(cred.databaseName);
cy.snip("ExtDbCreate");
// Test database connection // Test database connection
cy.contains("Test Database Connection", { timeout: 20000 }).click(); cy.contains("Test Database Connection", { timeout: 20000 }).click();
cy.snipActiveModal("Modal_OK_SaveProject");
// Create project // Create project
cy.contains("Ok & Save Project", { timeout: 20000 }).click(); cy.contains("Ok & Save Project", { timeout: 20000 }).click();
// takes a while to load project // takes a while to load project
this.waitHomePageLoad(); this.waitHomePageLoad();
cy.snip("Team&Auth_UserMgmt");
return projectName; return projectName;
} }
} }

Loading…
Cancel
Save