Browse Source

test(cypress): WIP- support for xcdb test suite

Signed-off-by: Raju Udava <sivadstala@gmail.com>
pull/914/head
Raju Udava 3 years ago
parent
commit
5796a80b5c
  1. 4
      packages/nc-gui/components/project/projectMetadata/uiAcl/toggleTableUIAcl.vue
  2. 60
      scripts/cypress/integration/common/00_pre_configurations.js
  3. 7
      scripts/cypress/integration/common/1b_table_column_operations.js
  4. 58
      scripts/cypress/integration/common/1c_sql_view.js
  5. 10
      scripts/cypress/integration/common/1d_table_view_drag_drop_reorder.js
  6. 6
      scripts/cypress/integration/common/1e_meta_sync.js
  7. 14
      scripts/cypress/integration/common/3b_formula_column.js
  8. 15
      scripts/cypress/integration/common/5a_user_role.js
  9. 6
      scripts/cypress/integration/common/5b_preview_role.js
  10. 2
      scripts/cypress/integration/common/6c_swagger_api.js
  11. 4
      scripts/cypress/integration/common/6e_project_operations.js
  12. 8
      scripts/cypress/integration/common/6f_attachments.js
  13. 2
      scripts/cypress/integration/common/6g_base_share.js
  14. 2
      scripts/cypress/integration/test/explicitLogin.js
  15. 4
      scripts/cypress/integration/test/gqlMisc.js
  16. 4
      scripts/cypress/integration/test/gqlRoles.js
  17. 4
      scripts/cypress/integration/test/gqlTableOps.js
  18. 4
      scripts/cypress/integration/test/gqlViews.js
  19. 4
      scripts/cypress/integration/test/restMisc.js
  20. 4
      scripts/cypress/integration/test/restRoles.js
  21. 1
      scripts/cypress/integration/test/restTableOps.js
  22. 4
      scripts/cypress/integration/test/restViews.js
  23. 4
      scripts/cypress/support/commands.js
  24. 11
      scripts/cypress/support/page_objects/projectConstants.js

4
packages/nc-gui/components/project/projectMetadata/uiAcl/toggleTableUIAcl.vue

@ -69,7 +69,7 @@
<tr <tr
v-if="table._tn.toLowerCase().indexOf(filter.toLowerCase()) > -1" v-if="table._tn.toLowerCase().indexOf(filter.toLowerCase()) > -1"
:key="table.tn" :key="table.tn"
:class="`nc-acl-table-row nc-acl-table-row-${table.tn}`" :class="`nc-acl-table-row nc-acl-table-row-${table._tn}`"
> >
<td> <td>
<v-tooltip bottom> <v-tooltip bottom>
@ -95,7 +95,7 @@
> >
<v-checkbox <v-checkbox
v-model="table.disabled[role]" v-model="table.disabled[role]"
:class="`pt-0 mt-0 nc-acl-${table.tn}-${role}-chkbox`" :class="`pt-0 mt-0 nc-acl-${table._tn.toLowerCase().replace('_','')}-${role}-chkbox`"
dense dense
hide-details hide-details
:true-value="false" :true-value="false"

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

@ -11,6 +11,7 @@ import {
isSecondarySuite, isSecondarySuite,
getCurrentMode, getCurrentMode,
isXcdb, isXcdb,
setProjectString,
} from "../../support/page_objects/projectConstants"; } from "../../support/page_objects/projectConstants";
function prepareSqliteQuery(projId) { function prepareSqliteQuery(projId) {
@ -31,7 +32,7 @@ function prepareSqliteQuery(projId) {
`ALTER TABLE "rental" RENAME TO "nc_${projId}__rental"`, `ALTER TABLE "rental" RENAME TO "nc_${projId}__rental"`,
`ALTER TABLE "staff" RENAME TO "nc_${projId}__staff"`, `ALTER TABLE "staff" RENAME TO "nc_${projId}__staff"`,
`ALTER TABLE "store" RENAME TO "nc_${projId}__store"`, `ALTER TABLE "store" RENAME TO "nc_${projId}__store"`,
`CREATE VIEW nc_${projId}__Customer_list `CREATE VIEW nc_${projId}__customer_list
AS AS
SELECT cu.customer_id AS ID, SELECT cu.customer_id AS ID,
cu.first_name||' '||cu.last_name AS name, cu.first_name||' '||cu.last_name AS name,
@ -100,6 +101,58 @@ function prepareSqliteQuery(projId) {
s.store_id AS SID s.store_id AS SID
FROM "nc_${projId}__staff" AS s JOIN "nc_${projId}__address" AS a ON s.address_id = a.address_id JOIN "nc_${projId}__city" ON a.city_id = "nc_${projId}__city".city_id FROM "nc_${projId}__staff" AS s JOIN "nc_${projId}__address" AS a ON s.address_id = a.address_id JOIN "nc_${projId}__city" ON a.city_id = "nc_${projId}__city".city_id
JOIN "nc_${projId}__country" ON "nc_${projId}__city".country_id = "nc_${projId}__country".country_id`, JOIN "nc_${projId}__country" ON "nc_${projId}__city".country_id = "nc_${projId}__country".country_id`,
// below two are dummy entries to ensure view record exists
`CREATE VIEW nc_${projId}__actor_info
AS
SELECT s.staff_id AS ID,
s.first_name||' '||s.last_name AS name,
a.address AS address,
a.postal_code AS zip_code,
a.phone AS phone,
"nc_${projId}__city".city AS city,
"nc_${projId}__country".country AS country,
s.store_id AS SID
FROM "nc_${projId}__staff" AS s JOIN "nc_${projId}__address" AS a ON s.address_id = a.address_id JOIN "nc_${projId}__city" ON a.city_id = "nc_${projId}__city".city_id
JOIN "nc_${projId}__country" ON "nc_${projId}__city".country_id = "nc_${projId}__country".country_id`,
`CREATE VIEW nc_${projId}__nice_but_slower_film_list
AS
SELECT s.staff_id AS ID,
s.first_name||' '||s.last_name AS name,
a.address AS address,
a.postal_code AS zip_code,
a.phone AS phone,
"nc_${projId}__city".city AS city,
"nc_${projId}__country".country AS country,
s.store_id AS SID
FROM "nc_${projId}__staff" AS s JOIN "nc_${projId}__address" AS a ON s.address_id = a.address_id JOIN "nc_${projId}__city" ON a.city_id = "nc_${projId}__city".city_id
JOIN "nc_${projId}__country" ON "nc_${projId}__city".country_id = "nc_${projId}__country".country_id`,
// `CREATE VIEW nc_${projId}__actor_info
// AS
// SELECT
// a.actor_id AS actor_id,
// a.first_name AS first_name,
// a.last_name AS last_name,
// GROUP_CONCAT(DISTINCT CONCAT(c.name,
// ': ',
// (SELECT
// GROUP_CONCAT(f.title
// ORDER BY f.title ASC
// SEPARATOR ', ')
// FROM
// ((nc_${projId}__film f
// JOIN nc_${projId}__film_category fc ON ((f.film_id = fc.film_id)))
// JOIN nc_${projId}__film_actor fa ON ((f.film_id = fa.film_id)))
// WHERE
// ((fc.category_id = c.category_id)
// AND (fa.actor_id = a.actor_id))))
// ORDER BY c.name ASC
// SEPARATOR '; ') AS nc_${projId}__film_info
// FROM
// (((actor a
// LEFT JOIN nc_${projId}__film_actor fa ON ((a.actor_id = fa.actor_id)))
// LEFT JOIN nc_${projId}__film_category fc ON ((fa.film_id = fc.film_id)))
// LEFT JOIN nc_${projId}__category c ON ((fc.category_id = c.category_id)))
// GROUP BY a.actor_id , a.first_name , a.last_name`,
]; ];
return sqliteQuery; return sqliteQuery;
} }
@ -140,6 +193,8 @@ export const genTest = (type, xcdb) => {
let endIdx = url.indexOf("?"); let endIdx = url.indexOf("?");
projId = url.slice(startIdx + 1, endIdx); projId = url.slice(startIdx + 1, endIdx);
cy.log(url, projId); cy.log(url, projId);
setProjectString(projId);
let query = prepareSqliteQuery(projId); let query = prepareSqliteQuery(projId);
for (let i = 0; i < query.length; i++) { for (let i = 0; i < query.length; i++) {
cy.task("sqliteExec", query[i]); cy.task("sqliteExec", query[i]);
@ -149,7 +204,7 @@ export const genTest = (type, xcdb) => {
cy.log(projId); cy.log(projId);
mainPage.openMetaTab(); mainPage.openMetaTab();
mainPage.metaSyncValidate( mainPage.metaSyncValidate(
`nc_${projId}__Actor`, `nc_${projId}__actor`,
`New table, New relation added` `New table, New relation added`
); );
mainPage.closeMetaTab(); mainPage.closeMetaTab();
@ -167,7 +222,6 @@ export const genTest = (type, xcdb) => {
// if (isTestSuiteActive('rest', false)) createProject(staticProjects.externalREST) // if (isTestSuiteActive('rest', false)) createProject(staticProjects.externalREST)
// if (isTestSuiteActive('graphql', false)) createProject(staticProjects.externalGQL) // if (isTestSuiteActive('graphql', false)) createProject(staticProjects.externalGQL)
// tbd: add case for xcdb
if ("rest" == type) { if ("rest" == type) {
if (true == xcdb) { if (true == xcdb) {
createProject(staticProjects.sampleREST); createProject(staticProjects.sampleREST);

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

@ -1,5 +1,8 @@
import { mainPage } from "../../support/page_objects/mainPage"; import { mainPage } from "../../support/page_objects/mainPage";
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import {
isTestSuiteActive,
isXcdb,
} from "../../support/page_objects/projectConstants";
export const genTest = (type, xcdb) => { export const genTest = (type, xcdb) => {
if (!isTestSuiteActive(type, xcdb)) return; if (!isTestSuiteActive(type, xcdb)) return;
@ -42,6 +45,7 @@ export const genTest = (type, xcdb) => {
// edit the newly created column // edit the newly created column
it("Edit table column - change datatype", () => { it("Edit table column - change datatype", () => {
if (!isXcdb()) {
cy.get(`th:contains(${colName}) .mdi-menu-down`) cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
.click({ force: true }); .click({ force: true });
@ -62,6 +66,7 @@ export const genTest = (type, xcdb) => {
.click({ force: true }); .click({ force: true });
cy.get(".nc-column-edit").click(); cy.get(".nc-column-edit").click();
}
}); });
// edit the newly created column // edit the newly created column

58
scripts/cypress/integration/common/1c_sql_view.js

@ -1,4 +1,7 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import {
isTestSuiteActive,
isXcdb,
} from "../../support/page_objects/projectConstants";
import { mainPage } from "../../support/page_objects/mainPage"; import { mainPage } from "../../support/page_objects/mainPage";
export const genTest = (type, xcdb) => { export const genTest = (type, xcdb) => {
@ -11,7 +14,45 @@ export const genTest = (type, xcdb) => {
// void // void
}); });
it(`XCDB: SQL View Column operations`, () => {
// Open one of the views & verify validity of first two entries
cy.openViewsTab("CustomerList", 25);
// Record-1 validation
mainPage.getCell(`ID`, 1).contains("1").should("exist");
mainPage.getCell(`Name`, 1).contains("MARY SMITH").should("exist");
mainPage.getCell(`Address`, 1).contains("1913 Hanoi Way").should("exist");
mainPage.getCell(`ZipCode`, 1).contains("35200").should("exist");
// Record-2 validation
mainPage.getCell(`ID`, 2).contains("2").should("exist");
mainPage.getCell(`Name`, 2).contains("PATRICIA JOHNSON").should("exist");
mainPage
.getCell(`Address`, 2)
.contains("1121 Loja Avenue")
.should("exist");
mainPage.getCell(`ZipCode`, 2).contains("17886").should("exist");
// Column operations: Hide
mainPage.hideField("ZipCode");
mainPage.unhideField("ZipCode");
// Column operations: Sort
mainPage.sortField("Name", "Z -> A");
mainPage.getCell(`Name`, 1).contains("ZACHARY HITE").should("exist");
mainPage.clearSort();
// Column operations: Filter
mainPage.filterField("Name", "is like", "MARY");
mainPage.getCell(`Name`, 1).contains("MARY SMITH").should("exist");
mainPage.filterReset();
cy.closeViewsTab("CustomerList");
});
it(`SQL View Column operations`, () => { it(`SQL View Column operations`, () => {
if (!isXcdb()) {
// Open one of the views & verify validity of first two entries // Open one of the views & verify validity of first two entries
cy.openViewsTab("ActorInfo", 25); cy.openViewsTab("ActorInfo", 25);
@ -49,6 +90,7 @@ export const genTest = (type, xcdb) => {
mainPage.filterReset(); mainPage.filterReset();
cy.closeViewsTab("ActorInfo"); cy.closeViewsTab("ActorInfo");
}
}); });
it(`SQL View List`, () => { it(`SQL View List`, () => {
@ -60,18 +102,26 @@ export const genTest = (type, xcdb) => {
cy.openViewsTab("FilmList", 25); cy.openViewsTab("FilmList", 25);
cy.closeViewsTab("FilmList"); cy.closeViewsTab("FilmList");
cy.openViewsTab("NicerButSlowerFilmList", 25);
cy.closeViewsTab("NicerButSlowerFilmList");
cy.openViewsTab("SalesByFilmCategory", 16); cy.openViewsTab("SalesByFilmCategory", 16);
cy.closeViewsTab("SalesByFilmCategory"); cy.closeViewsTab("SalesByFilmCategory");
if (!isXcdb()) {
cy.openViewsTab("NicerButSlowerFilmList", 25);
cy.closeViewsTab("NicerButSlowerFilmList");
// SalesByStore && StaffList contain no entries. Hence marking row count to 0 // SalesByStore && StaffList contain no entries. Hence marking row count to 0
cy.openViewsTab("SalesByStore", 0); cy.openViewsTab("SalesByStore", 0);
cy.closeViewsTab("SalesByStore"); cy.closeViewsTab("SalesByStore");
cy.openViewsTab("StaffList", 0); cy.openViewsTab("StaffList", 0);
cy.closeViewsTab("StaffList"); cy.closeViewsTab("StaffList");
} else {
cy.openViewsTab("SalesByStore", 2);
cy.closeViewsTab("SalesByStore");
cy.openViewsTab("StaffList", 2);
cy.closeViewsTab("StaffList");
}
}); });
after(() => { after(() => {

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

@ -1,4 +1,8 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import {
isTestSuiteActive,
isXcdb,
getProjectString,
} from "../../support/page_objects/projectConstants";
export const genTest = (type, xcdb) => { export const genTest = (type, xcdb) => {
if (!isTestSuiteActive(type, xcdb)) return; if (!isTestSuiteActive(type, xcdb)) return;
@ -106,7 +110,9 @@ export const genTest = (type, xcdb) => {
// move Actor3 field on top (drag, drop) // move Actor3 field on top (drag, drop)
cy.get(".nc-child-draggable-icon-Actor3").drag( cy.get(".nc-child-draggable-icon-Actor3").drag(
".nc-child-draggable-icon-actor" `.nc-child-draggable-icon-${
isXcdb() ? `nc_${getProjectString()}__` : ``
}actor`
); );
// validate new position order, Actor3 on top // validate new position order, Actor3 on top

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

@ -1,9 +1,13 @@
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 { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import {
isTestSuiteActive,
isXcdb,
} from "../../support/page_objects/projectConstants";
export const genTest = (type, xcdb) => { export const genTest = (type, xcdb) => {
if (!isTestSuiteActive(type, xcdb)) return; if (!isTestSuiteActive(type, xcdb)) return;
if (isXcdb()) return;
describe(`${type.toUpperCase()} api - Meta Sync`, () => { describe(`${type.toUpperCase()} api - Meta Sync`, () => {
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)

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

@ -1,4 +1,7 @@
import { isTestSuiteActive } from "../../support/page_objects/projectConstants"; import {
isTestSuiteActive,
isXcdb,
} from "../../support/page_objects/projectConstants";
export const genTest = (type, xcdb) => { export const genTest = (type, xcdb) => {
if (!isTestSuiteActive(type, xcdb)) return; if (!isTestSuiteActive(type, xcdb)) return;
@ -195,16 +198,19 @@ export const genTest = (type, xcdb) => {
}); });
it("Formula: LOG, EXP, POWER, SQRT", () => { it("Formula: LOG, EXP, POWER, SQRT", () => {
if (!isXcdb()) {
// SQLITE doesnt support LOG, EXP, POWER SQRT construct
editColumnByName( editColumnByName(
"NC_MATH_1", "NC_MATH_1",
"NC_MATH_2", "NC_MATH_1",
`LOG(CityId) + EXP(CityId) + POWER(CityId, 3) + SQRT(CountryId)` `LOG(CityId) + EXP(CityId) + POWER(CityId, 3) + SQRT(CountryId)`
); );
rowValidation("NC_MATH_2", RESULT_MATH_2); rowValidation("NC_MATH_1", RESULT_MATH_2);
}
}); });
it("Formula: NOW, EDIT & Delete column", () => { it("Formula: NOW, EDIT & Delete column", () => {
editColumnByName("NC_MATH_2", "NC_NOW", `NOW()`); editColumnByName("NC_MATH_1", "NC_NOW", `NOW()`);
deleteColumnByName("NC_NOW"); deleteColumnByName("NC_NOW");
}); });
}); });

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

@ -71,9 +71,9 @@ export const genTest = (type, xcdb) => {
disableTableAccess("language", "commenter"); disableTableAccess("language", "commenter");
disableTableAccess("language", "viewer"); disableTableAccess("language", "viewer");
disableTableAccess("customer_list", "editor"); disableTableAccess("customerlist", "editor");
disableTableAccess("customer_list", "commenter"); disableTableAccess("customerlist", "commenter");
disableTableAccess("customer_list", "viewer"); disableTableAccess("customerlist", "viewer");
}); });
}); });
@ -98,9 +98,16 @@ export const genTest = (type, xcdb) => {
cy.url({ timeout: 6000 }).should("contain", "#/project"); cy.url({ timeout: 6000 }).should("contain", "#/project");
if (xcdb) {
if ("rest" == type)
projectsPage.openProject(staticProjects.sampleREST.basic.name);
else projectsPage.openProject(staticProjects.sampleGQL.basic.name);
} else {
if ("rest" == type) if ("rest" == type)
projectsPage.openProject(staticProjects.externalREST.basic.name); projectsPage.openProject(staticProjects.externalREST.basic.name);
else projectsPage.openProject(staticProjects.externalGQL.basic.name); else
projectsPage.openProject(staticProjects.externalGQL.basic.name);
}
if (roleType != "creator") { if (roleType != "creator") {
cy.closeTableTab("Actor"); cy.closeTableTab("Actor");

6
scripts/cypress/integration/common/5b_preview_role.js

@ -57,9 +57,9 @@ export const genTest = (type, xcdb, roleType) => {
enableTableAccess("language", "commenter"); enableTableAccess("language", "commenter");
enableTableAccess("language", "viewer"); enableTableAccess("language", "viewer");
enableTableAccess("customer_list", "editor"); enableTableAccess("customerlist", "editor");
enableTableAccess("customer_list", "commenter"); enableTableAccess("customerlist", "commenter");
enableTableAccess("customer_list", "viewer"); enableTableAccess("customerlist", "viewer");
}); });
const genTestSub = (roleType) => { const genTestSub = (roleType) => {

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

@ -8,7 +8,7 @@ export const genTest = (type, xcdb) => {
describe(`${type.toUpperCase()} : API List - Test preparation`, () => { describe(`${type.toUpperCase()} : API List - Test preparation`, () => {
before(() => { before(() => {
loginPage.loginAndOpenProject(type, false); loginPage.loginAndOpenProject(type, xcdb);
}); });
it("Open project & record swagger URL, AuthToken", () => { it("Open project & record swagger URL, AuthToken", () => {

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

@ -1,5 +1,5 @@
import { loginPage } from "../../support/page_objects/navigation"; import { loginPage } from "../../support/page_objects/navigation";
import { roles } from "../../support/page_objects/projectConstants"; 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 = (type, xcdb) => { export const genTest = (type, xcdb) => {
@ -39,6 +39,7 @@ export const genTest = (type, xcdb) => {
}); });
it("Restart Project", () => { it("Restart Project", () => {
if (!isXcdb()) {
//cy.visit('./#/projects') //cy.visit('./#/projects')
cy.get(`.nc-${type}-project-row .mdi-restart`, { timeout: 10000 }) cy.get(`.nc-${type}-project-row .mdi-restart`, { timeout: 10000 })
.should("exist") .should("exist")
@ -48,6 +49,7 @@ export const genTest = (type, xcdb) => {
cy.contains("Submit").closest("button").click(); cy.contains("Submit").closest("button").click();
cy.toastWait("restarted successfully"); cy.toastWait("restarted successfully");
}
}); });
it("Delete Project", () => { it("Delete Project", () => {

8
scripts/cypress/integration/common/6f_attachments.js

@ -7,7 +7,7 @@ export const genTest = (type, xcdb) => {
describe(`${type.toUpperCase()} Columns of type attachment`, () => { describe(`${type.toUpperCase()} Columns of type attachment`, () => {
before(() => { before(() => {
loginPage.loginAndOpenProject(type); loginPage.loginAndOpenProject(type, xcdb);
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
}); });
@ -90,7 +90,7 @@ export const genTest = (type, xcdb) => {
it(`Filter column which contain only attachments, download CSV`, () => { it(`Filter column which contain only attachments, download CSV`, () => {
// come back to main window // come back to main window
loginPage.loginAndOpenProject(type); loginPage.loginAndOpenProject(type, xcdb);
cy.openTableTab("Country", 25); cy.openTableTab("Country", 25);
mainPage.filterField("testAttach", "is not null", null); mainPage.filterField("testAttach", "is not null", null);
@ -105,9 +105,7 @@ export const genTest = (type, xcdb) => {
expect(retrievedRecords[0]).to.be.equal(storedRecords[0]); expect(retrievedRecords[0]).to.be.equal(storedRecords[0]);
for (let i = 1; i < storedRecords.length; i++) { for (let i = 1; i < storedRecords.length; i++) {
const columns = retrievedRecords[i].split(","); const columns = retrievedRecords[i].split(",");
expect(columns[2]).to.contain( expect(columns[2]).to.contain(".json(http://localhost:8080/dl/");
".json(http://localhost:8080/dl/external"
);
} }
cy.log(retrievedRecords[109]); cy.log(retrievedRecords[109]);

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

@ -97,7 +97,7 @@ style="background: transparent; "></iframe>
permissionValidation("viewer"); permissionValidation("viewer");
it("Update to EDITOR base share link", () => { it("Update to EDITOR base share link", () => {
loginPage.loginAndOpenProject(type); loginPage.loginAndOpenProject(type, xcdb);
// click SHARE // click SHARE
cy.get(".nc-topright-menu").find(".nc-menu-share").click(); cy.get(".nc-topright-menu").find(".nc-menu-share").click();

2
scripts/cypress/integration/test/explicitLogin.js

@ -8,7 +8,7 @@ export const genTest = (type, xcdb) => {
// Run once before test- create project (rest/graphql) // Run once before test- create project (rest/graphql)
// //
before(() => { before(() => {
loginPage.loginAndOpenProject(type); loginPage.loginAndOpenProject(type, xcdb);
// open a table to work on views // open a table to work on views
// //

4
scripts/cypress/integration/test/gqlMisc.js

@ -6,12 +6,16 @@ let t6d = require("../common/6d_language_validation");
let t6e = require("../common/6e_project_operations"); let t6e = require("../common/6e_project_operations");
let t6f = require("../common/6f_attachments"); let t6f = require("../common/6f_attachments");
let t6g = require("../common/6g_base_share"); let t6g = require("../common/6g_base_share");
const {
setCurrentMode,
} = require("../../support/page_objects/projectConstants");
// use 0 as mode to execute individual files (debug mode, skip pre-configs) // use 0 as mode to execute individual files (debug mode, skip pre-configs)
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT) // use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1; const executionMode = 1;
const nocoTestSuite = (type, xcdb) => { const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) { if (0 == executionMode) {
t0.genTest(type, xcdb); t0.genTest(type, xcdb);
} else { } else {

4
scripts/cypress/integration/test/gqlRoles.js

@ -2,12 +2,16 @@ let t0 = require("./explicitLogin");
let t01 = require("../common/00_pre_configurations"); let t01 = require("../common/00_pre_configurations");
let t5a = require("../common/5a_user_role"); let t5a = require("../common/5a_user_role");
let t5b = require("../common/5b_preview_role"); let t5b = require("../common/5b_preview_role");
const {
setCurrentMode,
} = require("../../support/page_objects/projectConstants");
// use 0 as mode to execute individual files (debug mode, skip pre-configs) // use 0 as mode to execute individual files (debug mode, skip pre-configs)
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT) // use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1; const executionMode = 1;
const nocoTestSuite = (type, xcdb) => { const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) { if (0 == executionMode) {
t0.genTest(type, xcdb); t0.genTest(type, xcdb);
} else { } else {

4
scripts/cypress/integration/test/gqlTableOps.js

@ -11,6 +11,9 @@ let t3a = require("../common/3a_filter_sort_fields_operations");
let t3b = require("../common/3b_formula_column"); let t3b = require("../common/3b_formula_column");
let t3c = require("../common/3c_lookup_column"); let t3c = require("../common/3c_lookup_column");
let t3d = require("../common/3d_rollup_column"); let t3d = require("../common/3d_rollup_column");
const {
setCurrentMode,
} = require("../../support/page_objects/projectConstants");
// use 0 as mode to execute individual files (debug mode, skip pre-configs) // use 0 as mode to execute individual files (debug mode, skip pre-configs)
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT) // use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
@ -18,6 +21,7 @@ const executionMode = 1;
const nocoTestSuite = (type, xcdb) => { const nocoTestSuite = (type, xcdb) => {
if (0 == executionMode) { if (0 == executionMode) {
setCurrentMode(type, xcdb);
t0.genTest(type, xcdb); t0.genTest(type, xcdb);
} else { } else {
t01.genTest(type, xcdb); t01.genTest(type, xcdb);

4
scripts/cypress/integration/test/gqlViews.js

@ -6,12 +6,16 @@ let t4c = require("../common/4c_form_view_detailed");
let t4d = require("../common/4d_table_view_grid_locked"); let t4d = require("../common/4d_table_view_grid_locked");
let t4e = require("../common/4e_form_view_share"); let t4e = require("../common/4e_form_view_share");
let t4f = require("../common/4f_grid_view_share"); let t4f = require("../common/4f_grid_view_share");
const {
setCurrentMode,
} = require("../../support/page_objects/projectConstants");
// use 0 as mode to execute individual files (debug mode, skip pre-configs) // use 0 as mode to execute individual files (debug mode, skip pre-configs)
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT) // use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1; const executionMode = 1;
const nocoTestSuite = (type, xcdb) => { const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) { if (0 == executionMode) {
t0.genTest(type, xcdb); t0.genTest(type, xcdb);
} else { } else {

4
scripts/cypress/integration/test/restMisc.js

@ -7,12 +7,16 @@ let t6e = require("../common/6e_project_operations");
let t6f = require("../common/6f_attachments"); let t6f = require("../common/6f_attachments");
let t6g = require("../common/6g_base_share"); let t6g = require("../common/6g_base_share");
let t7a = require("../common/7a_create_project_from_excel"); let t7a = require("../common/7a_create_project_from_excel");
const {
setCurrentMode,
} = require("../../support/page_objects/projectConstants");
// use 0 as mode to execute individual files (debug mode, skip pre-configs) // use 0 as mode to execute individual files (debug mode, skip pre-configs)
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT) // use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1; const executionMode = 1;
const nocoTestSuite = (type, xcdb) => { const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) { if (0 == executionMode) {
t0.genTest(type, xcdb); t0.genTest(type, xcdb);
} else { } else {

4
scripts/cypress/integration/test/restRoles.js

@ -2,12 +2,16 @@ let t0 = require("./explicitLogin");
let t01 = require("../common/00_pre_configurations"); let t01 = require("../common/00_pre_configurations");
let t5a = require("../common/5a_user_role"); let t5a = require("../common/5a_user_role");
let t5b = require("../common/5b_preview_role"); let t5b = require("../common/5b_preview_role");
const {
setCurrentMode,
} = require("../../support/page_objects/projectConstants");
// use 0 as mode to execute individual files (debug mode, skip pre-configs) // use 0 as mode to execute individual files (debug mode, skip pre-configs)
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT) // use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1; const executionMode = 1;
const nocoTestSuite = (type, xcdb) => { const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) { if (0 == executionMode) {
t0.genTest(type, xcdb); t0.genTest(type, xcdb);
} else { } else {

1
scripts/cypress/integration/test/restTableOps.js

@ -41,7 +41,6 @@ const nocoTestSuite = (type, xcdb) => {
}; };
nocoTestSuite("rest", false); nocoTestSuite("rest", false);
// nocoTestSuite("rest", true);
/** /**
* @copyright Copyright (c) 2021, Xgene Cloud Ltd * @copyright Copyright (c) 2021, Xgene Cloud Ltd

4
scripts/cypress/integration/test/restViews.js

@ -6,12 +6,16 @@ let t4c = require("../common/4c_form_view_detailed");
let t4d = require("../common/4d_table_view_grid_locked"); let t4d = require("../common/4d_table_view_grid_locked");
let t4e = require("../common/4e_form_view_share"); let t4e = require("../common/4e_form_view_share");
let t4f = require("../common/4f_grid_view_share"); let t4f = require("../common/4f_grid_view_share");
const {
setCurrentMode,
} = require("../../support/page_objects/projectConstants");
// use 0 as mode to execute individual files (debug mode, skip pre-configs) // use 0 as mode to execute individual files (debug mode, skip pre-configs)
// use 1 mode if noco.db doesnt contain user credentials (full run over GIT) // use 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1; const executionMode = 1;
const nocoTestSuite = (type, xcdb) => { const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) { if (0 == executionMode) {
t0.genTest(type, xcdb); t0.genTest(type, xcdb);
} else { } else {

4
scripts/cypress/support/commands.js

@ -313,8 +313,8 @@ Cypress.Commands.add("createColumn", (table, columnName) => {
}); });
Cypress.Commands.add("toastWait", (msg) => { Cypress.Commands.add("toastWait", (msg) => {
cy.get(".toasted:visible", { timout: 6000 }).contains(msg).should("exist"); cy.get(".toasted:visible", { timout: 12000 }).contains(msg).should("exist");
cy.get(".toasted:visible", { timout: 6000 }) cy.get(".toasted:visible", { timout: 12000 })
.contains(msg) .contains(msg)
.should("not.exist"); .should("not.exist");
}); });

11
scripts/cypress/support/page_objects/projectConstants.js

@ -147,6 +147,7 @@ export const isSecondarySuite = (proj, xcdb) => {
}; };
let currentTestMode = ``; let currentTestMode = ``;
let xcdbProjectString = ``;
export function setCurrentMode(proj, xcdb) { export function setCurrentMode(proj, xcdb) {
if (!xcdb) { if (!xcdb) {
if (proj == "rest") currentTestMode = "extREST"; if (proj == "rest") currentTestMode = "extREST";
@ -162,7 +163,15 @@ export function getCurrentMode() {
} }
export function isXcdb() { export function isXcdb() {
if (currentTestMode === 'xcdbREST' || currentTestMode === 'xcdbGQL') if (currentTestMode === "xcdbREST" || currentTestMode === "xcdbGQL")
return true; return true;
return false; return false;
} }
export function setProjectString(projStr) {
xcdbProjectString = projStr;
}
export function getProjectString() {
return xcdbProjectString;
}

Loading…
Cancel
Save