2022-01-21 13:43:27 +01:00
|
|
|
import filterTests from "../support/filterTests"
|
|
|
|
|
|
|
|
filterTests(['all'], () => {
|
|
|
|
context("Change Application Icon and Colour", () => {
|
|
|
|
before(() => {
|
|
|
|
cy.login()
|
|
|
|
})
|
2022-03-29 00:21:38 +02:00
|
|
|
|
|
|
|
after(() => {
|
|
|
|
cy.deleteAllApps()
|
|
|
|
})
|
2022-01-21 13:43:27 +01:00
|
|
|
|
|
|
|
it("should change the icon and colour for an application", () => {
|
|
|
|
// Search for test application
|
2022-03-29 00:21:38 +02:00
|
|
|
cy.applicationInAppTable("Cypress Tests")
|
2022-01-21 13:43:27 +01:00
|
|
|
cy.get(".appTable")
|
|
|
|
.within(() => {
|
|
|
|
cy.get(".spectrum-Icon").eq(1).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()
|
2021-12-24 11:38:03 +01:00
|
|
|
})
|
2022-01-21 13:43:27 +01:00
|
|
|
// Select random colour
|
|
|
|
cy.get(".fill").click()
|
|
|
|
cy.get(".colors").within(() => {
|
|
|
|
cy.get(".color").eq(Math.floor(Math.random() * 33) + 1).click()
|
2021-12-24 11:38:03 +01:00
|
|
|
})
|
2022-01-21 13:43:27 +01:00
|
|
|
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')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
2021-12-24 11:49:47 +01:00
|
|
|
})
|