Browse Source

test: cypress test correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2482/head
Pranav C 2 years ago
parent
commit
4867f9d6e5
  1. 4
      scripts/cypress/integration/common/1a_table_operations.js
  2. 4
      scripts/cypress/integration/common/1c_sql_view.js
  3. 2
      scripts/cypress/integration/common/1d_pg_table_view_drag_drop_reorder.js
  4. 2
      scripts/cypress/integration/common/1d_table_view_drag_drop_reorder.js
  5. 4
      scripts/cypress/integration/common/4e_form_view_share.js
  6. 30
      scripts/cypress/integration/common/4f_grid_view_share.js
  7. 28
      scripts/cypress/integration/common/4f_pg_grid_view_share.js
  8. 2
      scripts/cypress/integration/common/5a_user_role.js
  9. 2
      scripts/cypress/integration/common/6b_downloadCsv.js
  10. 2
      scripts/cypress/integration/spec/roleValidation.spec.js

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

@ -80,9 +80,9 @@ export const genTest = (apiType, dbType) => {
// 4a. Address table, has many field
cy.openTableTab("Address", 25);
mainPage.getCell("CityRead", 1).scrollIntoView();
mainPage.getCell("City", 1).scrollIntoView();
mainPage
.getCell("CityRead", 1)
.getCell("City", 1)
.find(".name")
.contains("Lethbridge")
.should("exist");

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

@ -139,8 +139,8 @@ export const genTest = (apiType, dbType) => {
cy.openViewsTab("CustomerList", 25);
cy.closeViewsTab("CustomerList");
cy.openViewsTab("Film List", 25);
cy.closeViewsTab("Film List");
cy.openViewsTab("FilmList", 25);
cy.closeViewsTab("FilmList");
cy.openViewsTab("SalesByFilmCategory", 16);
cy.closeViewsTab("SalesByFilmCategory");

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

@ -23,7 +23,7 @@ export const genTest = (apiType, dbType) => {
/*
Original order of list items
Actor, Address, Category, City, Country, Customer, FIlm, FilmText, Language, Payment, Rental Staff
ActorInfo, CustomerList, FilmList, NiceButSlowerFilmList, SalesByFilmCategory, SalesByStore, StaffList
ActorInfo, Customer List, Film List, NiceButSlowerFilm List, SalesByFilmCategory, SalesByStore, Staff List
*/
it(`Table & SQL View list, Drag/drop`, () => {

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

@ -18,7 +18,7 @@ export const genTest = (apiType, dbType) => {
/*
Original order of list items
Actor, Address, Category, City, Country, Customer, FIlm, FilmText, Language, Payment, Rental Staff
ActorInfo, CustomerList, FilmList, NiceButSlowerFilmList, SalesByFilmCategory, SalesByStore, StaffList
ActorInfo, Customer List, Film List, NiceButSlowerFilm List, SalesByFilmCategory, SalesByStore, Staff List
*/
before(() => {

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

@ -72,7 +72,7 @@ export const genTest = (apiType, dbType) => {
// "#data-table-form-City"
// );
cy.get('[title="AddressList"]').drag(".nc-drag-n-drop-to-hide");
cy.get('[title="Address List"]').drag(".nc-drag-n-drop-to-hide");
cy.get(".nc-form > .mx-auto")
.find('[type="checkbox"]')
@ -132,7 +132,7 @@ export const genTest = (apiType, dbType) => {
cy.get('[title="City"]').should("exist");
cy.get('[title="LastUpdate"]').should("exist");
cy.get('[title="Country"]').should("exist");
cy.get('[title="AddressList"]').should("not.exist");
cy.get('[title="Address List"]').should("not.exist");
// order of LastUpdate & City field is retained
cy.get(".nc-field-wrapper")

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

@ -170,7 +170,7 @@ export const genTest = (apiType, dbType) => {
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`Address,District,PostalCode,Phone,Location,CustomerList,StaffList,CityRead,StaffList`,
`Address,District,PostalCode,Phone,Location,Customer List,Staff List,City,Staff List`,
`1013 Tabuk Boulevard,West Bengali,96203,158399646978,[object Object],2,,Kanchrapara,`,
`1892 Nabereznyje Telny Lane,Tutuila,28396,478229987054,[object Object],2,,Tafuna,`,
`1993 Tabuk Lane,Tamil Nadu,64221,648482415405,[object Object],2,,Tambaram,`,
@ -231,7 +231,7 @@ export const genTest = (apiType, dbType) => {
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`Address,District,PostalCode,Phone,Location,CustomerList,StaffList,CityRead,StaffList`,
`Address,District,PostalCode,Phone,Location,CustomerList,Staff List,City,Staff List`,
`1993 Tabuk Lane,Tamil Nadu,64221,648482415405,[object Object],2,,Tambaram,`,
`1661 Abha Drive,Tamil Nadu,14400,270456873752,[object Object],1,,Pudukkottai,`,
];
@ -267,24 +267,24 @@ export const genTest = (apiType, dbType) => {
it(`Share GRID view : Virtual column validation > has many`, () => {
// verify column headers
cy.get('[data-col="CustomerList"]').should("exist");
cy.get('[data-col="StaffList"]').should("exist");
cy.get('[data-col="CityRead"]').should("exist");
cy.get('[data-col="StaffList"]').should("exist");
cy.get('[data-col="Customer List"]').should("exist");
cy.get('[data-col="Staff List"]').should("exist");
cy.get('[data-col="City"]').should("exist");
cy.get('[data-col="Staff List"]').should("exist");
// has many field validation
mainPage
.getCell("CustomerList", 3)
.getCell("Customer List", 3)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("CustomerList", 3)
.getCell("Customer List", 3)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("CustomerList", 3)
.getCell("Customer List", 3)
.click()
.find("button.mdi-arrow-expand")
.click();
@ -308,17 +308,17 @@ export const genTest = (apiType, dbType) => {
it(`Share GRID view : Virtual column validation > belongs to`, () => {
// belongs to field validation
mainPage
.getCell("CityRead", 1)
.getCell("City", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("CityRead", 1)
.getCell("City", 1)
.click()
.find("button.mdi-arrow-expand")
.should("not.exist");
mainPage
.getCell("CityRead", 1)
.getCell("City", 1)
.find(".v-chip")
.contains("Kanchrapara")
.should("exist");
@ -327,17 +327,17 @@ export const genTest = (apiType, dbType) => {
it(`Share GRID view : Virtual column validation > many to many`, () => {
// many-to-many field validation
mainPage
.getCell("StaffList", 1)
.getCell("Staff List", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("StaffList", 1)
.getCell("Staff List", 1)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("StaffList", 1)
.getCell("Staff List", 1)
.click()
.find("button.mdi-arrow-expand")
.click();

28
scripts/cypress/integration/common/4f_pg_grid_view_share.js

@ -228,7 +228,7 @@ export const genTest = (apiType, dbType) => {
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`Address,District,PostalCode,Phone,Location,CustomerList,StaffList,CityRead,StaffList`,
`Address,District,PostalCode,Phone,Location,Customer List,Staff List,City,Staff List`,
`1888 Kabul Drive,,20936,,1,,Ife,,`,
`1661 Abha Drive,,14400,,1,,Pudukkottai,,`,
];
@ -262,24 +262,24 @@ export const genTest = (apiType, dbType) => {
it(`Share GRID view : Virtual column validation > has many`, () => {
// verify column headers
cy.get('[data-col="CustomerList"]').should("exist");
cy.get('[data-col="StaffList"]').should("exist");
cy.get('[data-col="CityRead"]').should("exist");
cy.get('[data-col="StaffList"]').should("exist");
cy.get('[data-col="Customer List"]').should("exist");
cy.get('[data-col="Staff List"]').should("exist");
cy.get('[data-col="City"]').should("exist");
cy.get('[data-col="Staff List"]').should("exist");
// has many field validation
mainPage
.getCell("CustomerList", 3)
.getCell("Customer List", 3)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("CustomerList", 3)
.getCell("Customer List", 3)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("CustomerList", 3)
.getCell("Customer List", 3)
.click()
.find("button.mdi-arrow-expand")
.click();
@ -303,17 +303,17 @@ export const genTest = (apiType, dbType) => {
it(`Share GRID view : Virtual column validation > belongs to`, () => {
// belongs to field validation
mainPage
.getCell("CityRead", 1)
.getCell("City", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("CityRead", 1)
.getCell("City", 1)
.click()
.find("button.mdi-arrow-expand")
.should("not.exist");
mainPage
.getCell("CityRead", 1)
.getCell("City", 1)
.find(".v-chip")
.contains("al-Ayn")
.should("exist");
@ -322,17 +322,17 @@ export const genTest = (apiType, dbType) => {
it(`Share GRID view : Virtual column validation > many to many`, () => {
// many-to-many field validation
mainPage
.getCell("StaffList", 1)
.getCell("Staff List", 1)
.click()
.find("button.mdi-close-thick")
.should("not.exist");
mainPage
.getCell("StaffList", 1)
.getCell("Staff List", 1)
.click()
.find("button.mdi-plus")
.should("not.exist");
mainPage
.getCell("StaffList", 1)
.getCell("Staff List", 1)
.click()
.find("button.mdi-arrow-expand")
.click();

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

@ -209,7 +209,7 @@ export const genTest = (apiType, dbType) => {
const verifyCsv = (retrievedRecords) => {
// expected output, statically configured
let storedRecords = [
`City,AddressList,Country`,
`City,Address List,Country`,
`A Corua (La Corua),939 Probolinggo Loop,Spain`,
`Abha,733 Mandaluyong Place,Saudi Arabia`,
`Abu Dhabi,535 Ahmadnagar Manor,United Arab Emirates`,

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

@ -31,7 +31,7 @@ export const genTest = (apiType, dbType) => {
// `Angola,"Benguela, Namibe"`,
// ];
let storedRecords = [
['Country','City List'],
['Country','CityList'],
['Afghanistan','Kabul'],
['Algeria','Skikda', 'Bchar', 'Batna'],
['American Samoa','Tafuna'],

2
scripts/cypress/integration/spec/roleValidation.spec.js

@ -236,7 +236,7 @@ export function _viewMenu(roleType, previewMode, navDrawListCnt) {
// Download CSV / Upload CSV / Shared View List / Webhook
actionsMenuItemsCnt = 4;
} else if (roleType == "editor") {
// Download CSV / Upload CSV
// Download CSV / Upload CSV
actionsMenuItemsCnt = 2;
}

Loading…
Cancel
Save