Template Testing Refactor
Directly visiting the templates URL
This commit is contained in:
parent
07d6c5c2d9
commit
d44ac03d38
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter HR Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -8,13 +8,13 @@ filterTests(["all"], () => {
|
|||
before(() => {
|
||||
cy.login()
|
||||
cy.deleteApp(templateName)
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder`, {
|
||||
// Template navigation
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`, {
|
||||
onBeforeLoad(win) {
|
||||
cy.stub(win, 'open')
|
||||
}
|
||||
})
|
||||
cy.wait(2000)
|
||||
cy.templateNavigation()
|
||||
})
|
||||
|
||||
it("should create and publish app with Job Application Tracker template", () => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter IT Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -8,13 +8,13 @@ filterTests(["all"], () => {
|
|||
before(() => {
|
||||
cy.login()
|
||||
cy.deleteApp(templateName)
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder`, {
|
||||
// Template navigation
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`, {
|
||||
onBeforeLoad(win) {
|
||||
cy.stub(win, 'open')
|
||||
}
|
||||
})
|
||||
cy.wait(2000)
|
||||
cy.templateNavigation()
|
||||
})
|
||||
|
||||
it("should create and publish app with IT Ticketing System template", () => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Admin Panels Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Approval Apps Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Business Apps Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Directories Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Forms Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Healthcare Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Legal Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Logistics Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Manufacturing Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Marketing Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Operations Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -7,21 +7,15 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Portal Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
cy.get('[data-cy="Portal"]').click()
|
||||
})
|
||||
})
|
||||
|
||||
it("should verify the details option for Portal templates", () => {
|
||||
// Filter Portal Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
cy.get('[data-cy="Portal"]').click()
|
||||
})
|
||||
|
||||
cy.get(".template-grid").find(".template-card").its('length')
|
||||
.then(len => {
|
||||
for (let i = 0; i < len; i++) {
|
||||
|
|
|
@ -7,13 +7,7 @@ filterTests(["all"], () => {
|
|||
cy.login()
|
||||
|
||||
// Template navigation
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({force: true})
|
||||
}
|
||||
})
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`)
|
||||
|
||||
// Filter Professional Services Templates
|
||||
cy.get(".template-category-filters").within(() => {
|
||||
|
|
|
@ -671,15 +671,3 @@ Cypress.Commands.add("createRestQuery", (method, restUrl, queryPrettyName) => {
|
|||
.should("contain", method)
|
||||
.and("contain", queryPrettyName)
|
||||
})
|
||||
|
||||
Cypress.Commands.add("templateNavigation", () => {
|
||||
// Navigates to templates section
|
||||
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
|
||||
.its("body")
|
||||
.then(val => {
|
||||
// Templates button needs clicked if apps already exist
|
||||
if (val.length > 0) {
|
||||
cy.get(".spectrum-Button").contains("Templates").click({ force: true })
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue