From 7c743c5169ad65556a5beb175bd4426356d0f696 Mon Sep 17 00:00:00 2001 From: Igor Richter Date: Wed, 25 Oct 2023 00:07:46 +0200 Subject: [PATCH] adjust for new column, create class via new class page --- .../e2e/group/showGroupsAndClassesInTable.feature | 13 ++++++++++--- cypress/support/pages/group/pageGroups.js | 11 ++++++++--- .../group/showGroupsAndClassesInTableSteps.spec.js | 8 ++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/group/showGroupsAndClassesInTable.feature b/cypress/e2e/group/showGroupsAndClassesInTable.feature index faca0496..0f14a2ca 100644 --- a/cypress/e2e/group/showGroupsAndClassesInTable.feature +++ b/cypress/e2e/group/showGroupsAndClassesInTable.feature @@ -4,11 +4,18 @@ Feature: Group - To show groups and classes in one table with respective functio As a teacher I want to see all groups and classes belonging to my school. @stable_test - Scenario: As a pre-condition teacher adds a class to school + Scenario: As a teacher i can add a class to school Given I am logged in as a 'teacher1_nbc' at 'nbc' When I go to administration page - And I go to class administration - And I click on add class + And I go to new class administration page + Then I see the new class administration page + When I click on add class + Then I can see the create class page + When I click the cancel create class button + Then I can see the cancel modal + When I click the confirmation button on the cancel modal + Then I see the new class administration page + When I click on add class And I click on the confirm button And I confirm managing the class Then I see the new class administration page diff --git a/cypress/support/pages/group/pageGroups.js b/cypress/support/pages/group/pageGroups.js index 4e5ca272..9a4c723c 100644 --- a/cypress/support/pages/group/pageGroups.js +++ b/cypress/support/pages/group/pageGroups.js @@ -1,7 +1,7 @@ 'use strict' class Groups { - static #createClass = '[data-testid="createClass"]'; + static #createClass = '[data-testid="admin-class-add-button"]'; static #confirmClassCreate = '[data-testid="confirmClassCreate"]'; static #manageConfirm = '[data-testid="manage-confirm"]'; static #classTitleNew = '[data-testid="admin-class-title"]'; @@ -130,6 +130,11 @@ class Groups { .should('be.visible'); } + isCreateClassPage() { + cy.url().should('include', '/administration/classes'); + cy.url().should('include', '/create'); + } + newClassTableContainsClass(className, sourceName) { const classNameData = cy.get(Groups.#classTableNew).find('td').contains(className); @@ -142,14 +147,14 @@ class Groups { groupsHaveAManageButton(groupName) { const classNameData = cy.get(Groups.#classTableNew).find('td').contains(groupName); - classNameData.siblings('td').eq(2).find('a[data-testid="class-table-members-manage-btn"]') + classNameData.siblings('td').eq(3).find('a[data-testid="class-table-members-manage-btn"]') .should('exist'); } classesHave4ActiveActionItems(className) { const classNameData = cy.get(Groups.#classTableNew).find('td').contains(className); - const buttons = classNameData.siblings('td').eq(2).find('a, button'); + const buttons = classNameData.siblings('td').eq(3).find('a, button'); buttons.should('have.length', 4); buttons.each(($btn) => { diff --git a/cypress/support/step_definition/group/showGroupsAndClassesInTableSteps.spec.js b/cypress/support/step_definition/group/showGroupsAndClassesInTableSteps.spec.js index 30e29a22..fc597116 100644 --- a/cypress/support/step_definition/group/showGroupsAndClassesInTableSteps.spec.js +++ b/cypress/support/step_definition/group/showGroupsAndClassesInTableSteps.spec.js @@ -77,3 +77,11 @@ When('I click the cancel button on the delete modal', () => { When('I click the confirmation button on the delete modal', () => { groups.clickConfirmDeleteDialogButton(); }) + +Then('I can see the create class page', () => { + groups.isCreateClassPage(); +}) + +When('I click the cancel create class button', () => { + groups.clickCancelButton(); +})