Update cypress tests to account for component restructuring
This commit is contained in:
parent
ae19581288
commit
5cf682e1f0
|
@ -10,11 +10,11 @@ context("Add Multi-Option Datatype", () => {
|
||||||
cy.addRowMultiValue(["1", "2", "3", "4", "5"])
|
cy.addRowMultiValue(["1", "2", "3", "4", "5"])
|
||||||
})
|
})
|
||||||
|
|
||||||
it ("should add form with multi select picker, containing 5 options", () => {
|
it("should add form with multi select picker, containing 5 options", () => {
|
||||||
cy.navigateToFrontend()
|
cy.navigateToFrontend()
|
||||||
cy.wait(500)
|
cy.wait(500)
|
||||||
// Add data provider
|
// Add data provider
|
||||||
cy.get(`[data-cy="category-Data Provider"]`).click()
|
cy.get(`[data-cy="component-Data Provider"]`).click()
|
||||||
cy.get('[data-cy="dataSource-prop-control"]').click()
|
cy.get('[data-cy="dataSource-prop-control"]').click()
|
||||||
cy.get(".dropdown").contains("Multi Data").click()
|
cy.get(".dropdown").contains("Multi Data").click()
|
||||||
cy.wait(500)
|
cy.wait(500)
|
||||||
|
@ -24,18 +24,20 @@ context("Add Multi-Option Datatype", () => {
|
||||||
cy.get(".dropdown").contains("Multi Data").click()
|
cy.get(".dropdown").contains("Multi Data").click()
|
||||||
cy.wait(500)
|
cy.wait(500)
|
||||||
// Add multi-select picker to form
|
// Add multi-select picker to form
|
||||||
cy.addComponent("Form", "Multi-select Picker").then((componentId) => {
|
cy.addComponent("Form", "Multi-select Picker").then(componentId => {
|
||||||
cy.get('[data-cy="field-prop-control"]').type("Test Data").type('{enter}')
|
cy.get('[data-cy="field-prop-control"]').type("Test Data").type("{enter}")
|
||||||
cy.wait(1000)
|
cy.wait(1000)
|
||||||
cy.getComponent(componentId).contains("Choose some options").click()
|
cy.getComponent(componentId).contains("Choose some options").click()
|
||||||
// Check picker has 5 items
|
// Check picker has 5 items
|
||||||
cy.getComponent(componentId).find('li').should('have.length', 5)
|
cy.getComponent(componentId).find("li").should("have.length", 5)
|
||||||
// Select all items
|
// Select all items
|
||||||
for (let i = 1; i < 6; i++) {
|
for (let i = 1; i < 6; i++) {
|
||||||
cy.getComponent(componentId).find('li').contains(i).click()
|
cy.getComponent(componentId).find("li").contains(i).click()
|
||||||
}
|
}
|
||||||
// Check items have been selected
|
// Check items have been selected
|
||||||
cy.getComponent(componentId).find('.spectrum-Picker-label').contains("(5)")
|
cy.getComponent(componentId)
|
||||||
|
.find(".spectrum-Picker-label")
|
||||||
|
.contains("(5)")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue