Skip to content

Commit

Permalink
modal form tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tfhuhtal committed Oct 7, 2024
1 parent da41d4b commit b10017a
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions cypress/integration/trackingpage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('Tracking page tests', () => {
cy.get('[data-cy=modify-plan-1]').click()

cy.get('[id=1_contact_person_text]').type('contact person')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(100)
cy.get('[data-cy=send-form]').click()
})
Expand All @@ -56,6 +57,7 @@ describe('Tracking page tests', () => {
cy.get('[data-cy=toggle-chooser]').click()
cy.get('[data-cy=color-positive-1]').click()
cy.get('[id=1_contact_person_text]').type('contact person')
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(100)
cy.get('[data-cy=send-form]').click()

Expand Down Expand Up @@ -93,4 +95,89 @@ describe('Tracking page tests', () => {
cy.get(`[data-cy=square-${testFacultyCode}-1]`).click()
cy.contains('01.01.2000').should('exist')
})

it('should pick all the questions and fill them with ligths', () => {
const faculty = 'H57'
cy.visit(`faculty-monitoring/${faculty}`)
cy.get('[data-cy=degreeDropdown]').click()
cy.contains('Doctoral programmes').click()

cy.get(`[data-cy=question-picker-${faculty}]`).click()

cy.get('[data-cy=questions-list-0]').click()
cy.contains('1.').click()
cy.contains('2.').click()
cy.contains('3.').click()
cy.contains('4.').click()
cy.contains('5.').click()
cy.get('[data-cy=questions-list-1]').click()
cy.contains('6.').click()

cy.get('[data-cy=questions-list-2]').click()
cy.contains('7.').click()

cy.get('[data-cy=questions-list-3]').click()
cy.contains('8.').click()
cy.contains('9.').click()

cy.get('[data-cy=send-selection-button]').click()

cy.get('[data-cy=accordion-group-0]').click()
for (let i = 1; i < 6; i++) {
cy.get(`[data-cy=modify-plan-T${i}]`).click()
cy.get('[data-cy=toggle-chooser]').click()
cy.get(`[data-cy=color-positive-T${i}]`).click()
cy.get('[data-cy=send-form]').click()
}

cy.get('[data-cy=accordion-group-1]').click()
cy.get(`[data-cy=modify-plan-T6]`).click()
cy.get('[data-cy=toggle-chooser]').click()
cy.get(`[data-cy=color-positive-T6]`).click()
cy.get('[data-cy=send-form]').click()

cy.get('[data-cy=accordion-group-2]').click()
cy.get(`[data-cy=modify-plan-T7]`).click()
cy.get('[data-cy=toggle-chooser]').click()
cy.get(`[data-cy=color-positive-T7]`).click()
cy.get('[data-cy=send-form]').click()

cy.get('[data-cy=accordion-group-3]').click()
for (let i = 8; i < 10; i++) {
cy.get(`[data-cy=modify-plan-T${i}]`).click()
cy.get('[data-cy=toggle-chooser]').click()
cy.get(`[data-cy=color-positive-T${i}]`).click()
cy.get('[data-cy=send-form]').click()
}
})

it('form should be released and form should have correct data', () => {
cy.get(`[data-cy=question-picker-${testFacultyCode}]`).click()
cy.get('[data-cy=questions-list-2]').click()
cy.contains('14.').click()
cy.get('[data-cy=send-selection-button]').click()
cy.get('[data-cy=accordion-group-2]').click()
cy.get(`[data-cy=modify-plan-14]`).click()
cy.get('[data-cy=toggle-chooser]').click()
cy.get(`[data-cy=color-negative-14]`).click()
cy.get('[id=14_actions_text]').type('action')
cy.get('[id=14_responsible_entities_text]').type('entity')
cy.get('[id=14_resources_text]').type('1 person')

cy.login('cypressOspaUser')
cy.visit(`/faculty-monitoring/${testFacultyCode}`)
cy.get('[data-cy=accordion-group-2]').click()

cy.contains('cypressSuperAdminUser cypressSuperAdminUser is writing').should('exist')

cy.login(cypressSuperAdmin)
cy.visit(`/faculty-monitoring/${testFacultyCode}`)
cy.get('[data-cy=accordion-group-2]').click()

cy.login('cypressOspaUser')
cy.visit(`/faculty-monitoring/${testFacultyCode}`)
cy.get('[data-cy=accordion-group-2]').click()
cy.get(`[data-cy=modify-plan-14]`).click()
cy.get('[data-cy=send-form]').click()
})
})

0 comments on commit b10017a

Please sign in to comment.