Skip to content

Commit

Permalink
add test for legacy functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorCapCoder committed Nov 6, 2023
1 parent 62a8df0 commit b54dab9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,10 @@ Feature: Group - To show groups and classes in one table with respective functio
When I click the delete button
When I click the confirmation button on the delete modal
Then I see the new class administration page

Scenario: As a teacher i can not see the new class page, when the feature flag is off
Given I am logged in as a 'teacher1_dbc' at 'default'
When I go to administration page
Then I cannot see the new class administration page
When I navigate to class administration page
Then I cannot see the source header in the table
12 changes: 12 additions & 0 deletions cypress/support/pages/class_management/pageClasses.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class Classes {
static #classMemberInfoBox = '[data-testid="class-members-info-box"]';
static #classMemberInfoBoxText = '[data-testid="class-members-info-box-text"]';
static #manageGroupButton = '[data-testid="class-table-members-manage-btn"]';
static #adminClassNavigationSidebarCard = '[data-testid="Klassen"]';
static #adminClassNavigationCard = '[data-testid="administrate_classes"]'
static #legacyClassTable = '[data-testid="table_container"]'

clickCreateClass() {
cy.get(Classes.#createClass)
Expand Down Expand Up @@ -215,6 +218,15 @@ class Classes {
seeClassMemberInfoBoxText() {
cy.get(Classes.#classMemberInfoBoxText).should('be.visible')
}

seeNoNewClassAdministrationPage() {
cy.get(Classes.#adminClassNavigationSidebarCard).should('not.have.attr', 'href', '/administration/groups/classes')
cy.get(Classes.#adminClassNavigationCard).should('not.have.attr', 'data-loclink', '/administration/groups/classes')
}

seeNoSourceHeader() {
cy.get(Classes.#legacyClassTable).find('th').should('not.contain', 'source');
}
}

export default Classes
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,15 @@ Then('I can see 5 columns in the table', () => {
Then('I can see 3 tabs', () => {
classes.see3Tabs();
})

Then('I cannot see the new class administration page', () => {
classes.seeNoNewClassAdministrationPage();
})

When('I navigate to class administration page', () => {
management.navigateToClassAdministration();
})

Then('I cannot see the source header in the table', () => {
classes.seeNoSourceHeader();
})

0 comments on commit b54dab9

Please sign in to comment.