|
|
@ -9,7 +9,7 @@ export const genTest = (type, xcdb) => { |
|
|
|
|
|
|
|
|
|
|
|
describe(`Swagger API - Test preparation`, () => { |
|
|
|
describe(`Swagger API - Test preparation`, () => { |
|
|
|
before(()=> { |
|
|
|
before(()=> { |
|
|
|
loginPage.loginAndOpenProject('rest', false) |
|
|
|
loginPage.loginAndOpenProject(type, false) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
it("[REST] open project & record swagger URL, AuthToken", () => { |
|
|
|
it("[REST] open project & record swagger URL, AuthToken", () => { |
|
|
@ -17,10 +17,16 @@ export const genTest = (type, xcdb) => { |
|
|
|
cy.url().then( (url) => { |
|
|
|
cy.url().then( (url) => { |
|
|
|
// retrieve project name from URL & use it to construct Swagger URL
|
|
|
|
// retrieve project name from URL & use it to construct Swagger URL
|
|
|
|
// URL on homepage: http://localhost:3000/#/nc/externalrest_weUO?type=roles&dbalias=&name=Team%20%26%20Auth%20
|
|
|
|
// URL on homepage: http://localhost:3000/#/nc/externalrest_weUO?type=roles&dbalias=&name=Team%20%26%20Auth%20
|
|
|
|
// Swagger URL: http://localhost:8080/nc/externalrest_weUO/db/swagger
|
|
|
|
// [REST] Swagger URL: http://localhost:8080/nc/externalrest_weUO/db/swagger
|
|
|
|
//
|
|
|
|
// [GQL] http://localhost:8080/nc/externalgql_dgwx/v1/graphql
|
|
|
|
const projectName = url.split("/")[5].split("?")[0]; |
|
|
|
const projectName = url.split("/")[5].split("?")[0]; |
|
|
|
let swaggerURL = `http://localhost:8080/nc/${projectName}/db/swagger` |
|
|
|
let swaggerURL = `` |
|
|
|
|
|
|
|
if ('rest' == type) { |
|
|
|
|
|
|
|
swaggerURL = `http://localhost:8080/nc/${projectName}/db/swagger` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
swaggerURL = `http://localhost:8080/nc/${projectName}/v1/graphql` |
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// exchange information between two tests using a file
|
|
|
|
// exchange information between two tests using a file
|
|
|
|
// https://stackoverflow.com/questions/52050657/what-is-the-best-practice-of-pass-states-between-tests-in-cypress
|
|
|
|
// https://stackoverflow.com/questions/52050657/what-is-the-best-practice-of-pass-states-between-tests-in-cypress
|
|
|
@ -30,6 +36,8 @@ export const genTest = (type, xcdb) => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ('rest' == type) { |
|
|
|
|
|
|
|
|
|
|
|
describe(`Swagger page, base verification`, () => { |
|
|
|
describe(`Swagger page, base verification`, () => { |
|
|
|
|
|
|
|
|
|
|
|
// returns swagger button intended for
|
|
|
|
// returns swagger button intended for
|
|
|
@ -167,6 +175,7 @@ export const genTest = (type, xcdb) => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// genTest('rest', false)
|
|
|
|
// genTest('rest', false)
|
|
|
|