Browse Source

(test) Cypress: custom command for close table tab

Signed-off-by: Raju Udava <sivadstala@gmail.com>
pull/769/head
Raju Udava 3 years ago
parent
commit
e9d707248a
  1. 2
      scripts/cypress/integration/common/2b_table_with_m2m_column.js
  2. 2
      scripts/cypress/integration/common/3a_filter_sort_fields_operations.js
  3. 2
      scripts/cypress/integration/common/3b_formula_column.js
  4. 2
      scripts/cypress/integration/common/3c_lookup_column.js
  5. 2
      scripts/cypress/integration/common/3d_rollup_column.js
  6. 2
      scripts/cypress/integration/common/4a_table_view_grid_gallery_form.js
  7. 2
      scripts/cypress/integration/common/4b_table_view_share.js
  8. 2
      scripts/cypress/integration/common/4c_form_view_detailed.js
  9. 2
      scripts/cypress/integration/common/4d_table_view_grid_locked.js
  10. 2
      scripts/cypress/integration/common/4e_form_view_share.js
  11. 6
      scripts/cypress/integration/common/4f_grid_view_share.js
  12. 2
      scripts/cypress/integration/common/5b_preview_role.js
  13. 2
      scripts/cypress/integration/common/6b_downloadCsv.js
  14. 2
      scripts/cypress/integration/common/6f_attachments.js
  15. 4
      scripts/cypress/support/commands.js

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

@ -12,7 +12,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||Actor"]').find('button.mdi-close').click() cy.closeTableTab('Actor')
}) })
it('Table column header, URL validation', () => { it('Table column header, URL validation', () => {

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

@ -17,7 +17,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country')
}) })
describe(`Pagination`, () => { describe(`Pagination`, () => {

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

@ -18,7 +18,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||City"]').find('button.mdi-close').click() cy.closeTableTab('City')
}) })
// Given rowname & expected result for first 10 entries, validate // Given rowname & expected result for first 10 entries, validate

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

@ -27,7 +27,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||City"]').find('button.mdi-close').click() cy.closeTableTab('City')
}) })
// Routine to create a new look up column // Routine to create a new look up column

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

@ -26,7 +26,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country');
}) })
// Routine to create a new look up column // Routine to create a new look up column

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

@ -19,7 +19,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country')
}) })
// Common routine to create/edit/delete GRID & GALLERY view // Common routine to create/edit/delete GRID & GALLERY view

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

@ -87,7 +87,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||City"]').find('button.mdi-close').click() cy.closeTableTab('City')
}) })
}) })
} }

2
scripts/cypress/integration/common/4c_form_view_detailed.js

@ -30,7 +30,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country')
}) })
// Common routine to create/edit/delete GRID & GALLERY view // Common routine to create/edit/delete GRID & GALLERY view

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

@ -17,7 +17,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country')
}) })
const lockViewTest = (enabled) => { const lockViewTest = (enabled) => {

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

@ -30,7 +30,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||City"]').find('button.mdi-close').click() cy.closeTableTab('City')
}) })

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

@ -57,7 +57,7 @@ export const genTest = (type, xcdb) => {
after(() => { after(() => {
// close table // close table
// mainPage.deleteCreatedViews() // mainPage.deleteCreatedViews()
cy.get('[href="#table||db||Address"]').find('button.mdi-close').click() cy.closeTableTab('Address')
}) })
// Common routine to create/edit/delete GRID & GALLERY view // Common routine to create/edit/delete GRID & GALLERY view
@ -426,7 +426,7 @@ export const genTest = (type, xcdb) => {
// // close table // // close table
// cy.visit(baseURL) // cy.visit(baseURL)
// mainPage.deleteCreatedViews() // mainPage.deleteCreatedViews()
// cy.get('[href="#table||db||Address"]').find('button.mdi-close').click() // cy.closeTableTab('Address')
// }) // })
// it(`Generate default Shared GRID view URL`, () => { // it(`Generate default Shared GRID view URL`, () => {
@ -510,7 +510,7 @@ export const genTest = (type, xcdb) => {
mainPage.deleteCreatedViews() mainPage.deleteCreatedViews()
// close table // close table
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country')
}) })
it(`Generate default Shared GRID view URL`, () => { it(`Generate default Shared GRID view URL`, () => {

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

@ -261,7 +261,7 @@ export const genTest = (type, xcdb, roleType) => {
cy.wait(3000) cy.wait(3000)
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').should('not.exist') mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').should('not.exist')
cy.get('[href="#table||db||City"]').find('button.mdi-close').click() cy.closeTableTab('City')
}) })
const genTestSub = (roleType) => { const genTestSub = (roleType) => {

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

@ -13,7 +13,7 @@ export const genTest = (type, xcdb) => {
}) })
after(() => { after(() => {
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country')
}) })
it('Download verification- base view, default columns', () => { it('Download verification- base view, default columns', () => {

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

@ -24,7 +24,7 @@ export const genTest = (type, xcdb) => {
mainPage.getCell("Country", 10).rightclick() mainPage.getCell("Country", 10).rightclick()
cy.getActiveMenu().contains('Delete Selected Row').click() cy.getActiveMenu().contains('Delete Selected Row').click()
cy.get('[href="#table||db||Country"]').find('button.mdi-close').click() cy.closeTableTab('Country')
}) })
it(`Add column of type attachments`, () => { it(`Add column of type attachments`, () => {

4
scripts/cypress/support/commands.js

@ -124,6 +124,10 @@ Cypress.Commands.add('openTableTab', (tn) => {
cy.wait(500) cy.wait(500)
}) })
Cypress.Commands.add('closeTableTab', (tn) => {
cy.get(`[href="#table||db||${tn}"]`).find('button.mdi-close').click()
})
Cypress.Commands.add('openOrCreateGqlProject', (_args) => { Cypress.Commands.add('openOrCreateGqlProject', (_args) => {
const args = Object.assign({new: false, meta: false}, _args) const args = Object.assign({new: false, meta: false}, _args)

Loading…
Cancel
Save