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. 35
      scripts/cypress/integration/common/1b_table_column_operations.js
  4. 110
      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. 22
      scripts/cypress/integration/common/3b_formula_column.js
  8. 19
      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. 20
      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
v-if="table._tn.toLowerCase().indexOf(filter.toLowerCase()) > -1"
: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>
<v-tooltip bottom>
@ -95,7 +95,7 @@
>
<v-checkbox
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
hide-details
:true-value="false"

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

@ -11,6 +11,7 @@ import {
isSecondarySuite,
getCurrentMode,
isXcdb,
setProjectString,
} from "../../support/page_objects/projectConstants";
function prepareSqliteQuery(projId) {
@ -31,7 +32,7 @@ function prepareSqliteQuery(projId) {
`ALTER TABLE "rental" RENAME TO "nc_${projId}__rental"`,
`ALTER TABLE "staff" RENAME TO "nc_${projId}__staff"`,
`ALTER TABLE "store" RENAME TO "nc_${projId}__store"`,
`CREATE VIEW nc_${projId}__Customer_list
`CREATE VIEW nc_${projId}__customer_list
AS
SELECT cu.customer_id AS ID,
cu.first_name||' '||cu.last_name AS name,
@ -100,6 +101,58 @@ function prepareSqliteQuery(projId) {
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`,
// 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;
}
@ -140,6 +193,8 @@ export const genTest = (type, xcdb) => {
let endIdx = url.indexOf("?");
projId = url.slice(startIdx + 1, endIdx);
cy.log(url, projId);
setProjectString(projId);
let query = prepareSqliteQuery(projId);
for (let i = 0; i < query.length; i++) {
cy.task("sqliteExec", query[i]);
@ -149,7 +204,7 @@ export const genTest = (type, xcdb) => {
cy.log(projId);
mainPage.openMetaTab();
mainPage.metaSyncValidate(
`nc_${projId}__Actor`,
`nc_${projId}__actor`,
`New table, New relation added`
);
mainPage.closeMetaTab();
@ -167,7 +222,6 @@ export const genTest = (type, xcdb) => {
// if (isTestSuiteActive('rest', false)) createProject(staticProjects.externalREST)
// if (isTestSuiteActive('graphql', false)) createProject(staticProjects.externalGQL)
// tbd: add case for xcdb
if ("rest" == type) {
if (true == xcdb) {
createProject(staticProjects.sampleREST);

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

@ -1,5 +1,8 @@
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) => {
if (!isTestSuiteActive(type, xcdb)) return;
@ -42,26 +45,28 @@ export const genTest = (type, xcdb) => {
// edit the newly created column
it("Edit table column - change datatype", () => {
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
if (!isXcdb()) {
cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
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();
// 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.toastWait("Update table successful");
cy.get(`th[data-col="${colName}"] .mdi-text-subject`).should("exist");
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(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true })
.click({ force: true });
cy.get(".nc-column-edit").click();
cy.get(".nc-column-edit").click();
}
});
// edit the newly created column

110
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";
export const genTest = (type, xcdb) => {
@ -11,44 +14,83 @@ export const genTest = (type, xcdb) => {
// void
});
it(`SQL View Column operations`, () => {
it(`XCDB: SQL View Column operations`, () => {
// Open one of the views & verify validity of first two entries
cy.openViewsTab("ActorInfo", 25);
cy.openViewsTab("CustomerList", 25);
// Record-1 validation
mainPage.getCell(`ActorId`, 1).contains("1").should("exist");
mainPage.getCell(`FirstName`, 1).contains("PENELOPE").should("exist");
mainPage.getCell(`LastName`, 1).contains("GUINESS").should("exist");
mainPage
.getCell(`FilmInfo`, 1)
.contains("Animation: ANACONDA CONFESSIONS;")
.should("exist");
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(`ActorId`, 2).contains("2").should("exist");
mainPage.getCell(`FirstName`, 2).contains("NICK").should("exist");
mainPage.getCell(`LastName`, 2).contains("WAHLBERG").should("exist");
mainPage.getCell(`ID`, 2).contains("2").should("exist");
mainPage.getCell(`Name`, 2).contains("PATRICIA JOHNSON").should("exist");
mainPage
.getCell(`FilmInfo`, 2)
.contains("Action: BULL SHAWSHANK; Animation: FIGHT JAWBREAKER;")
.getCell(`Address`, 2)
.contains("1121 Loja Avenue")
.should("exist");
mainPage.getCell(`ZipCode`, 2).contains("17886").should("exist");
// Column operations: Hide
mainPage.hideField("FilmInfo");
mainPage.unhideField("FilmInfo");
mainPage.hideField("ZipCode");
mainPage.unhideField("ZipCode");
// Column operations: Sort
mainPage.sortField("FirstName", "Z -> A");
mainPage.getCell(`FirstName`, 1).contains("ZERO").should("exist");
mainPage.sortField("Name", "Z -> A");
mainPage.getCell(`Name`, 1).contains("ZACHARY HITE").should("exist");
mainPage.clearSort();
// Column operations: Filter
mainPage.filterField("FirstName", "is like", "PENELOPE");
mainPage.getCell(`FirstName`, 1).contains("PENELOPE").should("exist");
mainPage.filterField("Name", "is like", "MARY");
mainPage.getCell(`Name`, 1).contains("MARY SMITH").should("exist");
mainPage.filterReset();
cy.closeViewsTab("ActorInfo");
cy.closeViewsTab("CustomerList");
});
it(`SQL View Column operations`, () => {
if (!isXcdb()) {
// Open one of the views & verify validity of first two entries
cy.openViewsTab("ActorInfo", 25);
// Record-1 validation
mainPage.getCell(`ActorId`, 1).contains("1").should("exist");
mainPage.getCell(`FirstName`, 1).contains("PENELOPE").should("exist");
mainPage.getCell(`LastName`, 1).contains("GUINESS").should("exist");
mainPage
.getCell(`FilmInfo`, 1)
.contains("Animation: ANACONDA CONFESSIONS;")
.should("exist");
// Record-2 validation
mainPage.getCell(`ActorId`, 2).contains("2").should("exist");
mainPage.getCell(`FirstName`, 2).contains("NICK").should("exist");
mainPage.getCell(`LastName`, 2).contains("WAHLBERG").should("exist");
mainPage
.getCell(`FilmInfo`, 2)
.contains("Action: BULL SHAWSHANK; Animation: FIGHT JAWBREAKER;")
.should("exist");
// Column operations: Hide
mainPage.hideField("FilmInfo");
mainPage.unhideField("FilmInfo");
// Column operations: Sort
mainPage.sortField("FirstName", "Z -> A");
mainPage.getCell(`FirstName`, 1).contains("ZERO").should("exist");
mainPage.clearSort();
// Column operations: Filter
mainPage.filterField("FirstName", "is like", "PENELOPE");
mainPage.getCell(`FirstName`, 1).contains("PENELOPE").should("exist");
mainPage.filterReset();
cy.closeViewsTab("ActorInfo");
}
});
it(`SQL View List`, () => {
@ -60,18 +102,26 @@ export const genTest = (type, xcdb) => {
cy.openViewsTab("FilmList", 25);
cy.closeViewsTab("FilmList");
cy.openViewsTab("NicerButSlowerFilmList", 25);
cy.closeViewsTab("NicerButSlowerFilmList");
cy.openViewsTab("SalesByFilmCategory", 16);
cy.closeViewsTab("SalesByFilmCategory");
// SalesByStore && StaffList contain no entries. Hence marking row count to 0
cy.openViewsTab("SalesByStore", 0);
cy.closeViewsTab("SalesByStore");
if (!isXcdb()) {
cy.openViewsTab("NicerButSlowerFilmList", 25);
cy.closeViewsTab("NicerButSlowerFilmList");
// SalesByStore && StaffList contain no entries. Hence marking row count to 0
cy.openViewsTab("SalesByStore", 0);
cy.closeViewsTab("SalesByStore");
cy.openViewsTab("StaffList", 0);
cy.closeViewsTab("StaffList");
} else {
cy.openViewsTab("SalesByStore", 2);
cy.closeViewsTab("SalesByStore");
cy.openViewsTab("StaffList", 0);
cy.closeViewsTab("StaffList");
cy.openViewsTab("StaffList", 2);
cy.closeViewsTab("StaffList");
}
});
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) => {
if (!isTestSuiteActive(type, xcdb)) return;
@ -106,7 +110,9 @@ export const genTest = (type, xcdb) => {
// move Actor3 field on top (drag, drop)
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

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

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

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

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

@ -71,9 +71,9 @@ export const genTest = (type, xcdb) => {
disableTableAccess("language", "commenter");
disableTableAccess("language", "viewer");
disableTableAccess("customer_list", "editor");
disableTableAccess("customer_list", "commenter");
disableTableAccess("customer_list", "viewer");
disableTableAccess("customerlist", "editor");
disableTableAccess("customerlist", "commenter");
disableTableAccess("customerlist", "viewer");
});
});
@ -98,9 +98,16 @@ export const genTest = (type, xcdb) => {
cy.url({ timeout: 6000 }).should("contain", "#/project");
if ("rest" == type)
projectsPage.openProject(staticProjects.externalREST.basic.name);
else projectsPage.openProject(staticProjects.externalGQL.basic.name);
if (xcdb) {
if ("rest" == type)
projectsPage.openProject(staticProjects.sampleREST.basic.name);
else projectsPage.openProject(staticProjects.sampleGQL.basic.name);
} else {
if ("rest" == type)
projectsPage.openProject(staticProjects.externalREST.basic.name);
else
projectsPage.openProject(staticProjects.externalGQL.basic.name);
}
if (roleType != "creator") {
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", "viewer");
enableTableAccess("customer_list", "editor");
enableTableAccess("customer_list", "commenter");
enableTableAccess("customer_list", "viewer");
enableTableAccess("customerlist", "editor");
enableTableAccess("customerlist", "commenter");
enableTableAccess("customerlist", "viewer");
});
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`, () => {
before(() => {
loginPage.loginAndOpenProject(type, false);
loginPage.loginAndOpenProject(type, xcdb);
});
it("Open project & record swagger URL, AuthToken", () => {

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

@ -1,5 +1,5 @@
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";
export const genTest = (type, xcdb) => {
@ -39,15 +39,17 @@ export const genTest = (type, xcdb) => {
});
it("Restart Project", () => {
//cy.visit('./#/projects')
cy.get(`.nc-${type}-project-row .mdi-restart`, { timeout: 10000 })
.should("exist")
.last()
.invoke("show")
.click();
cy.contains("Submit").closest("button").click();
if (!isXcdb()) {
//cy.visit('./#/projects')
cy.get(`.nc-${type}-project-row .mdi-restart`, { timeout: 10000 })
.should("exist")
.last()
.invoke("show")
.click();
cy.contains("Submit").closest("button").click();
cy.toastWait("restarted successfully");
cy.toastWait("restarted successfully");
}
});
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`, () => {
before(() => {
loginPage.loginAndOpenProject(type);
loginPage.loginAndOpenProject(type, xcdb);
cy.openTableTab("Country", 25);
});
@ -90,7 +90,7 @@ export const genTest = (type, xcdb) => {
it(`Filter column which contain only attachments, download CSV`, () => {
// come back to main window
loginPage.loginAndOpenProject(type);
loginPage.loginAndOpenProject(type, xcdb);
cy.openTableTab("Country", 25);
mainPage.filterField("testAttach", "is not null", null);
@ -105,9 +105,7 @@ export const genTest = (type, xcdb) => {
expect(retrievedRecords[0]).to.be.equal(storedRecords[0]);
for (let i = 1; i < storedRecords.length; i++) {
const columns = retrievedRecords[i].split(",");
expect(columns[2]).to.contain(
".json(http://localhost:8080/dl/external"
);
expect(columns[2]).to.contain(".json(http://localhost:8080/dl/");
}
cy.log(retrievedRecords[109]);

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

@ -97,7 +97,7 @@ style="background: transparent; "></iframe>
permissionValidation("viewer");
it("Update to EDITOR base share link", () => {
loginPage.loginAndOpenProject(type);
loginPage.loginAndOpenProject(type, xcdb);
// click SHARE
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)
//
before(() => {
loginPage.loginAndOpenProject(type);
loginPage.loginAndOpenProject(type, xcdb);
// 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 t6f = require("../common/6f_attachments");
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 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1;
const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) {
t0.genTest(type, xcdb);
} else {

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

@ -2,12 +2,16 @@ let t0 = require("./explicitLogin");
let t01 = require("../common/00_pre_configurations");
let t5a = require("../common/5a_user_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 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1;
const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) {
t0.genTest(type, xcdb);
} 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 t3c = require("../common/3c_lookup_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 1 mode if noco.db doesnt contain user credentials (full run over GIT)
@ -18,6 +21,7 @@ const executionMode = 1;
const nocoTestSuite = (type, xcdb) => {
if (0 == executionMode) {
setCurrentMode(type, xcdb);
t0.genTest(type, xcdb);
} else {
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 t4e = require("../common/4e_form_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 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1;
const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) {
t0.genTest(type, xcdb);
} 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 t6g = require("../common/6g_base_share");
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 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1;
const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) {
t0.genTest(type, xcdb);
} else {

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

@ -2,12 +2,16 @@ let t0 = require("./explicitLogin");
let t01 = require("../common/00_pre_configurations");
let t5a = require("../common/5a_user_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 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1;
const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) {
t0.genTest(type, xcdb);
} else {

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

@ -41,7 +41,6 @@ const nocoTestSuite = (type, xcdb) => {
};
nocoTestSuite("rest", false);
// nocoTestSuite("rest", true);
/**
* @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 t4e = require("../common/4e_form_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 1 mode if noco.db doesnt contain user credentials (full run over GIT)
const executionMode = 1;
const nocoTestSuite = (type, xcdb) => {
setCurrentMode(type, xcdb);
if (0 == executionMode) {
t0.genTest(type, xcdb);
} else {

4
scripts/cypress/support/commands.js

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

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

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

Loading…
Cancel
Save