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. 19
      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. 15
      scripts/cypress/integration/common/1e_meta_sync.js
  9. 20
      scripts/cypress/integration/common/2a_table_with_belongs_to_colulmn.js
  10. 15
      scripts/cypress/integration/common/2b_table_with_m2m_column.js
  11. 23
      scripts/cypress/integration/common/3a_filter_sort_fields_operations.js
  12. 3
      scripts/cypress/integration/common/3b_formula_column.js
  13. 2
      scripts/cypress/integration/common/3c_lookup_column.js
  14. 2
      scripts/cypress/integration/common/3d_rollup_column.js
  15. 7
      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. 49
      scripts/cypress/integration/common/4e_form_view_share.js
  19. 41
      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. 72
      scripts/cypress/integration/common/6c_swagger_api.js
  23. 7
      scripts/cypress/integration/common/6d_language_validation.js
  24. 11
      scripts/cypress/integration/common/6e_project_operations.js
  25. 17
      scripts/cypress/integration/common/6g_base_share.js
  26. 38
      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);

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

@ -11,6 +11,7 @@ export const genTest = (apiType, dbType) => {
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.snipActiveModal("Modal_AddNewRow");
cy.getActiveModal() cy.getActiveModal()
.find("button") .find("button")
.contains("Save Row") .contains("Save Row")
@ -59,7 +60,9 @@ export const genTest = (apiType, dbType) => {
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`) cy.get(`th:contains(${colName}) .mdi-menu-down`)
.trigger("mouseover", { force: true }) .trigger("mouseover", { force: true })
@ -107,7 +110,10 @@ export const genTest = (apiType, dbType) => {
}); });
it("Update row", () => { it("Update row", () => {
mainPage.getRow(1).find(".nc-row-expand-icon").click({ force: true }); mainPage
.getRow(1)
.find(".nc-row-expand-icon")
.click({ force: true });
cy.get("#data-table-form-Title > input") cy.get("#data-table-form-Title > input")
.first() .first()
.clear() .clear()
@ -120,7 +126,10 @@ export const genTest = (apiType, dbType) => {
cy.toastWait("updated successfully"); cy.toastWait("updated successfully");
mainPage.getCell("Title", 1).contains(randVal).should("not.exist"); mainPage.getCell("Title", 1).contains(randVal).should("not.exist");
mainPage.getCell("Title", 1).contains(updatedRandVal).should("exist"); mainPage
.getCell("Title", 1)
.contains(updatedRandVal)
.should("exist");
}); });
it("Delete row", () => { it("Delete row", () => {
@ -154,7 +163,9 @@ export const genTest = (apiType, dbType) => {
// delete selected rows // delete selected rows
mainPage.getCell("Title", 1).rightclick({ force: true }); mainPage.getCell("Title", 1).rightclick({ force: true });
cy.getActiveMenu().contains("Delete Selected Row").click({ force: true }); cy.getActiveMenu()
.contains("Delete Selected Row")
.click({ force: true });
// verify if everything is wiped off // verify if everything is wiped off
mainPage.getCell("Title", 1).contains("a1").should("not.exist"); 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();

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

@ -69,8 +69,14 @@ export const genTest = (apiType, dbType) => {
// //
if (!isXcdb()) { if (!isXcdb()) {
// Remove relation (FK) // Remove relation (FK)
cy.task(dbCmd, `ALTER TABLE ${projPrefix}table1 DROP FOREIGN KEY fk1`); cy.task(
cy.task(dbCmd, `ALTER TABLE ${projPrefix}table1 DROP INDEX fk1_idx`); dbCmd,
`ALTER TABLE ${projPrefix}table1 DROP FOREIGN KEY fk1`
);
cy.task(
dbCmd,
`ALTER TABLE ${projPrefix}table1 DROP INDEX fk1_idx`
);
mainPage.metaSyncValidate( mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`, `${tblDisplayPrefix}table1`,
"Relation removed" "Relation removed"
@ -121,7 +127,10 @@ export const genTest = (apiType, dbType) => {
// DROP TABLE // DROP TABLE
cy.task(dbCmd, `DROP TABLE ${projPrefix}table1`); cy.task(dbCmd, `DROP TABLE ${projPrefix}table1`);
cy.task(dbCmd, `DROP TABLE ${projPrefix}table2`); cy.task(dbCmd, `DROP TABLE ${projPrefix}table2`);
mainPage.metaSyncValidate(`${tblDisplayPrefix}table1`, "Table removed"); mainPage.metaSyncValidate(
`${tblDisplayPrefix}table1`,
"Table removed"
);
}); });
it(`Hide, Filter, Sort`, () => { it(`Hide, Filter, Sort`, () => {

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

@ -21,12 +21,18 @@ export const genTest = (apiType, dbType) => {
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', {
timeout: 12000,
})
.first() .first()
.click(); .click();
cy.get('td[data-col="Country => City"] div .mdi-arrow-expand:visible') cy.get(
'td[data-col="Country => City"] div .mdi-arrow-expand:visible'
)
.first() .first()
.click(); .click();
cy.snipActiveModal("Modal_BelongsTo");
}); });
it("Expand Link record, validate", () => { it("Expand Link record, validate", () => {
@ -34,9 +40,13 @@ export const genTest = (apiType, dbType) => {
.find("button:contains(Link to 'City')") .find("button:contains(Link to 'City')")
.click() .click()
.then(() => { .then(() => {
cy.snipActiveModal("Modal_BT_LinkRecord");
// Link record form validation // Link record form validation
cy.getActiveModal().contains("Link Record").should("exist"); cy.getActiveModal().contains("Link Record").should("exist");
cy.getActiveModal().find("button.mdi-reload").should("exist"); cy.getActiveModal()
.find("button.mdi-reload")
.should("exist");
cy.getActiveModal() cy.getActiveModal()
.find('button:contains("New Record")') .find('button:contains("New Record")')
.should("exist"); .should("exist");
@ -50,7 +60,9 @@ export const genTest = (apiType, dbType) => {
.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();
}); });
}); });
}); });

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

@ -28,6 +28,8 @@ export const genTest = (apiType, dbType) => {
.first() .first()
.click({ force: true }); .click({ force: true });
cy.snipActiveModal("Modal_ManyToMany");
// validations // validations
cy.getActiveModal().contains("Film").should("exist"); cy.getActiveModal().contains("Film").should("exist");
cy.getActiveModal().find("button.mdi-reload").should("exist"); cy.getActiveModal().find("button.mdi-reload").should("exist");
@ -46,9 +48,12 @@ export const genTest = (apiType, dbType) => {
.find("button:contains(Link to 'Film')") .find("button:contains(Link to 'Film')")
.click() .click()
.then(() => { .then(() => {
cy.snipActiveModal("Modal_M2M_LinkToRecord");
// Link record form validation // Link record form validation
cy.getActiveModal().contains("Link Record").should("exist"); cy.getActiveModal().contains("Link Record").should("exist");
cy.getActiveModal().find("button.mdi-reload").should("exist"); cy.getActiveModal()
.find("button.mdi-reload")
.should("exist");
cy.getActiveModal() cy.getActiveModal()
.find('button:contains("New Record")') .find('button:contains("New Record")')
.should("exist"); .should("exist");
@ -76,9 +81,13 @@ export const genTest = (apiType, dbType) => {
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()
.find('button:contains("Cancel")')
.click();
cy.getActiveModal().find("button.mdi-close").click(); cy.getActiveModal().find("button.mdi-close").click();
}); });
}); });

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

@ -39,7 +39,9 @@ export const genTest = (apiType, dbType) => {
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")
.first()
.type("Test Country");
cy.contains("Save Row").filter("button").click(); cy.contains("Save Row").filter("button").click();
cy.toastWait("updated successfully"); cy.toastWait("updated successfully");
@ -69,7 +71,12 @@ export const genTest = (apiType, dbType) => {
// //
it("Add row using rightclick menu option", () => { it("Add row using rightclick menu option", () => {
mainPage.getCell("Country", 9).rightclick({ force: true }); mainPage.getCell("Country", 9).rightclick({ force: true });
cy.getActiveMenu().contains("Insert New Row").click({ force: true });
cy.snipActiveMenu("Menu_GridRightClick");
cy.getActiveMenu()
.contains("Insert New Row")
.click({ force: true });
mainPage mainPage
.getCell("Country", 10) .getCell("Country", 10)
.dblclick() .dblclick()
@ -79,7 +86,9 @@ export const genTest = (apiType, dbType) => {
// cy.toastWait('saved successfully') // cy.toastWait('saved successfully')
mainPage.getCell("Country", 10).rightclick({ force: true }); mainPage.getCell("Country", 10).rightclick({ force: true });
cy.getActiveMenu().contains("Insert New Row").click({ force: true }); cy.getActiveMenu()
.contains("Insert New Row")
.click({ force: true });
mainPage mainPage
.getCell("Country", 11) .getCell("Country", 11)
.dblclick() .dblclick()
@ -128,7 +137,7 @@ export const genTest = (apiType, dbType) => {
describe(`Sort operations`, () => { describe(`Sort operations`, () => {
it("Enable sort", () => { it("Enable sort", () => {
mainPage.sortField('Country', "Z -> A") mainPage.sortField("Country", "Z -> A");
// Sort menu operations (Country Column, Z->A) // Sort menu operations (Country Column, Z->A)
// cy.get(".nc-sort-menu-btn").click(); // cy.get(".nc-sort-menu-btn").click();
@ -163,7 +172,7 @@ export const genTest = (apiType, dbType) => {
// ".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.hideField("LastUpdate");
cy.get("th:contains(LastUpdate)").should("not.be.visible"); cy.get("th:contains(LastUpdate)").should("not.be.visible");
}); });
@ -173,14 +182,14 @@ export const genTest = (apiType, dbType) => {
// ".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.unhideField('LastUpdate') mainPage.unhideField("LastUpdate");
cy.get("th:contains(LastUpdate)").should("be.visible"); cy.get("th:contains(LastUpdate)").should("be.visible");
}); });
}); });
describe("Filter operations", () => { describe("Filter operations", () => {
it("Create Filter", () => { it("Create Filter", () => {
mainPage.filterField('Country', 'is equal', 'India'); mainPage.filterField("Country", "is equal", "India");
cy.get("td:contains(India)").should("exist"); cy.get("td:contains(India)").should("exist");
// cy.get(".nc-filter-menu-btn").click(); // cy.get(".nc-filter-menu-btn").click();

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

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

@ -44,6 +44,8 @@ export const genTest = (apiType, dbType) => {
fetchParentFromLabel("Child column"); fetchParentFromLabel("Child column");
cy.getActiveMenu().contains(childCol).click(); cy.getActiveMenu().contains(childCol).click();
cy.snipActiveMenu("LookUp");
// 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();

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();

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

@ -34,11 +34,16 @@ export const genTest = (apiType, dbType) => {
cy.get(`.nc-view-item.nc-${viewType}-view-item`) cy.get(`.nc-view-item.nc-${viewType}-view-item`)
.contains("Country1") .contains("Country1")
.should("exist"); .should("exist");
cy.snip(`View_${viewType}`);
}); });
it(`Edit ${viewType} view name`, () => { it(`Edit ${viewType} view name`, () => {
// click on edit-icon (becomes visible on hovering mouse) // click on edit-icon (becomes visible on hovering mouse)
cy.get(".nc-view-edit-icon").click({ force: true, timeout: 1000 }); cy.get(".nc-view-edit-icon").click({
force: true,
timeout: 1000,
});
// feed new name // feed new name
cy.get(`.nc-${viewType}-view-item input`).type( cy.get(`.nc-${viewType}-view-item input`).type(

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

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

@ -47,20 +47,31 @@ export const genTest = (apiType, dbType) => {
// add post submission message // add post submission message
// swap position for City, LastUpdate fields // swap position for City, LastUpdate fields
// remove City=>Address field // 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)
.click();
cy.get(".nc-form > .mx-auto") cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]') .find('[type="checkbox"]')
.eq(1) .eq(1)
.should("be.checked"); .should("be.checked");
cy.get(".nc-form").find('[placeholder="Form Title"]').type("A B C D"); cy.get(".nc-form")
.find('[placeholder="Form Title"]')
.type("A B C D");
cy.get(".nc-form") cy.get(".nc-form")
.find('[placeholder="Add form description"]') .find('[placeholder="Add form description"]')
.type("Some description about form comes here"); .type("Some description about form comes here");
cy.get(".nc-form > .mx-auto").find("textarea").type("Congratulations!"); cy.get(".nc-form > .mx-auto")
.find("textarea")
.type("Congratulations!");
cy.get("#data-table-form-City").drag("#data-table-form-LastUpdate"); cy.get("#data-table-form-City").drag(
cy.get('[title="City => Address"]').drag(".nc-drag-n-drop-to-hide"); "#data-table-form-LastUpdate"
);
cy.get('[title="City => Address"]').drag(
".nc-drag-n-drop-to-hide"
);
cy.get(".nc-form > .mx-auto") cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]') .find('[type="checkbox"]')
@ -87,6 +98,8 @@ export const genTest = (apiType, dbType) => {
// .click(); // .click();
mainPage.shareView().click(); mainPage.shareView().click();
cy.snipActiveModal("Modal_ShareView");
// copy link text, visit URL // copy link text, visit URL
cy.getActiveModal() cy.getActiveModal()
.find(".share-link-box") .find(".share-link-box")
@ -101,6 +114,8 @@ export const genTest = (apiType, dbType) => {
// wait for share view page to load! // wait for share view page to load!
cy.get(".nc-form").should("exist"); cy.get(".nc-form").should("exist");
cy.snip("ShareView_Form");
// New form appeared? Header & description should exist // New form appeared? Header & description should exist
cy.get(".nc-form", { timeout: 10000 }) cy.get(".nc-form", { timeout: 10000 })
.find("h2") .find("h2")
@ -122,13 +137,22 @@ export const genTest = (apiType, dbType) => {
.eq(0) .eq(0)
.contains("LastUpdate") .contains("LastUpdate")
.should("exist"); .should("exist");
cy.get(".nc-field-wrapper").eq(1).contains("City").should("exist"); cy.get(".nc-field-wrapper")
.eq(1)
.contains("City")
.should("exist");
// submit form, to read message // submit form, to read message
cy.get("#data-table-form-City").type("_abc"); cy.get("#data-table-form-City").type("_abc");
cy.get("#data-table-form-LastUpdate").click(); cy.get("#data-table-form-LastUpdate").click();
cy.getActiveModal().find("button").contains("19").click(); cy.getActiveModal()
cy.getActiveModal().find("button").contains("OK").click(); .find("button")
.contains("19")
.click();
cy.getActiveModal()
.find("button")
.contains("OK")
.click();
cy.get("button").contains("Link to 'Country'").click(); cy.get("button").contains("Link to 'Country'").click();
cy.getActiveModal() cy.getActiveModal()
.find(".child-card") .find(".child-card")
@ -136,7 +160,10 @@ export const genTest = (apiType, dbType) => {
.click(); .click();
// submit button & validate // submit button & validate
cy.get(".nc-form").find("button").contains("Submit").click(); cy.get(".nc-form")
.find("button")
.contains("Submit")
.click();
cy.toastWait("Congratulations"); cy.toastWait("Congratulations");
cy.get(".v-alert") cy.get(".v-alert")
.contains("Congratulations") .contains("Congratulations")
@ -151,7 +178,9 @@ export const genTest = (apiType, dbType) => {
.should("exist"); .should("exist");
cy.get(".nc-form", { timeout: 10000 }) cy.get(".nc-form", { timeout: 10000 })
.find(".body-1") .find(".body-1")
.contains("Some description about form comes here") .contains(
"Some description about form comes here"
)
.should("exist"); .should("exist");
}); });
}); });

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

@ -119,7 +119,9 @@ export const genTest = (apiType, dbType) => {
.then(() => { .then(() => {
// cy.get(".v-overlay__content > .d-flex > .v-icon").click(); // cy.get(".v-overlay__content > .d-flex > .v-icon").click();
// close modal (fix me! add a close button to share view list modal) // close modal (fix me! add a close button to share view list modal)
cy.get('.v-overlay--active > .v-overlay__scrim').click({force: true}); cy.get(".v-overlay--active > .v-overlay__scrim").click({
force: true,
});
}); });
}); });
@ -132,6 +134,8 @@ export const genTest = (apiType, dbType) => {
// wait for page rendering to complete // wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 18); cy.get(".nc-grid-row").should("have.length", 18);
cy.snip("ShareView_Grid");
// verify title // verify title
cy.get("div.model-name").contains("Address1").should("exist"); cy.get("div.model-name").contains("Address1").should("exist");
}); });
@ -149,8 +153,14 @@ export const genTest = (apiType, dbType) => {
.getCell("District", 1) .getCell("District", 1)
.contains("West Bengali") .contains("West Bengali")
.should("exist"); .should("exist");
mainPage.getCell("District", 2).contains("Tutuila").should("exist"); mainPage
mainPage.getCell("District", 3).contains("Tamil Nadu").should("exist"); .getCell("District", 2)
.contains("Tutuila")
.should("exist");
mainPage
.getCell("District", 3)
.contains("Tamil Nadu")
.should("exist");
}); });
it(`Share ${viewType.toUpperCase()} view : verify download CSV`, () => { it(`Share ${viewType.toUpperCase()} view : verify download CSV`, () => {
@ -176,7 +186,10 @@ export const genTest = (apiType, dbType) => {
}; };
// download & verify // download & verify
mainPage.downloadAndVerifyCsv(`Address_exported_1.csv`, verifyCsv); mainPage.downloadAndVerifyCsv(
`Address_exported_1.csv`,
verifyCsv
);
mainPage.unhideField("LastUpdate"); mainPage.unhideField("LastUpdate");
}); });
@ -203,7 +216,10 @@ export const genTest = (apiType, dbType) => {
mainPage.filterField("District", "is like", "Tamil"); mainPage.filterField("District", "is like", "Tamil");
// wait for page rendering to complete // wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 2); cy.get(".nc-grid-row").should("have.length", 2);
mainPage.getCell("District", 1).contains("Tamil").should("exist"); mainPage
.getCell("District", 1)
.contains("Tamil")
.should("exist");
}); });
it(`Share ${viewType.toUpperCase()} view : verify download CSV after local filter`, () => { it(`Share ${viewType.toUpperCase()} view : verify download CSV after local filter`, () => {
@ -228,7 +244,10 @@ export const genTest = (apiType, dbType) => {
} }
} }
}; };
mainPage.downloadAndVerifyCsv(`Address_exported_1.csv`, verifyCsv); mainPage.downloadAndVerifyCsv(
`Address_exported_1.csv`,
verifyCsv
);
mainPage.unhideField("LastUpdate"); mainPage.unhideField("LastUpdate");
}); });
@ -270,7 +289,10 @@ export const genTest = (apiType, dbType) => {
.find("button") .find("button")
.contains("Link to") .contains("Link to")
.should("not.exist"); .should("not.exist");
cy.getActiveModal().find(".child-card").contains("2").should("exist"); cy.getActiveModal()
.find(".child-card")
.contains("2")
.should("exist");
cy.getActiveModal() cy.getActiveModal()
.find(".child-card") .find(".child-card")
.find("button") .find("button")
@ -393,7 +415,10 @@ export const genTest = (apiType, dbType) => {
it(`Generate default Shared GRID view URL`, () => { it(`Generate default Shared GRID view URL`, () => {
// add row // add row
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-Country > input").first().click().type("a"); cy.get("#data-table-form-Country > input")
.first()
.click()
.type("a");
cy.contains("Save Row").filter("button").click({ force: true }); cy.contains("Save Row").filter("button").click({ force: true });
cy.toastWait("updated successfully"); cy.toastWait("updated successfully");

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", () => {

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

@ -67,39 +67,61 @@ export const genTest = (apiType, dbType) => {
// 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 // validate; API order assumed
cy.get("#operations-tag-Authentication", { timeout: 20000 }) cy.get("#operations-tag-Authentication", {
timeout: 20000,
})
.should("exist") .should("exist")
.next() .next()
.find(".opblock") .find(".opblock")
.should("has.length", 9); .should("has.length", 9);
getSwaggerButton("Authentication", 0, "User login").should("exist"); getSwaggerButton(
getSwaggerButton("Authentication", 1, "User signup").should( "Authentication",
"exist" 0,
); "User login"
getSwaggerButton("Authentication", 2, "Password Forgot").should( ).should("exist");
"exist" getSwaggerButton(
); "Authentication",
getSwaggerButton("Authentication", 3, "Email validate link").should( 1,
"exist" "User signup"
); ).should("exist");
getSwaggerButton(
"Authentication",
2,
"Password Forgot"
).should("exist");
getSwaggerButton(
"Authentication",
3,
"Email validate link"
).should("exist");
getSwaggerButton( getSwaggerButton(
"Authentication", "Authentication",
4, 4,
"Validate password reset token" "Validate password reset token"
).should("exist"); ).should("exist");
getSwaggerButton("Authentication", 5, "Password reset").should( getSwaggerButton(
"exist" "Authentication",
); 5,
getSwaggerButton("Authentication", 6, "User details").should( "Password reset"
"exist" ).should("exist");
); getSwaggerButton(
getSwaggerButton("Authentication", 7, "Update user details").should( "Authentication",
"exist" 6,
); "User details"
getSwaggerButton("Authentication", 8, "Update user details").should( ).should("exist");
"exist" getSwaggerButton(
); "Authentication",
7,
"Update user details"
).should("exist");
getSwaggerButton(
"Authentication",
8,
"Update user details"
).should("exist");
}); });
}); });
}); });
@ -111,7 +133,9 @@ export const genTest = (apiType, dbType) => {
cy.get(".auth-btn-wrapper > .authorize").click(); cy.get(".auth-btn-wrapper > .authorize").click();
// Response: "Authorized" should exist on DOM // Response: "Authorized" should exist on DOM
cy.get(".auth-container").contains("Authorized").should("exist"); cy.get(".auth-container")
.contains("Authorized")
.should("exist");
cy.get(".btn-done").click(); cy.get(".btn-done").click();
// Authorize button is LOCKED now // Authorize button is LOCKED now

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"

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

@ -19,6 +19,7 @@ export const genTest = (apiType, dbType) => {
.last() .last()
.invoke("show") .invoke("show")
.click(); .click();
cy.snipActiveModal("Modal_StopProject");
cy.contains("Submit").closest("button").click(); cy.contains("Submit").closest("button").click();
cy.toastWait("stopped successfully"); cy.toastWait("stopped successfully");
@ -33,6 +34,8 @@ export const genTest = (apiType, dbType) => {
.last() .last()
.invoke("show") .invoke("show")
.click(); .click();
cy.snipActiveModal("Modal_StartProject");
cy.contains("Submit").closest("button").click(); cy.contains("Submit").closest("button").click();
cy.toastWait("started successfully"); cy.toastWait("started successfully");
@ -41,11 +44,15 @@ export const genTest = (apiType, dbType) => {
it("Restart Project", () => { it("Restart Project", () => {
if (!isXcdb()) { if (!isXcdb()) {
//cy.visit('./#/projects') //cy.visit('./#/projects')
cy.get(`.nc-${apiType}-project-row .mdi-restart`, { timeout: 10000 }) cy.get(`.nc-${apiType}-project-row .mdi-restart`, {
timeout: 10000,
})
.should("exist") .should("exist")
.last() .last()
.invoke("show") .invoke("show")
.click(); .click();
cy.snipActiveModal("Modal_RestartProject");
cy.contains("Submit").closest("button").click(); cy.contains("Submit").closest("button").click();
cy.toastWait("restarted successfully"); cy.toastWait("restarted successfully");
@ -61,6 +68,8 @@ export const genTest = (apiType, dbType) => {
.last() .last()
.invoke("show") .invoke("show")
.click(); .click();
cy.snipActiveModal("Modal_DeleteProject");
cy.contains("Submit").closest("button").click(); cy.contains("Submit").closest("button").click();
cy.toastWait("deleted successfully"); cy.toastWait("deleted successfully");

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

@ -55,10 +55,13 @@ export const genTest = (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.snipActiveModal("Modal_BaseShare");
// Click on readonly base text // Click on readonly base text
cy.getActiveModal().find(".nc-disable-shared-base").click(); cy.getActiveModal().find(".nc-disable-shared-base").click();
// Select 'Readonly link' // Select 'Readonly link'
cy.snipActiveMenu("Menu_ShareLink");
cy.getActiveMenu() cy.getActiveMenu()
.find(".caption") .find(".caption")
.contains("Anyone with the link") .contains("Anyone with the link")
@ -104,7 +107,10 @@ style="background: transparent; "></iframe>
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");
@ -118,7 +124,9 @@ style="background: transparent; "></iframe>
// 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 // validation for base menu opitons
@ -133,7 +141,10 @@ style="background: transparent; "></iframe>
.getIFrameCell("FirstName", 1) .getIFrameCell("FirstName", 1)
.contains("PENELOPE") .contains("PENELOPE")
.should("exist"); .should("exist");
mainPage.getIFrameCell("LastName", 1).contains("GUINESS").should("exist"); mainPage
.getIFrameCell("LastName", 1)
.contains("GUINESS")
.should("exist");
}); });
}); });
}; };

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

@ -101,11 +101,14 @@ export const genTest = (apiType, dbType) => {
force: true, force: true,
}); });
cy.snipActiveModal("Modal_CreateFromExcel");
cy.get(".nc-excel-import-input").attachFile(filepath); cy.get(".nc-excel-import-input").attachFile(filepath);
cy.get(".nc-btn-use-template", { timeout: 120000 }).should("exist"); cy.get(".nc-btn-use-template", { timeout: 120000 }).should("exist");
}); });
it("File Upload: Verify pre-load template page", () => { it("File Upload: Verify pre-load template page", () => {
cy.snip("ExcelImport");
cy.getActiveContentModal() cy.getActiveContentModal()
.find(".v-expansion-panel") .find(".v-expansion-panel")
.then((sheets) => { .then((sheets) => {
@ -116,14 +119,18 @@ export const genTest = (apiType, dbType) => {
// expect(blk.text().trim()).to.equal(sheetList[i]) // expect(blk.text().trim()).to.equal(sheetList[i])
// }) // })
cy.wrap(sheets[i]).contains(sheetList[i]).should("exist"); cy.wrap(sheets[i])
.contains(sheetList[i])
.should("exist");
// for each sheet, expand to verify table names & their data types // for each sheet, expand to verify table names & their data types
cy.wrap(sheets[i]).find(".mdi-chevron-down").click(); cy.wrap(sheets[i]).find(".mdi-chevron-down").click();
// wait for 4 DOM rows to become visible, corresponding to 4 column names in excel // wait for 4 DOM rows to become visible, corresponding to 4 column names in excel
// change to avoid static wait // 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")
.should("have.length", 4);
cy.get(".v-data-table") cy.get(".v-data-table")
.find("tr:visible") .find("tr:visible")
@ -134,7 +141,9 @@ export const genTest = (apiType, dbType) => {
.find('[placeholder="Column name"]') .find('[placeholder="Column name"]')
.then((obj) => { .then((obj) => {
cy.log(obj[0].value); cy.log(obj[0].value);
expect(obj[0].value).to.equal(expectedData[j - 1][0]); expect(obj[0].value).to.equal(
expectedData[j - 1][0]
);
}); });
// datatype to match expected output // datatype to match expected output
@ -142,7 +151,9 @@ export const genTest = (apiType, dbType) => {
.find("span.caption") .find("span.caption")
.then((obj) => { .then((obj) => {
cy.log(obj[0].innerText); cy.log(obj[0].innerText);
expect(obj[0].innerText).to.equal(expectedData[j - 1][1]); expect(obj[0].innerText).to.equal(
expectedData[j - 1][1]
);
}); });
} }
}); });
@ -217,6 +228,7 @@ export const genTest = (apiType, dbType) => {
force: true, force: true,
}); });
cy.snipActiveModal("Modal_ImportExcelURL");
cy.getActiveModal().find(".caption").contains("URL").click(); cy.getActiveModal().find(".caption").contains("URL").click();
cy.get(".nc-excel-import-tab-item") cy.get(".nc-excel-import-tab-item")
.find('input[type="url"]') .find('input[type="url"]')
@ -250,14 +262,20 @@ export const genTest = (apiType, dbType) => {
.find("tr:visible") .find("tr:visible")
.then((row) => { .then((row) => {
// verification restricting to 10, as others need to be scrolled back into view // verification restricting to 10, as others need to be scrolled back into view
for (let j = 1; j <= 10 /*row.length*/; j++) { for (
let j = 1;
j <= 10 /*row.length*/;
j++
) {
// column name to match input in excel // column name to match input in excel
cy.wrap(row[j]) cy.wrap(row[j])
.find('[placeholder="Column name"]') .find('[placeholder="Column name"]')
.then((obj) => { .then((obj) => {
cy.log(obj[0].value); cy.log(obj[0].value);
expect(obj[0].value).to.equal( expect(obj[0].value).to.equal(
UrlFileExpectedData[j - 1][0] UrlFileExpectedData[
j - 1
][0]
); );
}); });
@ -266,8 +284,12 @@ export const genTest = (apiType, dbType) => {
.find("span.caption") .find("span.caption")
.then((obj) => { .then((obj) => {
cy.log(obj[0].innerText); cy.log(obj[0].innerText);
expect(obj[0].innerText).to.equal( expect(
UrlFileExpectedData[j - 1][1] obj[0].innerText
).to.equal(
UrlFileExpectedData[
j - 1
][1]
); );
}); });
} }

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