Changing test structure when searching for applications
Search functionality is not available when only 1 app exists - Updating to reflect this
This commit is contained in:
parent
9ffd278d80
commit
db0b6f8441
|
@ -79,7 +79,8 @@ filterTests(['all'], () => {
|
|||
const appName = "Cypress Tests"
|
||||
const numberName = 12345
|
||||
const specialCharName = "£$%^"
|
||||
cy.get(".home-logo").click()
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||
cy.wait(500)
|
||||
renameApp(appName, numberName)
|
||||
cy.reload()
|
||||
cy.wait(1000)
|
||||
|
@ -95,12 +96,7 @@ filterTests(['all'], () => {
|
|||
})
|
||||
|
||||
const renameApp = (originalName, changedName, published, noName) => {
|
||||
cy.wait(2000)
|
||||
cy.searchForApplication(originalName)
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".appTable")
|
||||
.within(() => {
|
||||
cy.get(".spectrum-Icon").eq(1).click()
|
||||
|
@ -129,7 +125,4 @@ filterTests(['all'], () => {
|
|||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -344,6 +344,15 @@ Cypress.Commands.add("addCustomSourceOptions", totalOptions => {
|
|||
Cypress.Commands.add("searchForApplication", appName => {
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||
cy.wait(2000)
|
||||
|
||||
// No app filter functionality if only 1 app exists
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length < 2) {
|
||||
return
|
||||
}
|
||||
else {
|
||||
// Searches for the app
|
||||
cy.get(".filter").then(() => {
|
||||
cy.get(".spectrum-Textfield").within(() => {
|
||||
|
@ -351,6 +360,8 @@ Cypress.Commands.add("searchForApplication", appName => {
|
|||
cy.get("input").eq(0).type(appName)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
//Assumes there are no others
|
||||
|
|
Loading…
Reference in New Issue