1
0
Fork 0
mirror of synced 2024-08-02 11:51:34 +12:00
budibase/packages/builder/cypress/integration/addRadioButtons.spec.js
Mitch-Budibase b6f8d74e01 Cypress Testing additions and changes
-Changing baseurl to be the test env
-Made a few updates to existing tests/commands
--New commands also added
-Add Radio Button Test
-Add Multi Option Datatype test
-Custom Theming Properties Test
--Just the one so far, more to come
2021-09-27 18:19:25 +01:00

40 lines
1.2 KiB
JavaScript

context("Add Radio Buttons", () => {
before(() => {
cy.login()
cy.createTestApp()
})
it("should add Radio Buttons options picker on form, add data, and confirm", () => {
cy.navigateToFrontend()
cy.addComponent("Form", "Form")
cy.addComponent("Form", "Options Picker").then((componentId) => {
// Provide field setting
cy.get(`[data-cy="field-prop-control"]`).type("1")
// Open dropdown and select Radio buttons
cy.get(`[data-cy="optionsType-prop-control"]`).click().then(() => {
cy.get('.spectrum-Popover').contains('Radio buttons')
.wait(500)
.click()
})
const radioButtonsTotal = 3
// Add values and confirm total
addRadioButtonData(radioButtonsTotal)
cy.getComponent(componentId).find('[type="radio"]')
.should('have.length', radioButtonsTotal)
})
})
const addRadioButtonData = (totalRadioButtons) => {
cy.get(`[data-cy="optionsSource-prop-control"]`).click().then(() => {
cy.get('.spectrum-Popover').contains('Custom')
.wait(500)
.click()
})
cy.addCustomSourceOptions(totalRadioButtons)
}
})