mirror of https://github.com/Budibase/budibase.git
committed by
GitHub
21 changed files with 218 additions and 1353 deletions
@ -1,44 +0,0 @@ |
|||
import filterTests from "../support/filterTests" |
|||
|
|||
filterTests(['all'], () => { |
|||
context("Change Application Icon and Colour", () => { |
|||
before(() => { |
|||
cy.login() |
|||
}) |
|||
|
|||
it("should change the icon and colour for an application", () => { |
|||
// Search for test application
|
|||
cy.applicationInAppTable("Cypress Tests") |
|||
cy.get(".appTable") |
|||
.within(() => { |
|||
cy.get(".app-row-actions-icon").eq(0).click() |
|||
}) |
|||
cy.get(".spectrum-Menu").contains("Edit icon").click() |
|||
// Select random icon
|
|||
cy.get(".grid").within(() => { |
|||
cy.get(".icon-item").eq(Math.floor(Math.random() * 23) + 1).click() |
|||
}) |
|||
// Select random colour
|
|||
cy.get(".fill").click() |
|||
cy.get(".colors").within(() => { |
|||
cy.get(".color").eq(Math.floor(Math.random() * 33) + 1).click() |
|||
}) |
|||
cy.intercept('**/applications/**').as('iconChange') |
|||
cy.get(".spectrum-Button").contains("Save").click({ force: true }) |
|||
cy.wait("@iconChange") |
|||
cy.get("@iconChange").its('response.statusCode') |
|||
.should('eq', 200) |
|||
cy.wait(1000) |
|||
// Confirm icon has changed from default
|
|||
// Confirm colour has been applied - There is no default colour
|
|||
cy.get(".appTable") |
|||
.within(() => { |
|||
cy.get('[aria-label]').eq(0).children() |
|||
.should('have.attr', 'xlink:href').and('not.contain', '#spectrum-icon-18-Apps') |
|||
cy.get(".title").children().children() |
|||
.should('have.attr', 'style').and('contains', 'color') |
|||
}) |
|||
cy.deleteAllApps() |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,56 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify HR Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter HR Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="HR"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for HR templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
if (templateNameText == "Job Application Tracker") { |
|||
// Template name should include 'applicant-tracking-system'
|
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', 'applicant-tracking-system') |
|||
} |
|||
else if (templateNameText == "Job Portal App") { |
|||
// Template name should include 'job-portal'
|
|||
const templateNameSplit = templateNameParsed.split('-app')[0] |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameSplit) |
|||
} |
|||
else { |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameParsed) |
|||
} |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,222 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Job Application Tracker Template Functionality", () => { |
|||
const templateName = "Job Application Tracker" |
|||
const templateNameParsed = templateName.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
cy.deleteApp(templateName) |
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`, { |
|||
onBeforeLoad(win) { |
|||
cy.stub(win, 'open') |
|||
} |
|||
}) |
|||
cy.wait(2000) |
|||
}) |
|||
|
|||
it("should create and publish app with Job Application Tracker template", () => { |
|||
// Select Job Application Tracker template
|
|||
cy.get(".template-thumbnail-text") |
|||
.contains(templateName).parentsUntil(".template-grid").within(() => { |
|||
cy.get(".spectrum-Button").contains("Use template").click({ force: true }) |
|||
}) |
|||
|
|||
// Confirm URL matches template name
|
|||
const appUrl = cy.get(".app-server") |
|||
appUrl.invoke('text').then(appUrlText => { |
|||
expect(appUrlText).to.equal(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
}) |
|||
|
|||
// Create App
|
|||
cy.get(".spectrum-Dialog-grid").within(() => { |
|||
cy.get(".spectrum-Button").contains("Create app").click({ force: true }) |
|||
}) |
|||
|
|||
// Publish App & Verify it opened
|
|||
cy.wait(2000) // Wait for app to generate
|
|||
cy.publishApp(true) |
|||
cy.window().its('open').should('be.calledOnce') |
|||
}) |
|||
|
|||
it("should add active/inactive vacancies", () => { |
|||
// Visit published app
|
|||
cy.visit(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
|
|||
// loop for active/inactive vacancies
|
|||
for (let i = 0; i < 2; i++) { |
|||
// Vacancies section
|
|||
cy.get(".links").contains("Vacancies").click({ force: true }) |
|||
cy.get(".spectrum-Button").contains("Create New").click() |
|||
|
|||
// Add inactive vacancy
|
|||
// Title
|
|||
cy.get('[data-name="Title"]').within(() => { |
|||
cy.get(".spectrum-Textfield").type("Tester") |
|||
}) |
|||
|
|||
// Closing Date
|
|||
cy.get('[data-name="Closing date"]').within(() => { |
|||
cy.get('[aria-label=Calendar]').click({ force: true }) |
|||
}) |
|||
cy.get("[aria-current=date]").click() |
|||
|
|||
// Department
|
|||
cy.get('[data-name="Department"]').within(() => { |
|||
cy.get(".spectrum-Picker-label").click() |
|||
}) |
|||
cy.get(".spectrum-Menu").find('li').its('length').then(len => { |
|||
cy.get(".spectrum-Menu-item").eq(Math.floor(Math.random() * len)).click() |
|||
}) |
|||
|
|||
// Employment Type
|
|||
cy.get('[data-name="Employment type"]').within(() => { |
|||
cy.get(".spectrum-Picker-label").click() |
|||
}) |
|||
cy.get(".spectrum-Menu").find('li').its('length').then(len => { |
|||
cy.get(".spectrum-Menu-item").eq(Math.floor(Math.random() * len)).click() |
|||
}) |
|||
|
|||
// Salary
|
|||
cy.get('[data-name="Salary ($)"]').within(() => { |
|||
cy.get(".spectrum-Textfield").type(40000) |
|||
}) |
|||
|
|||
// Description
|
|||
cy.get('[data-name="Description"]').within(() => { |
|||
cy.get(".spectrum-Textfield").type("description") |
|||
}) |
|||
|
|||
// Responsibilities
|
|||
cy.get('[data-name="Responsibilities"]').within(() => { |
|||
cy.get(".spectrum-Textfield").type("Responsibilities") |
|||
}) |
|||
|
|||
// Requirements
|
|||
cy.get('[data-name="Requirements"]').within(() => { |
|||
cy.get(".spectrum-Textfield").type("Requirements") |
|||
}) |
|||
|
|||
// Hiring manager
|
|||
cy.get('[data-name="Hiring manager"]').within(() => { |
|||
cy.get(".spectrum-Picker-label").click() |
|||
}) |
|||
cy.get(".spectrum-Menu").find('li').its('length').then(len => { |
|||
cy.get(".spectrum-Menu-item").eq(Math.floor(Math.random() * len)).click() |
|||
}) |
|||
|
|||
// Active
|
|||
if (i == 0) { |
|||
cy.get('[data-name="Active"]').within(() => { |
|||
cy.get(".spectrum-Checkbox-box").click({ force: true }) |
|||
}) |
|||
} |
|||
|
|||
// Location
|
|||
cy.get('[data-name="Location"]').within(() => { |
|||
cy.get(".spectrum-Picker-label").click() |
|||
}) |
|||
cy.get(".spectrum-Menu").find('li').its('length').then(len => { |
|||
cy.get(".spectrum-Menu-item").eq(Math.floor(Math.random() * len)).click() |
|||
}) |
|||
|
|||
// Save vacancy
|
|||
cy.get(".spectrum-Button").contains("Save").click({ force: true }) |
|||
cy.wait(1000) |
|||
|
|||
// Check table was updated
|
|||
cy.get('[data-name="Vacancies Table"]').eq(i).should('contain', 'Tester') |
|||
} |
|||
}) |
|||
|
|||
xit("should filter applications by stage", () => { |
|||
// Visit published app
|
|||
cy.visit(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
cy.wait(1000) |
|||
|
|||
// Applications section
|
|||
cy.get(".links").contains("Applications").click({ force: true }) |
|||
cy.wait(1000) |
|||
|
|||
// Filter by stage - Confirm table updates
|
|||
cy.get(".spectrum-Picker").contains("Filter by stage").click({ force: true }) |
|||
cy.get(".spectrum-Menu").find('li').its('length').then(len => { |
|||
for (let i = 1; i < len; i++) { |
|||
cy.get(".spectrum-Menu-item").eq(i).click() |
|||
const stage = cy.get(".spectrum-Picker-label") |
|||
stage.invoke('text').then(stageText => { |
|||
if (stageText == "1st interview") { |
|||
cy.get(".placeholder").should('contain', 'No rows found') |
|||
} |
|||
else { |
|||
cy.get(".spectrum-Table-row").should('contain', stageText) |
|||
} |
|||
cy.get(".spectrum-Picker").contains(stageText).click({ force: true }) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
|
|||
xit("should edit an application", () => { |
|||
// Switch application from not hired to hired
|
|||
// Visit published app
|
|||
cy.visit(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
cy.wait(1000) |
|||
|
|||
// Not Hired section
|
|||
cy.get(".links").contains("Not hired").click({ force: true }) |
|||
cy.wait(500) |
|||
|
|||
// View application
|
|||
cy.get(".spectrum-Table").within(() => { |
|||
cy.get(".spectrum-Button").contains("View").click({ force: true }) |
|||
cy.wait(500) |
|||
}) |
|||
|
|||
// Update value for 'Staged'
|
|||
cy.get('[data-name="Stage"]').within(() => { |
|||
cy.get(".spectrum-Picker-label").click() |
|||
}) |
|||
cy.get(".spectrum-Menu").within(() => { |
|||
cy.get(".spectrum-Menu-item").contains("Hired").click() |
|||
}) |
|||
|
|||
// Save application
|
|||
cy.get(".spectrum-Button").contains("Save").click({ force: true }) |
|||
cy.wait(500) |
|||
|
|||
// Hired section
|
|||
cy.get(".links").contains("Hired").click({ force: true }) |
|||
cy.wait(500) |
|||
|
|||
// Verify Table size - Total rows = 2
|
|||
cy.get(".spectrum-Table").find(".spectrum-Table-row").its('length').then((len => { |
|||
expect(len).to.eq(2) |
|||
})) |
|||
}) |
|||
|
|||
xit("should delete an application", () => { |
|||
// Visit published app
|
|||
cy.visit(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
cy.wait(1000) |
|||
|
|||
// Hired section
|
|||
cy.get(".links").contains("Hired").click({ force: true }) |
|||
cy.wait(500) |
|||
|
|||
// View first application
|
|||
cy.get(".spectrum-Table-row").eq(0).within(() => { |
|||
cy.get(".spectrum-Button").contains("View").click({ force: true }) |
|||
cy.wait(500) |
|||
}) |
|||
|
|||
// Delete application
|
|||
cy.get(".spectrum-Button").contains("Delete").click({ force: true }) |
|||
cy.get(".spectrum-Dialog-grid").within(() => { |
|||
cy.get(".spectrum-Button").contains("Confirm").click() |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,60 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify IT Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter IT Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="IT"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for IT templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
if (templateNameText == "Hashicorp Scorecard Template") { |
|||
const templateNameSplit = templateNameParsed.split('-template')[0] |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameSplit) |
|||
} |
|||
else if (templateNameText == "IT Ticketing System") { |
|||
const templateNameSplit = templateNameParsed.split('it-')[1] |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameSplit) |
|||
} |
|||
else if (templateNameText == "IT Incident Report Form") { |
|||
const templateNameSplit = templateNameParsed.split('-form')[0] |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameSplit) |
|||
} |
|||
else { |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
} |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,72 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("IT Ticketing System Template Functionality", () => { |
|||
const templateName = "IT Ticketing System" |
|||
const templateNameParsed = templateName.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
cy.deleteApp(templateName) |
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`, { |
|||
onBeforeLoad(win) { |
|||
cy.stub(win, 'open') |
|||
} |
|||
}) |
|||
cy.wait(2000) |
|||
}) |
|||
|
|||
it("should create and publish app with IT Ticketing System template", () => { |
|||
// Select IT Ticketing System template
|
|||
cy.get(".template-thumbnail-text") |
|||
.contains(templateName).parentsUntil(".template-grid").within(() => { |
|||
cy.get(".spectrum-Button").contains("Use template").click({ force: true }) |
|||
}) |
|||
|
|||
// Confirm URL matches template name
|
|||
const appUrl = cy.get(".app-server") |
|||
appUrl.invoke('text').then(appUrlText => { |
|||
expect(appUrlText).to.equal(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
}) |
|||
|
|||
// Create App
|
|||
cy.get(".spectrum-Dialog-grid").within(() => { |
|||
cy.get(".spectrum-Button").contains("Create app").click({ force: true }) |
|||
}) |
|||
|
|||
// Publish App & Verify it opened
|
|||
cy.wait(2000) // Wait for app to generate
|
|||
cy.publishApp(true) |
|||
cy.window().its('open').should('be.calledOnce') |
|||
}) |
|||
|
|||
xit("should filter tickets by status", () => { |
|||
// Visit published app
|
|||
cy.visit(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
cy.wait(1000) |
|||
|
|||
// Tickets section
|
|||
cy.get(".links").contains("Tickets").click({ force: true }) |
|||
cy.wait(1000) |
|||
|
|||
// Filter by stage - Confirm table updates
|
|||
cy.get(".spectrum-Picker").contains("Filter by status").click({ force: true }) |
|||
cy.get(".spectrum-Menu").find('li').its('length').then(len => { |
|||
for (let i = 1; i < len; i++) { |
|||
cy.get(".spectrum-Menu-item").eq(i).click() |
|||
const stage = cy.get(".spectrum-Picker-label") |
|||
stage.invoke('text').then(stageText => { |
|||
if (stageText == "In progress" || stageText == "On hold" || stageText == "Triaged") { |
|||
cy.get(".placeholder").should('contain', 'No rows found') |
|||
} |
|||
else { |
|||
cy.get(".spectrum-Table-row").should('contain', stageText) |
|||
} |
|||
cy.get(".spectrum-Picker").contains(stageText).click({ force: true }) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,42 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Admin Panel Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Admin Panels Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Admin Panels"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Admin Panels templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,51 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Aproval Apps Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Approval Apps Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Approval Apps"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Approval Apps templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
if (templateNameText == "Content Approval System") { |
|||
// Template name should include 'content-approval'
|
|||
const templateNameSplit = templateNameParsed.split('-system')[0] |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameSplit) |
|||
} |
|||
else { |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
} |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,51 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Business Apps Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Business Apps Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Business Apps"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Business Apps templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
if (templateNameText == "Employee Check-in/Check-Out Template") { |
|||
// Remove / from template name
|
|||
const templateNameReplace = templateNameParsed.replace(/\//g, "-") |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameReplace) |
|||
} |
|||
else { |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
} |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,44 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Directories Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Directories Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Directories"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Directories templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
const templateNameSplit = templateNameParsed.split('-template')[0] |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameSplit) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,42 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Forms Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Forms Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Forms"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Forms templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,43 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Healthcare Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Healthcare Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Healthcare"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Healthcare templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,42 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Legal Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Legal Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Legal"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Legal templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,42 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Logistics Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Logistics Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Logistics"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Logistics templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,42 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Manufacturing Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Manufacturing Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Manufacturing"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Manufacturing templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,44 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Lead Generation Form Template Functionality", () => { |
|||
const templateName = "Lead Generation Form" |
|||
const templateNameParsed = templateName.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
cy.deleteApp(templateName) |
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`, { |
|||
onBeforeLoad(win) { |
|||
cy.stub(win, 'open') |
|||
} |
|||
}) |
|||
cy.wait(2000) |
|||
}) |
|||
|
|||
it("should create and publish app with Lead Generation Form template", () => { |
|||
// Select Lead Generation Form template
|
|||
cy.get(".template-thumbnail-text") |
|||
.contains(templateName).parentsUntil(".template-grid").within(() => { |
|||
cy.get(".spectrum-Button").contains("Use template").click({ force: true }) |
|||
}) |
|||
|
|||
// Confirm URL matches template name
|
|||
const appUrl = cy.get(".app-server") |
|||
appUrl.invoke('text').then(appUrlText => { |
|||
expect(appUrlText).to.equal(`${Cypress.config().baseUrl}/app/` + templateNameParsed) |
|||
}) |
|||
|
|||
// Create App
|
|||
cy.get(".spectrum-Dialog-grid").within(() => { |
|||
cy.get(".spectrum-Button").contains("Create app").click({ force: true }) |
|||
}) |
|||
|
|||
// Publish App & Verify it opened
|
|||
cy.wait(2000) // Wait for app to generate
|
|||
cy.publishApp(true) |
|||
cy.window().its('open').should('be.calledOnce') |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,51 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Marketing Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Marketing Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Marketing"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Marketing templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
|
|||
if (templateNameText == "Lead Generation Form") { |
|||
// Multi-step lead form
|
|||
// Template name includes 'multi-step-lead-form'
|
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', 'multi-step-lead-form') |
|||
} |
|||
else { |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
} |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,42 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Operations Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Operations Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Operations"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Operations templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,71 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Portals Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
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", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Portals templates", () => { |
|||
// Filter Portals Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Portals"]').click() |
|||
}) |
|||
|
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a') |
|||
.should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
@ -1,42 +0,0 @@ |
|||
import filterTests from "../../../support/filterTests" |
|||
|
|||
filterTests(["all"], () => { |
|||
context("Verify Professional Services Template Details", () => { |
|||
|
|||
before(() => { |
|||
cy.login() |
|||
|
|||
// Template navigation
|
|||
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/templates`) |
|||
|
|||
// Filter Professional Services Templates
|
|||
cy.get(".template-category-filters").within(() => { |
|||
cy.get('[data-cy="Professional Services"]').click() |
|||
}) |
|||
}) |
|||
|
|||
it("should verify the details option for Professional Services templates", () => { |
|||
cy.get(".template-grid").find(".template-card").its('length') |
|||
.then(len => { |
|||
// Verify template name is within details link
|
|||
for (let i = 0; i < len; i++) { |
|||
cy.get(".template-card").eq(i).within(() => { |
|||
const templateName = cy.get(".template-thumbnail-text") |
|||
templateName.invoke('text') |
|||
.then(templateNameText => { |
|||
const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') |
|||
cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) |
|||
}) |
|||
// Verify correct status from Details link - 200
|
|||
cy.get('a') |
|||
.then(link => { |
|||
cy.request(link.prop('href')) |
|||
.its('status') |
|||
.should('eq', 200) |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
}) |
|||
}) |
|||
Loading…
Reference in new issue