From b10017a68d2d30b65d162b879e94c49926dd3132 Mon Sep 17 00:00:00 2001 From: tfhuhtal Date: Mon, 7 Oct 2024 14:28:01 +0300 Subject: [PATCH] modal form tests --- cypress/integration/trackingpage.spec.js | 87 ++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/cypress/integration/trackingpage.spec.js b/cypress/integration/trackingpage.spec.js index 378f4c43..e7c52269 100644 --- a/cypress/integration/trackingpage.spec.js +++ b/cypress/integration/trackingpage.spec.js @@ -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() }) @@ -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() @@ -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() + }) })