Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/N21-1264-new-class-page-extensio…
Browse files Browse the repository at this point in the history
…n' into N21-1264-new-class-page-extension
  • Loading branch information
MarvinOehlerkingCap committed Oct 20, 2023
2 parents 51dc4e6 + 24eea89 commit 3323cac
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 11 deletions.
19 changes: 15 additions & 4 deletions cypress/e2e/group/showGroupsAndClassesInTable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,29 @@ Feature: Group - To show groups and classes in one table with respective functio
@stable_test
Scenario: As a teacher i can manage my classes
Given I see the new class administration page
When I click the manage icon
When I click the manage button
Then I can see the manage classes page
When I click the cancel manage 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 the manage icon
Then I can see the manage classes page
When I confirm managing the class
When I click the manage button
And I confirm managing the class
Then I see the new class administration page

@stable_test
Scenario: As a teacher i can edit my classes
Given I see the new class administration page
When I click the edit button
Then I can see the edit classes page
When I click the cancel edit 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 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

Scenario: As a teacher i can upgrade my upgradable classes

Expand Down
41 changes: 37 additions & 4 deletions cypress/support/pages/group/pageGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ class Groups {
static #manageConfirm = '[data-testid="manage-confirm"]'
static #classTitleNew = '[data-testid="admin-class-title"]'
static #classTableNew = '[data-testid="admin-class-table"]'
static #manageClassIcon = '[data-testid="class-table-manage-btn"]'
static #manageClassButton = '[data-testid="class-table-manage-btn"]'
static #cancelModal = '[data-testid="modal_content"]'
static #editClassButton = '[data-testid="class-table-edit-btn"]'

clickCreateClass() {
cy.get(Groups.#cretaeClass)
Expand All @@ -23,16 +25,38 @@ class Groups {
.click()
}

clickCancelManageClass() {
clickCancelButton() {
cy.get('.btn-cancel')
.click()
}

clickManageClassIcon() {
cy.get(Groups.#manageClassIcon)
clickManageClassButton() {
cy.get(Groups.#manageClassButton)
.first().click()
}

clickConfirmButton() {
cy.get('.historyback')
.click()
}

clickEditClassButton() {
cy.get(Groups.#editClassButton)
.first().click()
}

clickNameSuffixField() {
cy.get('[name=classsuffix]')
.click()
}

clickSaveChangesButton() {
cy.get('.btn-primary')
.eq(0)
.should('not.be.disabled')
.click()
}

isNewClassAdministrationPage() {
cy.url().should('include', '/administration/groups/classes')
}
Expand All @@ -42,6 +66,15 @@ class Groups {
cy.url().should('include', '/manage')
}

isEditClassPage() {
cy.url().should('include', '/administration/classes')
cy.url().should('include', '/edit')
}

isCancelModal() {
cy.get(Groups.#cancelModal).should('exist')
}

seeNewClassPageTitle() {
cy.get(Groups.#classTitleNew).should('exist')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,42 @@ import Groups from '../../pages/group/pageGroups';

const groups = new Groups()

When('I click the manage icon', () => {
groups.clickManageClassIcon()
When('I click the manage button', () => {
groups.clickManageClassButton()
})

Then('I can see the manage classes page', () => {
groups.isManageClassPage()
})

When('I click the cancel manage class button', () => {
groups.clickCancelManageClass()
groups.clickCancelButton()
})

Then('I can see the cancel modal', () => {
groups.isCancelModal()
})

When('I click the confirmation button on the cancel modal', () => {
groups.clickConfirmButton()
})

When('I click the edit button', () => {
groups.clickEditClassButton()
})

Then('I can see the edit classes page', () => {
groups.isEditClassPage()
})

When('I click the cancel edit class button', () => {
groups.clickCancelButton()
})

When('I click in the name suffix text element', () => {
groups.clickNameSuffixField()
})

Then('I can click on the save changes button', () => {
groups.clickSaveChangesButton()
})

0 comments on commit 3323cac

Please sign in to comment.