Refactoring tests
Tests: 1. AppiconAndColour 2. Automation
This commit is contained in:
parent
6d0ac317ce
commit
52d643c035
|
@ -1,4 +1,5 @@
|
|||
import filterTests from "../support/filterTests"
|
||||
const interact = require('../support/interact')
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("Change Application Icon and Colour", () => {
|
||||
|
@ -11,20 +12,20 @@ filterTests(['all'], () => {
|
|||
cy.applicationInAppTable("Cypress Tests")
|
||||
cy.get(".appTable")
|
||||
.within(() => {
|
||||
cy.get(".app-row-actions-icon").eq(0).click()
|
||||
cy.get(interact.APP_ROW_ACTION).eq(0).click()
|
||||
})
|
||||
cy.get(".spectrum-Menu").contains("Edit icon").click()
|
||||
cy.get(interact.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()
|
||||
cy.get(interact.GRID).within(() => {
|
||||
cy.get(interact.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.get(interact.FILL).click()
|
||||
cy.get(interact.COLOURSS).within(() => {
|
||||
cy.get(interact.COLOUR).eq(Math.floor(Math.random() * 33) + 1).click()
|
||||
})
|
||||
cy.intercept('**/applications/**').as('iconChange')
|
||||
cy.get(".spectrum-Button").contains("Save").click({ force: true })
|
||||
cy.get(interact.SPECTRUM_BUTTON).contains("Save").click({ force: true })
|
||||
cy.wait("@iconChange")
|
||||
cy.get("@iconChange").its('response.statusCode')
|
||||
.should('eq', 200)
|
||||
|
@ -33,9 +34,9 @@ filterTests(['all'], () => {
|
|||
// Confirm colour has been applied - There is no default colour
|
||||
cy.get(".appTable")
|
||||
.within(() => {
|
||||
cy.get('[aria-label]').eq(0).children()
|
||||
cy.get(interact.AREA_LABEL).eq(0).children()
|
||||
.should('have.attr', 'xlink:href').and('not.contain', '#spectrum-icon-18-Apps')
|
||||
cy.get(".title").children().children()
|
||||
cy.get(interact.TITLE).children().children()
|
||||
.should('have.attr', 'style').and('contains', 'color')
|
||||
})
|
||||
cy.deleteAllApps()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import filterTests from "../support/filterTests"
|
||||
const interact = require('../support/interact')
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Create a automation", () => {
|
||||
|
@ -11,51 +12,51 @@ filterTests(['smoke', 'all'], () => {
|
|||
cy.createTestTableWithData()
|
||||
cy.wait(2000)
|
||||
cy.contains("Automate").click()
|
||||
cy.get(".add-button .spectrum-Icon").click()
|
||||
cy.get(".modal-inner-wrapper").within(() => {
|
||||
cy.get(interact.ADD_BUTTON_SPECTRUM).click()
|
||||
cy.get(interact.MODAL_INNER_WRAPPER).within(() => {
|
||||
cy.get("input").type("Add Row")
|
||||
cy.contains("Row Created").click({ force: true })
|
||||
cy.wait(500)
|
||||
cy.get(".spectrum-Button--cta").click()
|
||||
cy.get(interact.SPECTRUM_BUTTON_CTA).click()
|
||||
})
|
||||
|
||||
// Setup trigger
|
||||
cy.get(".spectrum-Picker-label").click()
|
||||
cy.get(interact.SPECTRUM_PICKER_LABEL).click()
|
||||
cy.wait(500)
|
||||
cy.contains("dog").click()
|
||||
cy.wait(2000)
|
||||
// Create action
|
||||
cy.get('[aria-label="AddCircle"]').eq(1).click()
|
||||
cy.get(".modal-inner-wrapper").within(() => {
|
||||
cy.get(interact.MODAL_INNER_WRAPPER).within(() => {
|
||||
cy.wait(1000)
|
||||
cy.contains("Create Row").trigger('mouseover').click().click()
|
||||
cy.get(".spectrum-Button--cta").click()
|
||||
cy.get(interact.SPECTRUM_BUTTON_CTA).click()
|
||||
})
|
||||
cy.get(".spectrum-Picker-label").eq(1).click()
|
||||
cy.get(interact.SPECTRUM_PICKER_LABEL).eq(1).click()
|
||||
cy.contains("dog").click()
|
||||
cy.get(".spectrum-Textfield-input")
|
||||
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT)
|
||||
.first()
|
||||
.type("{{ trigger.row.name }}", { parseSpecialCharSequences: false })
|
||||
cy.get(".spectrum-Textfield-input")
|
||||
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT)
|
||||
.eq(1)
|
||||
.type("11")
|
||||
cy.contains("Finish and test automation").click()
|
||||
|
||||
cy.get(".modal-inner-wrapper").within(() => {
|
||||
cy.get(interact.MODAL_INNER_WRAPPER).within(() => {
|
||||
cy.wait(1000)
|
||||
cy.get(".spectrum-Picker-label").click()
|
||||
cy.get(interact.SPECTRUM_PICKER_LABEL).click()
|
||||
cy.contains("dog").click()
|
||||
cy.wait(1000)
|
||||
cy.get(".spectrum-Textfield-input")
|
||||
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT)
|
||||
.first()
|
||||
.type("automationGoodboy")
|
||||
cy.get(".spectrum-Textfield-input")
|
||||
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT)
|
||||
.eq(1)
|
||||
.type("11")
|
||||
cy.get(".spectrum-Textfield-input")
|
||||
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT)
|
||||
.eq(2)
|
||||
.type("123456")
|
||||
cy.get(".spectrum-Textfield-input")
|
||||
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT)
|
||||
.eq(3)
|
||||
.type("123456")
|
||||
cy.contains("Test").click()
|
||||
|
|
|
@ -58,3 +58,20 @@ export const GLOBESTRIKE = "svg[aria-label=GlobeStrike]"
|
|||
export const GLOBE = "svg[aria-label=Globe]"
|
||||
export const UNPUBLISH_MODAL = "[data-cy=unpublish-modal]"
|
||||
export const CONFIRM_WRAP_BUTTON = ".confirm-wrap button"
|
||||
|
||||
//changeAppiconAndColour
|
||||
export const APP_ROW_ACTION = ".app-row-actions-icon"
|
||||
export const SPECTRUM_MENU = ".spectrum-Menu"
|
||||
export const ICON_ITEM = ".icon-item"
|
||||
export const FILL = ".fill"
|
||||
export const COLOURSS = ".colors"
|
||||
export const AREA_LABEL = "[aria-label]"
|
||||
export const TITLE = ".title"
|
||||
export const GRID = ".grid"
|
||||
export const COLOUR = ".color"
|
||||
|
||||
//createAutomation
|
||||
export const ADD_BUTTON_SPECTRUM = ".add-button .spectrum-Icon"
|
||||
export const MODAL_INNER_WRAPPER = ".modal-inner-wrapper"
|
||||
export const SPECTRUM_BUTTON_CTA = ".spectrum-Button--cta"
|
||||
export const SPECTRUM_TEXTFIELD_INPUT = ".spectrum-Textfield-input"
|
||||
|
|
Loading…
Reference in New Issue