Browse Source

test(cypress): URL path trim & baseUrl configured as NULL for full URL access

Signed-off-by: Raju Udava <sivadstala@gmail.com>
pull/765/head
Raju Udava 3 years ago
parent
commit
982d8a352b
  1. 18
      scripts/cypress/integration/common/4b_table_view_share.js
  2. 4
      scripts/cypress/integration/common/4c_form_view_detailed.js
  3. 14
      scripts/cypress/integration/common/4e_form_view_share.js
  4. 24
      scripts/cypress/integration/common/4f_grid_view_share.js
  5. 4
      scripts/cypress/integration/common/5a_user_role.js
  6. 4
      scripts/cypress/integration/common/6c_swagger_api.js
  7. 4
      scripts/cypress/integration/common/6f_attachments.js
  8. 6
      scripts/cypress/integration/common/6g_base_share.js
  9. 2
      scripts/cypress/support/page_objects/mainPage.js

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

@ -2,7 +2,7 @@ import { mainPage } from "../../support/page_objects/mainPage"
import { loginPage } from "../../support/page_objects/navigation" import { loginPage } from "../../support/page_objects/navigation"
import { isTestSuiteActive } from "../../support/page_objects/projectConstants" import { isTestSuiteActive } from "../../support/page_objects/projectConstants"
let baseURL = '' let storedURL = ''
let linkText = '' let linkText = ''
const generateLinkWithPwd = () => { const generateLinkWithPwd = () => {
@ -24,7 +24,7 @@ const generateLinkWithPwd = () => {
cy.getActiveModal().find('.share-link-box') cy.getActiveModal().find('.share-link-box')
.then(($obj) => { .then(($obj) => {
linkText = $obj.text() linkText = $obj.text().trim()
cy.log(linkText) cy.log(linkText)
}) })
} }
@ -40,7 +40,7 @@ export const genTest = (type, xcdb) => {
cy.openTableTab('City') cy.openTableTab('City')
// store base URL- to re-visit and delete form view later // store base URL- to re-visit and delete form view later
cy.url().then((url) => { cy.url().then((url) => {
baseURL = url storedURL = url
}) })
generateLinkWithPwd() generateLinkWithPwd()
@ -55,7 +55,9 @@ export const genTest = (type, xcdb) => {
}) })
it('Share view with incorrect password', () => { it('Share view with incorrect password', () => {
cy.visit(linkText) cy.visit(linkText, {
baseUrl: null
})
// wait for share view page to load! // wait for share view page to load!
cy.wait(1000) cy.wait(1000)
// feed password // feed password
@ -69,7 +71,9 @@ export const genTest = (type, xcdb) => {
// fallover test- use previously opened view & continue verification instead of opening again // fallover test- use previously opened view & continue verification instead of opening again
it('Share view with correct password', () => { it('Share view with correct password', () => {
// cy.visit(linkText) // cy.visit(linkText, {
// baseUrl: null
// })
// // wait for share view page to load! // // wait for share view page to load!
// cy.wait(1000) // cy.wait(1000)
// feed password // feed password
@ -82,7 +86,9 @@ export const genTest = (type, xcdb) => {
}) })
it('Delete view', () => { it('Delete view', () => {
cy.visit(baseURL) cy.visit(storedURL, {
baseUrl: null
})
mainPage.deleteCreatedViews() mainPage.deleteCreatedViews()
}) })

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

@ -281,7 +281,9 @@ export const genTest = (type, xcdb) => {
it(`Validate ${viewType}: URL validation after re-access`, () => { it(`Validate ${viewType}: URL validation after re-access`, () => {
// visit URL // visit URL
cy.log(formViewURL) cy.log(formViewURL)
cy.visit(formViewURL) cy.visit(formViewURL, {
baseUrl: null
})
// 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 })

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

@ -2,7 +2,7 @@ import { loginPage } from "../../support/page_objects/navigation"
import { isTestSuiteActive } from "../../support/page_objects/projectConstants" import { isTestSuiteActive } from "../../support/page_objects/projectConstants"
import { mainPage } from "../../support/page_objects/mainPage" import { mainPage } from "../../support/page_objects/mainPage"
let baseURL = '' let storedURL = ''
export const genTest = (type, xcdb) => { export const genTest = (type, xcdb) => {
if(!isTestSuiteActive(type, xcdb)) return; if(!isTestSuiteActive(type, xcdb)) return;
@ -63,7 +63,7 @@ export const genTest = (type, xcdb) => {
// store base URL- to re-visit and delete form view later // store base URL- to re-visit and delete form view later
cy.url().then((url) => { cy.url().then((url) => {
baseURL = url storedURL = url
}) })
}) })
@ -79,9 +79,11 @@ export const genTest = (type, xcdb) => {
.contains('/nc/form/', {timeout: 10000}) .contains('/nc/form/', {timeout: 10000})
.then(($obj) => { .then(($obj) => {
let linkText = $obj.text() let linkText = $obj.text().trim()
cy.log(linkText) cy.log(linkText)
cy.visit(linkText) cy.visit(linkText, {
baseUrl: null
})
// wait for share view page to load! // wait for share view page to load!
cy.wait(5000) cy.wait(5000)
@ -137,7 +139,9 @@ export const genTest = (type, xcdb) => {
it(`Delete ${viewType} view`, () => { it(`Delete ${viewType} view`, () => {
// go back to base page // go back to base page
cy.visit(baseURL) cy.visit(storedURL, {
baseUrl: null
})
// number of view entries should be 2 before we delete // number of view entries should be 2 before we delete
cy.get('.nc-view-item').its('length').should('eq', 2) cy.get('.nc-view-item').its('length').should('eq', 2)

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

@ -2,7 +2,7 @@ import { loginPage } from "../../support/page_objects/navigation"
import { isTestSuiteActive } from "../../support/page_objects/projectConstants" import { isTestSuiteActive } from "../../support/page_objects/projectConstants"
import { mainPage } from "../../support/page_objects/mainPage" import { mainPage } from "../../support/page_objects/mainPage"
let baseURL = '' let storedURL = ''
// 0: all enabled // 0: all enabled
// 1: field hide // 1: field hide
@ -31,7 +31,7 @@ export const genTest = (type, xcdb) => {
.then(($obj) => { .then(($obj) => {
cy.get('body').type('{esc}') cy.get('body').type('{esc}')
// viewURL.push($obj.text()) // viewURL.push($obj.text())
viewURL[viewName] = $obj.text() viewURL[viewName] = $obj.text().trim()
cy.wait(1000) cy.wait(1000)
}) })
} }
@ -88,7 +88,7 @@ export const genTest = (type, xcdb) => {
// store base URL- to re-visit and delete form view later // store base URL- to re-visit and delete form view later
cy.url().then((url) => { cy.url().then((url) => {
baseURL = url storedURL = url
}) })
}) })
@ -127,7 +127,9 @@ export const genTest = (type, xcdb) => {
it(`Share ${viewType.toUpperCase()} view : Visit URL, Verify title`, () => { it(`Share ${viewType.toUpperCase()} view : Visit URL, Verify title`, () => {
// visit public view // visit public view
cy.visit(viewURL['combined']) cy.visit(viewURL['combined'], {
baseUrl: null
})
// wait for public view page to load! // wait for public view page to load!
cy.wait(5000) cy.wait(5000)
@ -374,7 +376,9 @@ export const genTest = (type, xcdb) => {
it(`Delete ${viewType.toUpperCase()} view`, () => { it(`Delete ${viewType.toUpperCase()} view`, () => {
// go back to base page // go back to base page
cy.visit(baseURL) cy.visit(storedURL, {
baseUrl: null
})
// number of view entries should be 2 before we delete // number of view entries should be 2 before we delete
cy.get('.nc-view-item').its('length').should('eq', 2) cy.get('.nc-view-item').its('length').should('eq', 2)
@ -483,7 +487,7 @@ export const genTest = (type, xcdb) => {
cy.saveLocalStorage() cy.saveLocalStorage()
// store base URL- to re-visit and delete form view later // store base URL- to re-visit and delete form view later
cy.url().then((url) => { cy.url().then((url) => {
baseURL = url storedURL = url
generateViewLink('rowColUpdate') generateViewLink('rowColUpdate')
}) })
}) })
@ -491,7 +495,9 @@ export const genTest = (type, xcdb) => {
after(() => { after(() => {
// close table // close table
cy.restoreLocalStorage(); cy.restoreLocalStorage();
cy.visit(baseURL) cy.visit(storedURL, {
baseUrl: null
})
// delete row // delete row
mainPage.getPagination(5).click() mainPage.getPagination(5).click()
@ -527,7 +533,9 @@ export const genTest = (type, xcdb) => {
// visit public view // visit public view
cy.log(viewURL['rowColUpdate']) cy.log(viewURL['rowColUpdate'])
cy.restoreLocalStorage(); cy.restoreLocalStorage();
cy.visit(viewURL['rowColUpdate']) //5 cy.visit(viewURL['rowColUpdate'], {
baseUrl: null
}) //5
// wait for public view page to load! // wait for public view page to load!
cy.wait(5000) cy.wait(5000)
}) })

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

@ -45,7 +45,9 @@ export const genTest = (type, xcdb) => {
if (roleType != 'owner') { if (roleType != 'owner') {
it(`[${roles[roleType].name}] SignIn, Open project`, () => { it(`[${roles[roleType].name}] SignIn, Open project`, () => {
cy.log(mainPage.roleURL[roleType]) cy.log(mainPage.roleURL[roleType])
cy.visit(mainPage.roleURL[roleType]) cy.visit(mainPage.roleURL[roleType], {
baseUrl: null
})
cy.wait(3000) cy.wait(3000)
// Redirected to new URL, feed details // Redirected to new URL, feed details

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

@ -57,7 +57,9 @@ export const genTest = (type, xcdb) => {
let URL = jsonPayload.SWAGGER_URL let URL = jsonPayload.SWAGGER_URL
Token = jsonPayload.AUTH_TOKEN Token = jsonPayload.AUTH_TOKEN
cy.visit(URL).then(() => { cy.visit(URL, {
baseUrl: null
}).then(() => {
// wait to allow time for SWAGGER Library loading to finish // wait to allow time for SWAGGER Library loading to finish
cy.wait(5000) cy.wait(5000)

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

@ -54,7 +54,9 @@ export const genTest = (type, xcdb) => {
let linkText = $obj.text().trim() let linkText = $obj.text().trim()
cy.log(linkText) cy.log(linkText)
cy.visit(linkText) cy.visit(linkText, {
baseUrl: null
})
// wait for share view page to load! // wait for share view page to load!
cy.wait(5000) cy.wait(5000)

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

@ -41,7 +41,7 @@ export const genTest = (type, xcdb) => {
.find('.nc-url') .find('.nc-url')
.then(($obj) => { .then(($obj) => {
cy.log($obj[0]) cy.log($obj[0])
linkText = $obj[0].innerText linkText = $obj[0].innerText.trim()
}) })
}) })
@ -49,7 +49,9 @@ export const genTest = (type, xcdb) => {
cy.log(linkText) cy.log(linkText)
// visit URL & wait for page load to complete // visit URL & wait for page load to complete
cy.visit(linkText) cy.visit(linkText, {
baseUrl: null
})
projectsPage.waitHomePageLoad() projectsPage.waitHomePageLoad()
}) })

2
scripts/cypress/support/page_objects/mainPage.js

@ -99,7 +99,7 @@ export class _mainPage {
// get URL, invoke // get URL, invoke
cy.getActiveModal().find('.v-alert').then(($obj) => { cy.getActiveModal().find('.v-alert').then(($obj) => {
linkText = $obj.text() linkText = $obj.text().trim()
cy.log(linkText) cy.log(linkText)
this.roleURL[roleType] = linkText this.roleURL[roleType] = linkText

Loading…
Cancel
Save