Skip to content

Commit

Permalink
fix(e2e): Fix issue that was caused by changing the dimension selecti…
Browse files Browse the repository at this point in the history
…ons to in-line broke the e2e tests as cypress was not able to click through the tooltips
  • Loading branch information
HRemonen committed Nov 3, 2023
1 parent 7872a38 commit cbc9b9e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cypress/e2e/form.spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ describe('Form section', () => {
})

it('user must proceed after faculty and dimensions are selected', () => {
cy.get(`[data-cy = "open-form-button"]`).should('not.be.disabled').click()
cy.get(`[data-cy = "open-form-button"]`)
.should('not.be.disabled')
.click({ force: true })
})

it('loads visible questions correctly', () => {
cy.get(`[data-cy = "dimension-select-discussion"]`).click()

cy.get(`[data-cy = "open-form-button"]`).click()
cy.get(`[data-cy = "open-form-button"]`).click({ force: true })

questionData = getQuestionData()

Expand All @@ -69,7 +71,7 @@ describe('Form section', () => {
it('user can proceed with empty form to the results', () => {
cy.get(`[data-cy = "dimension-select-discussion"]`).click()

cy.get(`[data-cy = "open-form-button"]`).click()
cy.get(`[data-cy = "open-form-button"]`).click({ force: true })

// No selections in the middle

Expand All @@ -87,7 +89,7 @@ describe('Form section', () => {

cy.get(`[data-cy = "dimension-select-investication"]`).click()

cy.get(`[data-cy = "open-form-button"]`).click()
cy.get(`[data-cy = "open-form-button"]`).click({ force: true })

cy.wrap(questionData).each((question: Question) => {
if (!question.visibility.options) {
Expand Down Expand Up @@ -121,7 +123,7 @@ describe('Form section', () => {

cy.get(`[data-cy = "dimension-select-investication"]`).click()

cy.get(`[data-cy = "open-form-button"]`).click()
cy.get(`[data-cy = "open-form-button"]`).click({ force: true })

cy.wrap(questionData).each((question: Question) => {
if (!question.visibility.options) {
Expand Down Expand Up @@ -151,7 +153,7 @@ describe('Form section', () => {

cy.get(`[data-cy = "dimension-select-investication"]`).click()

cy.get(`[data-cy = "open-form-button"]`).click()
cy.get(`[data-cy = "open-form-button"]`).click({ force: true })

cy.wrap(questionData).each((question: Question) => {
if (!question.visibility.options) {
Expand Down Expand Up @@ -181,7 +183,7 @@ describe('Form section', () => {
})

it('after submitting users can return to the form to modify selections', () => {
cy.get(`[data-cy = "open-form-button"]`).click()
cy.get(`[data-cy = "open-form-button"]`).click({ force: true })

cy.contains('Tentti').click()

Expand Down

0 comments on commit cbc9b9e

Please sign in to comment.