Skip to content

Commit

Permalink
adjust for new column, create class via new class page
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorCapCoder committed Oct 24, 2023
1 parent 28bbf8c commit 7c743c5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
13 changes: 10 additions & 3 deletions cypress/e2e/group/showGroupsAndClassesInTable.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions cypress/support/pages/group/pageGroups.js
Original file line number Diff line number Diff line change
@@ -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"]';
Expand Down Expand Up @@ -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);

Expand All @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
})

0 comments on commit 7c743c5

Please sign in to comment.