diff --git a/cypress/e2e/group/groupMembers.feature b/cypress/e2e/class_management/groupMembers.feature similarity index 100% rename from cypress/e2e/group/groupMembers.feature rename to cypress/e2e/class_management/groupMembers.feature diff --git a/cypress/e2e/group/showGroupsAndClassesInTable.feature b/cypress/e2e/class_management/showGroupsAndClassesInTable.feature similarity index 82% rename from cypress/e2e/group/showGroupsAndClassesInTable.feature rename to cypress/e2e/class_management/showGroupsAndClassesInTable.feature index 0f14a2ca..5242ff90 100644 --- a/cypress/e2e/group/showGroupsAndClassesInTable.feature +++ b/cypress/e2e/class_management/showGroupsAndClassesInTable.feature @@ -7,7 +7,7 @@ Feature: Group - To show groups and classes in one table with respective functio 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 new class administration page + When 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 @@ -16,18 +16,18 @@ Feature: Group - To show groups and classes in one table with respective functio 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 + When I click on the confirm button + When I confirm managing the class Then I see the new class administration page @stable_test Scenario: As a teacher i can see all classes and groups of my school on the new class administration page. Given I see the new class administration page Then I can see the page title - And I can see the group 'Cypress-Test-Group' with source 'moin.schule' - And I can see the class '1' without source - And the group 'Cypress-Test-Group' has a manage button - And the class '1' has 4 enabled action items + Then I can see the group 'Cypress-Test-Group' with source 'moin.schule' + Then I can see the class '1' without source + Then I can see the manage button for group 'Cypress-Test-Group' + Then I can see 4 enabled action items for class '1' @stable_test Scenario: As a teacher i can manage my classes @@ -39,7 +39,7 @@ Feature: Group - To show groups and classes in one table with respective functio When I click the confirmation button on the cancel modal Then I see the new class administration page When I click the manage button - And I confirm managing the class + When I confirm managing the class Then I see the new class administration page @stable_test @@ -54,7 +54,7 @@ Feature: Group - To show groups and classes in one table with respective functio When I click the edit button When I click in the name suffix text element Then I can click on the save changes button - And I see the new class administration page + Then I see the new class administration page @stable_test Scenario: As a teacher i can upgrade my upgradable classes @@ -69,7 +69,7 @@ Feature: Group - To show groups and classes in one table with respective functio And I confirm creating the successor And I confirm managing the class Then I see the new class administration page - And the create successor button of the original class is disabled + Then I can see the disabled create successor button of the original class @stable_test Scenario: As a teacher i can delete my classes @@ -79,12 +79,12 @@ Feature: Group - To show groups and classes in one table with respective functio When I click the cancel button on the delete modal Then I see the new class administration page When I click the delete button - And I click the confirmation button on the delete modal + When I click the confirmation button on the delete modal Then I see the new class administration page @stable_test Scenario: As a post-condition teacher deletes the successor class and logs out Given I see the new class administration page When I click the delete button - And I click the confirmation button on the delete modal + When I click the confirmation button on the delete modal Then I see the new class administration page diff --git a/cypress/support/pages/group/pageGroups.js b/cypress/support/pages/class_management/pageClasses.js similarity index 74% rename from cypress/support/pages/group/pageGroups.js rename to cypress/support/pages/class_management/pageClasses.js index 9a4c723c..85e60197 100644 --- a/cypress/support/pages/group/pageGroups.js +++ b/cypress/support/pages/class_management/pageClasses.js @@ -1,6 +1,6 @@ 'use strict' -class Groups { +class Classes { static #createClass = '[data-testid="admin-class-add-button"]'; static #confirmClassCreate = '[data-testid="confirmClassCreate"]'; static #manageConfirm = '[data-testid="manage-confirm"]'; @@ -21,17 +21,17 @@ class Groups { static #manageGroupButton = '[data-testid="class-table-members-manage-btn"]'; clickCreateClass() { - cy.get(Groups.#createClass) + cy.get(Classes.#createClass) .click(); } clickConfirmCreateClass() { - cy.get(Groups.#confirmClassCreate) + cy.get(Classes.#confirmClassCreate) .click(); } clickConfirmManageClass() { - cy.get(Groups.#manageConfirm) + cy.get(Classes.#manageConfirm) .click(); } @@ -41,7 +41,7 @@ class Groups { } clickManageClassButton() { - cy.get(Groups.#manageClassButton) + cy.get(Classes.#manageClassButton) .first().click(); } @@ -51,7 +51,7 @@ class Groups { } clickEditClassButton() { - cy.get(Groups.#editClassButton) + cy.get(Classes.#editClassButton) .first().click(); } @@ -61,7 +61,7 @@ class Groups { } clickCreateSuccessorButton() { - cy.get(Groups.#createSuccessorButton) + cy.get(Classes.#createSuccessorButton) .first().click(); } @@ -79,17 +79,17 @@ class Groups { } clickDeleteButton() { - cy.get(Groups.#deleteClassButton) + cy.get(Classes.#deleteClassButton) .first().click(); } clickCancelDeleteDialogButton() { - cy.get(Groups.#deleteDialogCancel) + cy.get(Classes.#deleteDialogCancel) .click(); } clickConfirmDeleteDialogButton() { - cy.get(Groups.#deleteDialogConfirm) + cy.get(Classes.#deleteDialogConfirm) .click(); } @@ -108,7 +108,7 @@ class Groups { } isCancelModal() { - cy.get(Groups.#cancelModal).should('exist'); + cy.get(Classes.#cancelModal).should('exist'); } isCreateSuccessorPage() { @@ -117,16 +117,16 @@ class Groups { } seeNewClassPageTitle() { - cy.get(Groups.#classTitleNew).should('exist'); + cy.get(Classes.#classTitleNew).should('exist'); } isSuccessorButtonDisabled() { - cy.get(Groups.#createSuccessorButton) + cy.get(Classes.#createSuccessorButton) .first().should('have.class', 'v-btn--disabled'); } isDeleteDialog() { - cy.get(Groups.#deleteDialog) + cy.get(Classes.#deleteDialog) .should('be.visible'); } @@ -135,8 +135,8 @@ class Groups { cy.url().should('include', '/create'); } - newClassTableContainsClass(className, sourceName) { - const classNameData = cy.get(Groups.#classTableNew).find('td').contains(className); + seeNewClassTableContainsClass(className, sourceName) { + const classNameData = cy.get(Classes.#classTableNew).find('td').contains(className); classNameData.should('be.visible'); classNameData.siblings('td').eq(0).should(($td) => { @@ -144,15 +144,15 @@ class Groups { }); } - groupsHaveAManageButton(groupName) { - const classNameData = cy.get(Groups.#classTableNew).find('td').contains(groupName); + seeGroupsHaveAManageButton(groupName) { + const classNameData = cy.get(Classes.#classTableNew).find('td').contains(groupName); 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); + seeClassesHave4ActiveActionItems(className) { + const classNameData = cy.get(Classes.#classTableNew).find('td').contains(className); const buttons = classNameData.siblings('td').eq(3).find('a, button'); @@ -167,15 +167,15 @@ class Groups { } seeManageGroupPageTitle() { - cy.get(Groups.#adminGroupTitle).should('be.visible') + cy.get(Classes.#adminGroupTitle).should('be.visible') } seeGroupMemberTable() { - cy.get(Groups.#groupMemberTable).should('be.visible') + cy.get(Classes.#groupMemberTable).should('be.visible') } seeGroupMemberTableContainsMember(role, lastName){ - const groupMemberData = cy.get(Groups.#groupMemberTable).find('td').contains(lastName); + const groupMemberData = cy.get(Classes.#groupMemberTable).find('td').contains(lastName); groupMemberData.should('be.visible'); groupMemberData.siblings('td').eq(1).should(($td) => { @@ -184,18 +184,18 @@ class Groups { } seeClassMemberInfoBox() { - cy.get(Groups.#classMemberInfoBox).should('be.visible') + cy.get(Classes.#classMemberInfoBox).should('be.visible') } seeClassMemberInfoBoxText() { - cy.get(Groups.#classMemberInfoBoxText).should('be.visible') + cy.get(Classes.#classMemberInfoBoxText).should('be.visible') } clickManageGroupButton(){ - cy.get(Groups.#manageGroupButton) + cy.get(Classes.#manageGroupButton) .first().click(); } } -export default Groups +export default Classes diff --git a/cypress/support/step_definition/group/commonGroupSteps.spec.js b/cypress/support/step_definition/class_management/commonClassesSteps.spec.js similarity index 55% rename from cypress/support/step_definition/group/commonGroupSteps.spec.js rename to cypress/support/step_definition/class_management/commonClassesSteps.spec.js index 54e49b31..f7a17ba4 100644 --- a/cypress/support/step_definition/group/commonGroupSteps.spec.js +++ b/cypress/support/step_definition/class_management/commonClassesSteps.spec.js @@ -1,9 +1,9 @@ const { When, Then } = require('@badeball/cypress-cucumber-preprocessor') -import Groups from '../../pages/group/pageGroups' +import Classes from '../../pages/class_management/pageClasses' import Management from '../../pages/admin/pageAdministration'; -const groups = new Groups(); +const classes = new Classes(); const management = new Management(); When('I go to class administration', () => { @@ -15,37 +15,37 @@ When('I go to new class administration page', () => { }) When('I click on add class', () => { - groups.clickCreateClass(); + classes.clickCreateClass(); }) When('I click on the confirm button', () => { - groups.clickConfirmCreateClass(); + classes.clickConfirmCreateClass(); }) When('I confirm managing the class', () => { - groups.clickConfirmManageClass(); + classes.clickConfirmManageClass(); }) Then('I see the new class administration page', () => { - groups.isNewClassAdministrationPage(); + classes.isNewClassAdministrationPage(); }) Then('I can see the page title', () => { - groups.seeNewClassPageTitle(); + classes.seeNewClassPageTitle(); }) Then('I can see the group {string} with source {string}', (groupName, systemName) => { - groups.newClassTableContainsClass(groupName, systemName); + classes.seeNewClassTableContainsClass(groupName, systemName); }) Then('I can see the class {string} without source', (className) => { - groups.newClassTableContainsClass(className, ""); + classes.seeNewClassTableContainsClass(className, ""); }) -Then('the group {string} has a manage button', (groupName) => { - groups.groupsHaveAManageButton(groupName); +Then('I can see the manage button for group {string}', (groupName) => { + classes.seeGroupsHaveAManageButton(groupName); }) -Then('the class {string} has 4 enabled action items', (className) => { - groups.classesHave4ActiveActionItems(className); +Then('I can see 4 enabled action items for class {string}', (className) => { + classes.seeClassesHave4ActiveActionItems(className); }) diff --git a/cypress/support/step_definition/group/manageGroups.spec.js b/cypress/support/step_definition/class_management/manageGroups.spec.js similarity index 88% rename from cypress/support/step_definition/group/manageGroups.spec.js rename to cypress/support/step_definition/class_management/manageGroups.spec.js index 9dfd79fe..22bfe50b 100644 --- a/cypress/support/step_definition/group/manageGroups.spec.js +++ b/cypress/support/step_definition/class_management/manageGroups.spec.js @@ -1,7 +1,7 @@ -import Groups from "../../pages/group/pageGroups"; +import Classes from "../../pages/class_management/pageClasses"; import {Then, When} from "@badeball/cypress-cucumber-preprocessor"; -const groups = new Groups(); +const groups = new Classes(); When('I click the manage group button', () => { groups.clickManageGroupButton(); diff --git a/cypress/support/step_definition/group/showGroupsAndClassesInTableSteps.spec.js b/cypress/support/step_definition/class_management/showGroupsAndClassesInTableSteps.spec.js similarity index 58% rename from cypress/support/step_definition/group/showGroupsAndClassesInTableSteps.spec.js rename to cypress/support/step_definition/class_management/showGroupsAndClassesInTableSteps.spec.js index fc597116..af369e72 100644 --- a/cypress/support/step_definition/group/showGroupsAndClassesInTableSteps.spec.js +++ b/cypress/support/step_definition/class_management/showGroupsAndClassesInTableSteps.spec.js @@ -1,87 +1,87 @@ const { When, Then } = require('@badeball/cypress-cucumber-preprocessor') -import Groups from '../../pages/group/pageGroups'; +import Classes from '../../pages/class_management/pageClasses'; -const groups = new Groups() +const classes = new Classes() When('I click the manage button', () => { - groups.clickManageClassButton(); + classes.clickManageClassButton(); }) Then('I can see the manage classes page', () => { - groups.isManageClassPage(); + classes.isManageClassPage(); }) When('I click the cancel manage class button', () => { - groups.clickCancelButton(); + classes.clickCancelButton(); }) Then('I can see the cancel modal', () => { - groups.isCancelModal(); + classes.isCancelModal(); }) When('I click the confirmation button on the cancel modal', () => { - groups.clickConfirmButton(); + classes.clickConfirmButton(); }) When('I click the edit button', () => { - groups.clickEditClassButton(); + classes.clickEditClassButton(); }) Then('I can see the edit classes page', () => { - groups.isEditClassPage(); + classes.isEditClassPage(); }) When('I click the cancel edit class button', () => { - groups.clickCancelButton(); + classes.clickCancelButton(); }) When('I click in the name suffix text element', () => { - groups.clickNameSuffixField(); + classes.clickNameSuffixField(); }) Then('I can click on the save changes button', () => { - groups.clickSaveChangesButton(); + classes.clickSaveChangesButton(); }) When('I click the create successor button', () => { - groups.clickCreateSuccessorButton(); + classes.clickCreateSuccessorButton(); }) Then('I can see the create successor page', () => { - groups.isCreateSuccessorPage(); + classes.isCreateSuccessorPage(); }) When('I click the cancel create successor button', () => { - groups.clickCancelButton(); + classes.clickCancelButton(); }) When('I confirm creating the successor', () => { - groups.clickConfirmSuccessor(); + classes.clickConfirmSuccessor(); }) -Then('the create successor button of the original class is disabled', () => { - groups.isSuccessorButtonDisabled(); +Then('I can see the disabled create successor button of the original class', () => { + classes.isSuccessorButtonDisabled(); }) When('I click the delete button', () => { - groups.clickDeleteButton(); + classes.clickDeleteButton(); }) Then('I can see the delete modal', () => { - groups.isDeleteDialog(); + classes.isDeleteDialog(); }) When('I click the cancel button on the delete modal', () => { - groups.clickCancelDeleteDialogButton(); + classes.clickCancelDeleteDialogButton(); }) When('I click the confirmation button on the delete modal', () => { - groups.clickConfirmDeleteDialogButton(); + classes.clickConfirmDeleteDialogButton(); }) Then('I can see the create class page', () => { - groups.isCreateClassPage(); + classes.isCreateClassPage(); }) When('I click the cancel create class button', () => { - groups.clickCancelButton(); + classes.clickCancelButton(); })