Skip to content

Commit

Permalink
BC-6085 - Investigate - Test fails after log out step (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
UzaeirKhan authored Jan 26, 2024
1 parent 4221a4d commit d548a12
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 56 deletions.
2 changes: 1 addition & 1 deletion cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = defineConfig({
viewportHeight: 768,
videoCompression: 18,
video: true,
chromeWebSecurity: true,
chromeWebSecurity: false,
pageLoadTimeout: 80000,
defaultCommandTimeout: 80000,
requestTimeout: 60000,
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/admin/administrateUsers.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Feature: Admin Users - To add, edit and delete new users by the admin.

@stable_test
Scenario: Editing a new student
Given I am logged in as a 'admin1_brb' at 'brb'
When I go to administration page
And I go to student administration
And I enter 'student' email '[email protected]' in search input field
Expand All @@ -29,7 +28,6 @@ Feature: Admin Users - To add, edit and delete new users by the admin.

@stable_test
Scenario: Deleting a student
Given I am logged in as a 'admin1_brb' at 'brb'
When I go to administration page
And I go to student administration
And I enter 'student' email '[email protected]' in search input field
Expand All @@ -40,7 +38,6 @@ Feature: Admin Users - To add, edit and delete new users by the admin.

@stable_test
Scenario: Adding a new teacher
Given I am logged in as a 'admin1_brb' at 'brb'
When I go to administration page
And I go to teacher administration
When I click on FAB
Expand All @@ -51,7 +48,6 @@ Feature: Admin Users - To add, edit and delete new users by the admin.

@stable_test
Scenario: Editing a new teacher
Given I am logged in as a 'admin1_brb' at 'brb'
When I go to administration page
And I go to teacher administration
And I enter 'teacher' email '[email protected]' in search input field
Expand All @@ -64,7 +60,6 @@ Feature: Admin Users - To add, edit and delete new users by the admin.

@stable_test
Scenario: Deleting a teacher
Given I am logged in as a 'admin1_brb' at 'brb'
When I go to administration page
And I go to teacher administration
And I enter 'teacher' email '[email protected]' in search input field
Expand Down
1 change: 0 additions & 1 deletion cypress/e2e/course/addSubstituteTeacherToCourse.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Feature: Course - Add substitute teacher to course
And I clear substitute teacher field
And I add substitute teacher 'teacher2'
And I click on save changes after editing the course details
Then I log out
Given I am logged in as a 'teacher2_brb' at 'brb'
When I go to rooms overview
When I go to room 'Biologie'
2 changes: 0 additions & 2 deletions cypress/e2e/course/createEditAndDeleteCourse.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Feature: Course - To add and delete a course by the teacher


Scenario: Create, edit and delete a course
Given I am logged in as a 'teacher1_dbc' at 'dbc'
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
Expand Down Expand Up @@ -61,7 +60,6 @@ Feature: Course - To add and delete a course by the teacher


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
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/course/searchRoom.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Feature: Course - To search for a course via search input box on the course over

@stable_test
Scenario: teacher is able to search for a course and DO NOT find it
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to rooms overview
When I enter the course name 'Cy::NotExistingMathematikCourse' into the search field
Then I do not see the course 'Cy::NotExistingMathematikCourse' on the room overview page
Expand All @@ -26,7 +25,6 @@ Feature: Course - To search for a course via search input box on the course over

@stable_test
Scenario: student is able to search for a course and DO NOT find it
Given I am logged in as a 'student1_brb' at 'brb'
When I go to rooms overview
When I enter the course name 'Cy::NotExistingMathematikCourse' into the search field
Then I do not see the course 'Cy::NotExistingMathematikCourse' on the room overview page
4 changes: 0 additions & 4 deletions cypress/e2e/dashboard/dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Feature: Dashboard - To check contents on the dashboard

@stable_test
Scenario: as a pre-condition teacher creates a team news
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to teams overview
When I go to a team 'Musik'
When I click on news tab on the team detail page
Expand All @@ -33,7 +32,6 @@ Feature: Dashboard - To check contents on the dashboard

@stable_test
Scenario: as a pre-condition teacher adds student as team member
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to teams overview
When I go to a team 'Musik'
When I click on three dot menu on the team title
Expand Down Expand Up @@ -65,7 +63,6 @@ Feature: Dashboard - To check contents on the dashboard

@stable_test
Scenario: as a post-condition teacher deletes the school news
Given I am logged in as a 'teacher1_brb' at 'brb'
When I arrive on the dashboard
And I click on the news teaser 'Dashboard - this is a school news'
When I click on delete button
Expand All @@ -74,7 +71,6 @@ Feature: Dashboard - To check contents on the dashboard

@stable_test
Scenario: as a post-condition teacher deletes the team news
Given I am logged in as a 'teacher1_brb' at 'brb'
When I arrive on the dashboard
And I click on the news teaser 'Dashboard - this is a team news'
When I click on delete button
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/files/myFiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Feature: Files Overview - To use LibreOffice for text, calc and presentation doc

@stable_test
Scenario: Edit name of LibreOffice text document
Given I am logged in as a 'student1_brb' at 'brb'
When I go to files overview
Then I go to personal files overview
Then I can see file with name 'Cy: LibraOffice Open.docx'
Expand All @@ -30,7 +29,6 @@ Feature: Files Overview - To use LibreOffice for text, calc and presentation doc

@stable_test
Scenario: Delete a LibreOffice text document
Given I am logged in as a 'student1_brb' at 'brb'
When I go to files overview
Then I go to personal files overview
Then I can see file with name 'Cy: LibraOffice Edit.docx'
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/help-section/helpAreas.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Feature: Help Section - To use the help areas in dBildungscloud

@stable_test
Scenario: Use the help area in the sidebar
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to help section in sidebar
Then I can see the help articles page
When I go to help articles in sidebar
Expand All @@ -30,15 +29,13 @@ Feature: Help Section - To use the help areas in dBildungscloud

@stable_test
Scenario: Use the article search inside the help articles area
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to help section in sidebar
Then I can see the help articles page
When I enter keyword in search bar
Then I can see an help article related to my search

@stable_test
Scenario: Submit an issue via contact form inside help area
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to help section in sidebar
When I go to contact in sidebar
Then I can see the help contact page
Expand Down
14 changes: 7 additions & 7 deletions cypress/e2e/learning_store/manageAccessToLearningstore.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ Feature: Learning store - Activating and deactivating access for students

@stable_test
Scenario Outline: Admin activates and deactivates students access to Learning store
# Admin deactivates students access to Learning store - pre-condition to set the needed configuration
# Admin deactivates students access to Learning store - pre-condition to set the needed configuration
Given I am logged in as a '<admin>' at '<namespace>'
When I go to administration page
When I go to school administration
When I click the checkbox to disable students access to learning store
When I click on admin setting save button
Then I see checkbox to enable students access to learning store is unchecked
# Student doesn't see link to Learning store in menu
# Student doesn't see link to Learning store in menu
Given I am logged in as a '<student>' at '<namespace>'
Then I do not see Learning Store in side bar
# Admin activates students access to Learning store
# Admin activates students access to Learning store
Given I am logged in as a '<admin>' at '<namespace>'
When I go to administration page
When I go to school administration
When I click the checkbox to enable students access to learning store
When I click on admin setting save button
# Student sees link to Learning store in menu
# Student sees link to Learning store in menu
Given I am logged in as a '<student>' at '<namespace>'
Then I see Learning Store in side bar
When I go to Learning Store overview
# Admin deactivates students access to Learning store again (tests change from access to no-access)
# Admin deactivates students access to Learning store again (tests change from access to no-access)
Given I am logged in as a '<admin>' at '<namespace>'
When I go to administration page
When I go to school administration
When I click the checkbox to disable students access to learning store
When I click on admin setting save button
# Student doesn't see link to Learning store in menu
# Student doesn't see link to Learning store in menu
Given I am logged in as a '<student>' at '<namespace>'
Then I do not see Learning Store in side bar


Examples:
| admin | namespace | student |
| admin | namespace | student |
| admin1_brb | brb | student1_brb |
9 changes: 2 additions & 7 deletions cypress/e2e/news/readNews.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ Feature: News - To read a news on the respective dashboards
And I click on save button
Then I see news is created successfully with title 'News - this is a school news' and with description 'school news description'

@stable_test
@stable_test
Scenario: as a pre-condition teacher creates a team news
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to teams overview
When I go to a team 'Musik'
When I click on news tab on the team detail page
Expand All @@ -33,21 +32,18 @@ Feature: News - To read a news on the respective dashboards

@stable_test
Scenario: Reading a school news on news overview page
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to news overview
Then I can read the news 'News - this is a school news' with description 'school news description'

@stable_test
Scenario: Reading a team news on teams news overview page
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to teams overview
When I go to a team 'Musik'
When I click on news tab on the team detail page
Then I can read the news 'News - this is a team news' with description 'test team news description'

@stable_test
@stable_test
Scenario: as a post-condition teacher deletes the school news
Given I am logged in as a 'teacher1_brb' at 'brb'
When I arrive on the dashboard
And I click on the news teaser 'News - this is a school news'
When I click on delete button
Expand All @@ -56,7 +52,6 @@ Feature: News - To read a news on the respective dashboards

@stable_test
Scenario: as a post-condition teacher deletes the team news
Given I am logged in as a 'teacher1_brb' at 'brb'
When I arrive on the dashboard
And I click on the news teaser 'News - this is a team news'
When I click on delete button
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/task/createDeleteTaskFromTaskPage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Feature: Task - To create and delete tasks starting from task overview page by t

@stable_test
Scenario: Teacher deletes a simple task without course using the dot menu
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to tasks overview
When I click on draft tasks tab
When I click on three dot menu of task 'Cy Task Creating from Task Overview Test'
Expand All @@ -45,7 +44,6 @@ Feature: Task - To create and delete tasks starting from task overview page by t

@stable_test
Scenario: Teacher deletes a simple task without course using the delete button on the task edit page
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to tasks overview
When I click on draft tasks tab
When I click on task 'Cy Task to be delete on task page' in tasks overview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Feature: Task - To create, edit and delete tasks by the teacher.

@stable_test
Scenario: Teacher edits and publishes task from room via form
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to rooms overview
When I go to room 'Course with subject and tasks'
When I click on three dot menu of content 'Cy Task Creating and Deleting Test'
Expand Down Expand Up @@ -63,7 +62,6 @@ Feature: Task - To create, edit and delete tasks by the teacher.

@stable_test
Scenario: Teacher edits file
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to rooms overview
When I go to room 'Course with subject and tasks'
When I click on three dot menu of content 'Cy Task Creating, Editing, Deleting Test'
Expand Down Expand Up @@ -164,7 +162,6 @@ Feature: Task - To create, edit and delete tasks by the teacher.

@stable_test
Scenario: Teacher restores the finished task from room
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to tasks overview
# And I open task list with due date // Icon to open this is only available if there are other tasks with due date (not guaranteed in environment)
Then I do not see task 'Cy Task Creating, Editing, Deleting Test' in the list as teacher
Expand All @@ -183,7 +180,6 @@ Feature: Task - To create, edit and delete tasks by the teacher.

@stable_test
Scenario: Teacher deletes task from room
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to rooms overview
When I go to room 'Course with subject and tasks'
When I click on three dot menu of content 'Cy Task Creating, Editing, Deleting Test'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Feature: Team - Teacher adds edits and deletes team event with video conference

@stable_test
Scenario: as a pre-condition teacher adds student as an internal team member
Given I am logged in as a 'teacher1_dbc' at 'dbc'
When I go to teams overview
When I go to a team 'Musik'
When I click on three dot menu on the team title
Expand All @@ -35,8 +34,7 @@ Feature: Team - Teacher adds edits and deletes team event with video conference
Then I see the student named 'Herbert Kraft' on the team members table

@stable_test
Scenario: Teacher adds event with video conference
Given I am logged in as a 'teacher1_dbc' at 'dbc'
Scenario: Teacher adds event with video conference
When I go to teams overview
When I go to a team 'Musik'
When I go to calendar tab
Expand All @@ -55,7 +53,6 @@ Feature: Team - Teacher adds edits and deletes team event with video conference
When I click on start video conference button as a moderator teacher
Then I see the modal and toggles are visible in the modal
Then I start the team video conference which has title 'cy title'
Then I log out

@stable_test
Scenario: Student can see and participate in video conference
Expand All @@ -78,7 +75,6 @@ Feature: Team - Teacher adds edits and deletes team event with video conference

@stable_test
Scenario: as a post condition Teacher edits and deletes the event
Given I am logged in as a 'teacher1_dbc' at 'dbc'
When I go to teams overview
When I go to a team 'Musik'
When I go to calendar tab
Expand All @@ -94,7 +90,6 @@ Feature: Team - Teacher adds edits and deletes team event with video conference
When I click on Delete team event in modal
Then I am in calendar tab on team detail page and title is NOT visible


@stable_test
Scenario: as a post condition Admin disable the video conference for the team
Given I am logged in as a 'admin1_dbc' at 'dbc'
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/teams/teacherCreateEditDeleteTeam.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Feature: Team - Create, delete and edit operations on Teams

@stable_test
Scenario: Editing the newly created team by Teacher
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to teams overview
When I go to a team 'cy test team to test create edit delete team'
When I click on team settings
Expand All @@ -34,7 +33,6 @@ Feature: Team - Create, delete and edit operations on Teams

@stable_test
Scenario: Deleting the newly created team by Teacher
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to teams overview
When I go to a team 'edited cy test team to test create edit delete team'
When I click on team settings
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/topics/createEditDeleteTopic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Feature: Topics - To create, edit and delete topics by the teacher.

@stable_test
Scenario: Teacher edits topic from room
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to rooms overview
When I go to room 'Course with subject and tasks'
When I click on three dot menu of topic 'Cy Topic Creating and Deleting Test'
Expand Down Expand Up @@ -82,7 +81,6 @@ Feature: Topics - To create, edit and delete topics by the teacher.

@stable_test
Scenario: Teacher deletes topic from room
Given I am logged in as a 'teacher1_brb' at 'brb'
When I go to rooms overview
When I go to room 'Course with subject and tasks'
When I click on three dot menu of topic 'Cy Topic Creating and Deleting Test - Edited topic'
Expand Down
10 changes: 4 additions & 6 deletions cypress/support/custom_commands/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ Cypress.Commands.add('login', (username, environment) => {
const environmentUpperCased = environment.toUpperCase()
const link = Cypress.config('baseUrl', env[environmentUpperCased])
cy.log(link)
cy.visit('/login')
if (environmentUpperCased === 'NBC') {
cy.visit('/login')
cy.get(nbcLoginWithEmailOptionButton).click()
} else if (environmentUpperCased === 'DBC') {
cy.visit('/login')
} else {
cy.visit('/login')
}

let userEmail
Expand Down Expand Up @@ -98,7 +94,9 @@ Cypress.Commands.add('login', (username, environment) => {
})
} else {
cy.get(emailInputFieldElement).type(env[userEmail], { log: false })
cy.get(passwordInputFieldElement).type(env[userPassword], { log: false })
cy.get(passwordInputFieldElement).type(env[userPassword], {
log: false
})
cy.get(submitButton).click()
}
cy.url().should('contain', '/dashboard')
Expand Down

0 comments on commit d548a12

Please sign in to comment.