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 { isTestSuiteActive } from "../../support/page_objects/projectConstants"
let baseURL = ''
let storedURL = ''
let linkText = ''
const generateLinkWithPwd = () => {
@ -24,7 +24,7 @@ const generateLinkWithPwd = () => {
cy.getActiveModal().find('.share-link-box')
.then(($obj) => {
linkText = $obj.text()
linkText = $obj.text().trim()
cy.log(linkText)
})
}
@ -40,7 +40,7 @@ export const genTest = (type, xcdb) => {
cy.openTableTab('City')
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
baseURL = url
storedURL = url
})
generateLinkWithPwd()
@ -55,7 +55,9 @@ export const genTest = (type, xcdb) => {
})
it('Share view with incorrect password', () => {
cy.visit(linkText)
cy.visit(linkText, {
baseUrl: null
})
// wait for share view page to load!
cy.wait(1000)
// feed password
@ -69,7 +71,9 @@ export const genTest = (type, xcdb) => {
// fallover test- use previously opened view & continue verification instead of opening again
it('Share view with correct password', () => {
// cy.visit(linkText)
// cy.visit(linkText, {
// baseUrl: null
// })
// // wait for share view page to load!
// cy.wait(1000)
// feed password
@ -82,7 +86,9 @@ export const genTest = (type, xcdb) => {
})
it('Delete view', () => {
cy.visit(baseURL)
cy.visit(storedURL, {
baseUrl: null
})
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`, () => {
// visit URL
cy.log(formViewURL)
cy.visit(formViewURL)
cy.visit(formViewURL, {
baseUrl: null
})
// New form appeared? Header & description should exist
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 { mainPage } from "../../support/page_objects/mainPage"
let baseURL = ''
let storedURL = ''
export const genTest = (type, xcdb) => {
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
cy.url().then((url) => {
baseURL = url
storedURL = url
})
})
@ -79,9 +79,11 @@ export const genTest = (type, xcdb) => {
.contains('/nc/form/', {timeout: 10000})
.then(($obj) => {
let linkText = $obj.text()
let linkText = $obj.text().trim()
cy.log(linkText)
cy.visit(linkText)
cy.visit(linkText, {
baseUrl: null
})
// wait for share view page to load!
cy.wait(5000)
@ -137,7 +139,9 @@ export const genTest = (type, xcdb) => {
it(`Delete ${viewType} view`, () => {
// go back to base page
cy.visit(baseURL)
cy.visit(storedURL, {
baseUrl: null
})
// number of view entries should be 2 before we delete
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 { mainPage } from "../../support/page_objects/mainPage"
let baseURL = ''
let storedURL = ''
// 0: all enabled
// 1: field hide
@ -31,7 +31,7 @@ export const genTest = (type, xcdb) => {
.then(($obj) => {
cy.get('body').type('{esc}')
// viewURL.push($obj.text())
viewURL[viewName] = $obj.text()
viewURL[viewName] = $obj.text().trim()
cy.wait(1000)
})
}
@ -88,7 +88,7 @@ export const genTest = (type, xcdb) => {
// store base URL- to re-visit and delete form view later
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`, () => {
// visit public view
cy.visit(viewURL['combined'])
cy.visit(viewURL['combined'], {
baseUrl: null
})
// wait for public view page to load!
cy.wait(5000)
@ -374,7 +376,9 @@ export const genTest = (type, xcdb) => {
it(`Delete ${viewType.toUpperCase()} view`, () => {
// go back to base page
cy.visit(baseURL)
cy.visit(storedURL, {
baseUrl: null
})
// number of view entries should be 2 before we delete
cy.get('.nc-view-item').its('length').should('eq', 2)
@ -483,7 +487,7 @@ export const genTest = (type, xcdb) => {
cy.saveLocalStorage()
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
baseURL = url
storedURL = url
generateViewLink('rowColUpdate')
})
})
@ -491,7 +495,9 @@ export const genTest = (type, xcdb) => {
after(() => {
// close table
cy.restoreLocalStorage();
cy.visit(baseURL)
cy.visit(storedURL, {
baseUrl: null
})
// delete row
mainPage.getPagination(5).click()
@ -527,7 +533,9 @@ export const genTest = (type, xcdb) => {
// visit public view
cy.log(viewURL['rowColUpdate'])
cy.restoreLocalStorage();
cy.visit(viewURL['rowColUpdate']) //5
cy.visit(viewURL['rowColUpdate'], {
baseUrl: null
}) //5
// wait for public view page to load!
cy.wait(5000)
})

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

@ -45,7 +45,9 @@ export const genTest = (type, xcdb) => {
if (roleType != 'owner') {
it(`[${roles[roleType].name}] SignIn, Open project`, () => {
cy.log(mainPage.roleURL[roleType])
cy.visit(mainPage.roleURL[roleType])
cy.visit(mainPage.roleURL[roleType], {
baseUrl: null
})
cy.wait(3000)
// 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
Token = jsonPayload.AUTH_TOKEN
cy.visit(URL).then(() => {
cy.visit(URL, {
baseUrl: null
}).then(() => {
// wait to allow time for SWAGGER Library loading to finish
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()
cy.log(linkText)
cy.visit(linkText)
cy.visit(linkText, {
baseUrl: null
})
// wait for share view page to load!
cy.wait(5000)

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

@ -41,7 +41,7 @@ export const genTest = (type, xcdb) => {
.find('.nc-url')
.then(($obj) => {
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)
// visit URL & wait for page load to complete
cy.visit(linkText)
cy.visit(linkText, {
baseUrl: null
})
projectsPage.waitHomePageLoad()
})

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

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

Loading…
Cancel
Save