Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
updated test with new plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
clmedders committed Dec 1, 2023
1 parent 81083ba commit b3e7e4e
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions cypress/e2e/tests/state-selection.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,35 @@ describe('Validate state selection options', () => {
cy.get('[data-test="state-list"]').should('contain', 'Maryland', 'Northern Mariana Islands')
})

it('Verify that user can navigate to state page', () => {
it('Verify that user can navigate to state page from dropdown', () => {
// * Check Alaska
cy.get('[data-test="state-selection"]').type('Alaska')
cy.get('[data-test="dropdown-btn"]').click()
cy.get('[data-test=state-list]').find('li').then(option => {
cy.get(option[1]).click()
cy.url().should('include', '/register/ak/')
cy.get(option[1]).realClick()
})
cy.url().should('include', '/register/ak/')
cy.get('[data-test="vote-logo"]').click()
// * Check American Samoa
cy.get('[data-test="state-selection"]').type('American Samoa')
cy.get('[data-test="dropdown-btn"]').click()
cy.get('[data-test=state-list]').find('li').then(option => {
cy.get(option[2]).click()
cy.url().should('include', '/register/as/')
cy.get(option[2]).realClick()
})
cy.url().should('include', '/register/as/')
cy.get('[data-test="vote-logo"]').click()
// * Check Arkansas
cy.get('[data-test="state-selection"]').type('Arkansas')
cy.get('[data-test="dropdown-btn"]').click()
cy.get('[data-test=state-list]').find('li').then(option => {
cy.get(option[4]).click()
cy.url().should('include', '/register/ar/')
cy.get(option[4]).realClick()
})
cy.url().should('include', '/register/ar/')
cy.get('[data-test="vote-logo"]').click()
// * Check North Dakota
cy.get('[data-test="state-selection"]').type('North Dakota')
cy.get('[data-test="dropdown-btn"]').click()
cy.get('[data-test=state-list]').find('li').then(option => {
cy.get(option[36]).click()
cy.url().should('include', '/register/nd/')
cy.get(option[36]).realClick()
})
cy.url().should('include', '/register/nd/')
})
})


0 comments on commit b3e7e4e

Please sign in to comment.