Skip to content

Commit

Permalink
Merge branch 'main' into BC-5468-refactoring-1PW-access
Browse files Browse the repository at this point in the history
  • Loading branch information
csp175 committed Nov 2, 2023
2 parents 06b5fd9 + c5db9c2 commit 0c985a1
Show file tree
Hide file tree
Showing 21 changed files with 898 additions and 154 deletions.
24 changes: 24 additions & 0 deletions cypress/e2e/course/addCtlToolToCourse.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@release
Feature: Course - To add a ctl tool to a course

As a teacher I want to add a new ctl tool to my course.

@stable_test
Scenario: Student cant see the button to add a tool
Given I am logged in as a 'student2_nbc' at 'nbc'
When I go to rooms overview
When I go to room 'German'
When I click on the tools tab
Then I cant see the button to add a tool

@stable_test
Scenario: Teacher adds a tool to a course
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to rooms overview
When I go to room 'German'
When I click on the tools tab
Then I can see the button to add a tool
When I click on the button to add a tool
Then I can see the tool configuration page title
When I click on the tool configuration selection
Then I can enter 'Test' as tool name in the selection
76 changes: 76 additions & 0 deletions cypress/e2e/course/createEditAndDeleteCourse.feature
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,79 @@ Feature: Course - To add and delete a course by the teacher
Then I see the modal to confirm the deletion
When I click on the button delete on the modal to confirm the course deletion
Then I do not see the course 'Cypress Testkurs Edit' on the room overview page

@stable_test
Scenario: as a pre-condition teacher deletes undeleted tests
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to rooms overview
When I delete all courses named 'Cypress Test Creation and Deletion'
Then I do not see the course 'Cypress Test Creation and Deletion' on the room overview page
When I delete all courses named 'Cypress Testkurs Edit'
Then I do not see the course 'Cypress Testkurs Edit' on the room overview page

@stable_test
Scenario: Create, edit and delete a course with groups of type class in nbc
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to rooms overview
Then I see room search box on the room overview page
When I click on FAB to create a new room
Then I see section one area on the course create page
When I enter the course title 'Cypress Test Creation and Deletion'
When I select room colour as red
Then I see teacher 'Karl Herzog' is selected by default
Then I see substitute teacher selection box
Then I see date pickers to start and end the course as per school year
Then I see button to create a course time table container
When I click on button Next Steps after entering the room detail in section one
Then I see section two area on the course create page
When I click on button Next Steps after selecting room participant details
Then I see the section three area as the finish page
When I click on button To Course Overview on the finish page
Then I see the course 'Cypress Test Creation and Deletion' on the room overview page

# Editing the course
When I go to room 'Cypress Test Creation and Deletion'
When I open course edit page
Then I can see course edit page
When I edit the title of the room to 'Cypress Testkurs Edit'
When I edit the room description to 'cy edit this is test description'

# Add groups to course
When I click on the selection box to add a new group with ' Cypress-Test-Group1 | moin.schule '
When I click on the selection box to add a new group with ' Cypress-Test-Group2 | moin.schule '
When I click on save changes after editing the course details
Then I see the course 'Cypress Testkurs Edit' on the room overview page
When I open course edit page
Then I see ' Cypress-Test-Group1 | moin.schule ' in the class selection box
Then I see 'Kraft, Herbert' in the student selection box

# Remove one group from course
When I click on the remove icon of group ' Cypress-Test-Group2 | moin.schule '
When I click on save changes after editing the course details
Then I see the course 'Cypress Testkurs Edit' on the room overview page
When I open course edit page
Then I see ' Cypress-Test-Group1 | moin.schule ' in the class selection box
Then I do not see ' Cypress-Test-Group2 | moin.schule ' in the group selection box
Then I see 'Kraft, Herbert' in the student selection box
Then I do not see 'Strobl, Amelia' in the student selection box

# Remove second group from course
When I click on the remove icon of group ' Cypress-Test-Group1 | moin.schule '
When I click on save changes after editing the course details
Then I see the course 'Cypress Testkurs Edit' on the room overview page
When I open course edit page
Then I do not see ' Cypress-Test-Group1 | moin.schule ' in the group selection box
Then I do not see ' Cypress-Test-Group2 | moin.schule ' in the group selection box
Then I do not see 'Strobl, Amelia' in the student selection box
Then I do not see 'Kraft, Herbert' in the student selection box
When I click on save changes after editing the course details
Then I see the course 'Cypress Testkurs Edit' on the room overview page


# Deleting the course/room created in this feature test
When I open course edit page
When I click on the button delete course
Then I see the modal to confirm the deletion
When I click on the button delete on the modal to confirm the course deletion
Then I do not see the course 'Cypress Testkurs Edit' on the room overview page

File renamed without changes.
20 changes: 20 additions & 0 deletions cypress/e2e/group/groupMembers.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@release
Feature: Group - To show members in a group

As a teacher I want to see the members in a group

@stable_test
Scenario: As a teacher I can manage a group of type class from external systems
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
Then I see the new class administration page
And I can see the group 'Cypress-Test-Group' with source 'moin.schule'
And the group 'Cypress-Test-Group' has a manage button
When I click the manage group button
Then I can see the manage group page
And I can see the manage group page title
And I can see the group member table
And I can see the 'Lehrkraft' with name 'Herzog'
And I can see the infobox
And I can see the infotext
83 changes: 83 additions & 0 deletions cypress/e2e/group/showGroupsAndClassesInTable.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@release
Feature: Group - To show groups and classes in one table with respective functionality

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
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 click on the confirm button
And 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

@stable_test
Scenario: As a teacher i can manage my classes
Given I see the new class administration page
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 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

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

@stable_test
Scenario: As a teacher i can delete my classes
Given I see the new class administration page
When I click the delete button
Then I can see the delete modal
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
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
Then I see the new class administration page
16 changes: 16 additions & 0 deletions cypress/e2e/topics/accessH5PEditor.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@release
Feature: To access the H5P editor as a teacher.

As a teacher, I want to be able to access the H5P Editor for a topic in my course to create learning content

@stable_test
Scenario: Access H5P Editor
Given I am logged in as a 'teacher1_dbc' at 'default'
When I go to rooms overview
When I go to room 'Course with subject and tasks'
When I click on topic 'Statistic' on course page
When I click on the button Edit on topic page
When I click on the Add Content H5P button
Then I can click on the Create H5P button


8 changes: 8 additions & 0 deletions cypress/support/custom_commands/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ Cypress.Commands.add('login', (username, environment) => {
userEmail = 'ADMIN_1_BRB_EMAIL'
userPassword = 'ADMIN_1_BRB_PASSWORD'
break
case 'teacher1_nbc':
userEmail = 'TEACHER_1_NBC_EMAIL'
userPassword = 'TEACHER_1_NBC_PASSWORD'
break
case 'student2_nbc':
userEmail = 'STUDENT_2_NBC_EMAIL'
userPassword = 'STUDENT_2_NBC_PASSWORD'
break
case 'admin1_nbc':
userEmail = 'ADMIN_1_NBC_EMAIL'
userPassword = 'ADMIN_1_NBC_PASSWORD'
Expand Down
119 changes: 0 additions & 119 deletions cypress/support/pages/account/pageAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,6 @@ class Account {
static #settingsButton = '[data-testid="settings"]'
static #email = '[data-testid="user_email"]'
static #emailReadOnly = '[data-testid="user_email_readonly"]'
static #languageMenu = '#language-menu'
static #selectedLanguage = '#selected-language'
static #listOfAllLanguages = '#available-languages'
static #germanLanguage = '[data-testid="available-language-de"]'
static #spanishLanguage = '[data-testid="available-language-es"]'
static #ukrainianLanguage = '[data-testid="available-language-uk"]'
static #englishLanguage = '[data-testid="available-language-en"]'
static #pageTitle = '#page-title'

static #testAssertionData = {
german: 'Deutsch',
spanish: 'Español',
ukrainian: 'Yкраїнська',
english: 'English',
overviewInGerman: 'Übersicht',
overviewInSpanish: 'Panel',
overviewInUkrainian: 'Панель керування',
overviewInEnglish: 'Dashboard'
}

navigateToAccountSettingsSection () {
cy.get(Account.#initialsButton).click()
Expand All @@ -40,105 +21,5 @@ class Account {
cy.get(Account.#emailReadOnly).should('have.attr', 'readonly')
}
}

assertNameInitialsIsVisible () {
cy.get(Account.#initialsButton).should('be.visible')
}

clickInitialsOfName () {
cy.get(Account.#initialsButton)
.should('be.visible')
.then($btn => {
if ($btn.is(':disabled')) {
cy.log('Button exists and is disabled!')
return
} else {
cy.log('Button exists and is enabled!')
cy.wrap($btn).click()
}
})
}

clickLanguagesDropDownMenu () {
cy.get(Account.#languageMenu)
.should('be.visible')
.click()
.then(() => {
cy.get(Account.#selectedLanguage).should('be.visible')
cy.get(Account.#listOfAllLanguages).find('li').each($element => {
cy.get($element).should('have.prop', 'value')
cy.get($element).should('be.visible')
})
})
}

changeLanguage (language) {
if (language === 'german') {
return this.selectLanguage(
Account.#germanLanguage,
Account.#testAssertionData.german
)
}

if (language === 'spanish') {
return this.selectLanguage(
Account.#spanishLanguage,
Account.#testAssertionData.spanish
)
}

if (language === 'ukrainian') {
return this.selectLanguage(
Account.#ukrainianLanguage,
Account.#testAssertionData.ukrainian
)
}

return this.selectLanguage(
Account.#englishLanguage,
Account.#testAssertionData.english
)
}

selectLanguage (sel, language) {
return cy.contains(sel, language)
.should('be.visible')
.click()
.wait(['@alerts_api'])
}

assertLanguageUpdate (updatedText) {
cy.wait(300)
.get(Account.#pageTitle)
.invoke('text')
.should('eq', updatedText)
cy.get(Account.#pageTitle)
.invoke('attr', 'data-testid')
.should('eq', updatedText)
}

verifyLanguageChanged (language) {
if (language === 'german') {
return this.assertLanguageUpdate(
Account.#testAssertionData.overviewInGerman
)
}

if (language === 'spanish') {
return this.assertLanguageUpdate(
Account.#testAssertionData.overviewInSpanish
)
}

if (language === 'ukrainian') {
return this.assertLanguageUpdate(
Account.#testAssertionData.overviewInUkrainian
)
}

return this.assertLanguageUpdate(
Account.#testAssertionData.overviewInEnglish
)
}
}
export default Account
6 changes: 6 additions & 0 deletions cypress/support/pages/admin/pageAdministration.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Management {
static #teacherAdministrationNavigationButton = '[data-testid="Lehrkräfte"]'
static #courseAdministrationNavigationButton = '[data-testid="Kurse"]'
static #classAdministrationNavigationButton = '[data-testid="Klassen"]'
static #newClassAdministrationNavigationButton = '[data-testid="administrate_classes_new"]'
static #teamAdministrationNavigationButton = '[data-testid="Teams"]'
static #schoolAdministrationNavigationButton = '[data-testid="Schule"]'
static #studentTeamCheckbox = '[data-testid="student_team_checkbox"]'
Expand Down Expand Up @@ -124,6 +125,11 @@ class Management {
cy.url().should('include', '/administration/classes')
}

navigateToNewClassAdministration() {
cy.get(Management.#newClassAdministrationNavigationButton).click()
cy.url().should('include', '/administration/groups/classes')
}

navigateToTeamAdministration() {
cy.get(Management.#teamAdministrationNavigationButton).eq(1).click()
cy.url().should('include', '/administration/teams')
Expand Down
Loading

0 comments on commit 0c985a1

Please sign in to comment.