From 321453611a79969825bedf152d16096fb24dae8a Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Thu, 30 Mar 2023 20:25:39 +0200 Subject: [PATCH 01/24] isolate dashboard tests --- cypress.config.js | 3 ++- cypress/e2e/dashboard/dashboard.feature | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index c2ae8323..e2f0ff7e 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -10,13 +10,14 @@ module.exports = defineConfig({ requestTimeout: 60000, responseTimeout: 60000, e2e: { - // this config comes dusring v12 update + // this config comes during v12 update // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, + testIsolation: true, specPattern: 'cypress/e2e/**/*.feature', }, }); diff --git a/cypress/e2e/dashboard/dashboard.feature b/cypress/e2e/dashboard/dashboard.feature index b1ce9aef..09587e22 100644 --- a/cypress/e2e/dashboard/dashboard.feature +++ b/cypress/e2e/dashboard/dashboard.feature @@ -3,6 +3,7 @@ Feature: Dashboard - To check contents on the dashboard As a student and a teacher I want to see important information on the dashboard so that I can be updated start working + @only Scenario: as a pre-condition teacher creates school news Given I am logged in as a 'teacher' at 'brb' When I go to news overview @@ -15,6 +16,7 @@ Feature: Dashboard - To check contents on the dashboard And I click on save button Then I see news is created successfully with title 'Dashboard - this is a school news' and with description 'test school news description' + @only Scenario: as a pre-condition teacher creates a team news Given I am logged in as a 'teacher' at 'brb' When I go to teams overview @@ -29,6 +31,7 @@ Feature: Dashboard - To check contents on the dashboard And I click on save button Then I see news is created successfully with title 'Dashboard - this is a team news' and with description 'test team news description' + @only Scenario: as a pre-condition teacher adds student as team member Given I am logged in as a 'teacher' at 'brb' When I go to teams overview @@ -40,6 +43,7 @@ Feature: Dashboard - To check contents on the dashboard And I click on add user button Then I see the student named 'Herbert Kraft' on the team members table + @only Scenario: student arrives on dashboard Given I am logged in as a 'student' at 'brb' When I arrive on the dashboard @@ -48,6 +52,7 @@ Feature: Dashboard - To check contents on the dashboard Then I see teams news with title 'Dashboard - this is a team news' and description 'test team news description' Then I can see the assigned task 'Task11' + @only Scenario: teacher arrives on dashboard Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -57,6 +62,7 @@ Feature: Dashboard - To check contents on the dashboard Then I can see the assigned task 'Task11' Then I can see the draft task 'Task1' + @only Scenario: as a post-condition teacher deletes the school news Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -65,6 +71,7 @@ Feature: Dashboard - To check contents on the dashboard And I confirm the deletion on confirmation dialog box Then I do not see the news 'Dashboard - this is a school news' + @only Scenario: as a post-condition teacher deletes the team news Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -73,12 +80,14 @@ Feature: Dashboard - To check contents on the dashboard And I confirm the deletion on confirmation dialog box Then I do not see the news 'Dashboard - this is a team news' + @only Scenario: student does not see news anymore on dashboard Given I am logged in as a 'student' at 'brb' When I arrive on the dashboard Then I do not see school news with title 'Dashboard - this is a school news' Then I do not see teams news with title 'Dashboard - this is a team news' + @only Scenario: as a post-condition teacher deletes the student as a team member Given I am logged in as a 'teacher' at 'brb' When I go to teams overview @@ -86,4 +95,4 @@ Feature: Dashboard - To check contents on the dashboard And I click on three dot menu on the team title And I click on manage team members option When I select the student 'Herbert Kraft' and click on delete icon - Then I see 'Herbert Kraft' is not visible on the table \ No newline at end of file + Then I see 'Herbert Kraft' is not visible on the table From e58faf004fe2da9080e00ea0dd7170fd632511a2 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Sun, 2 Apr 2023 16:39:52 +0200 Subject: [PATCH 02/24] add isolated tag to dashboard scenarios --- cypress/e2e/dashboard/dashboard.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/dashboard/dashboard.feature b/cypress/e2e/dashboard/dashboard.feature index 09587e22..9e66fe2a 100644 --- a/cypress/e2e/dashboard/dashboard.feature +++ b/cypress/e2e/dashboard/dashboard.feature @@ -3,7 +3,7 @@ Feature: Dashboard - To check contents on the dashboard As a student and a teacher I want to see important information on the dashboard so that I can be updated start working - @only + @isolated Scenario: as a pre-condition teacher creates school news Given I am logged in as a 'teacher' at 'brb' When I go to news overview @@ -16,7 +16,7 @@ Feature: Dashboard - To check contents on the dashboard And I click on save button Then I see news is created successfully with title 'Dashboard - this is a school news' and with description 'test school news description' - @only + @isolated Scenario: as a pre-condition teacher creates a team news Given I am logged in as a 'teacher' at 'brb' When I go to teams overview @@ -31,7 +31,7 @@ Feature: Dashboard - To check contents on the dashboard And I click on save button Then I see news is created successfully with title 'Dashboard - this is a team news' and with description 'test team news description' - @only + @isolated Scenario: as a pre-condition teacher adds student as team member Given I am logged in as a 'teacher' at 'brb' When I go to teams overview @@ -43,7 +43,7 @@ Feature: Dashboard - To check contents on the dashboard And I click on add user button Then I see the student named 'Herbert Kraft' on the team members table - @only + @isolated Scenario: student arrives on dashboard Given I am logged in as a 'student' at 'brb' When I arrive on the dashboard @@ -52,7 +52,7 @@ Feature: Dashboard - To check contents on the dashboard Then I see teams news with title 'Dashboard - this is a team news' and description 'test team news description' Then I can see the assigned task 'Task11' - @only + @isolated Scenario: teacher arrives on dashboard Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -62,7 +62,7 @@ Feature: Dashboard - To check contents on the dashboard Then I can see the assigned task 'Task11' Then I can see the draft task 'Task1' - @only + @isolated Scenario: as a post-condition teacher deletes the school news Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -71,7 +71,7 @@ Feature: Dashboard - To check contents on the dashboard And I confirm the deletion on confirmation dialog box Then I do not see the news 'Dashboard - this is a school news' - @only + @isolated Scenario: as a post-condition teacher deletes the team news Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -80,14 +80,14 @@ Feature: Dashboard - To check contents on the dashboard And I confirm the deletion on confirmation dialog box Then I do not see the news 'Dashboard - this is a team news' - @only + @isolated Scenario: student does not see news anymore on dashboard Given I am logged in as a 'student' at 'brb' When I arrive on the dashboard Then I do not see school news with title 'Dashboard - this is a school news' Then I do not see teams news with title 'Dashboard - this is a team news' - @only + @isolated Scenario: as a post-condition teacher deletes the student as a team member Given I am logged in as a 'teacher' at 'brb' When I go to teams overview From 0e5a213f3aace462edd08a890bddbb8a7564a9c5 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Sun, 2 Apr 2023 22:40:31 +0200 Subject: [PATCH 03/24] add wait when page is reloaded --- cypress/e2e/dashboard/dashboard.feature | 11 +---------- cypress/support/pages/news/pageNews.js | 10 +++++----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/cypress/e2e/dashboard/dashboard.feature b/cypress/e2e/dashboard/dashboard.feature index 9e66fe2a..e53f6511 100644 --- a/cypress/e2e/dashboard/dashboard.feature +++ b/cypress/e2e/dashboard/dashboard.feature @@ -3,7 +3,6 @@ Feature: Dashboard - To check contents on the dashboard As a student and a teacher I want to see important information on the dashboard so that I can be updated start working - @isolated Scenario: as a pre-condition teacher creates school news Given I am logged in as a 'teacher' at 'brb' When I go to news overview @@ -16,7 +15,6 @@ Feature: Dashboard - To check contents on the dashboard And I click on save button Then I see news is created successfully with title 'Dashboard - this is a school news' and with description 'test school news description' - @isolated Scenario: as a pre-condition teacher creates a team news Given I am logged in as a 'teacher' at 'brb' When I go to teams overview @@ -31,7 +29,6 @@ Feature: Dashboard - To check contents on the dashboard And I click on save button Then I see news is created successfully with title 'Dashboard - this is a team news' and with description 'test team news description' - @isolated Scenario: as a pre-condition teacher adds student as team member Given I am logged in as a 'teacher' at 'brb' When I go to teams overview @@ -43,7 +40,6 @@ Feature: Dashboard - To check contents on the dashboard And I click on add user button Then I see the student named 'Herbert Kraft' on the team members table - @isolated Scenario: student arrives on dashboard Given I am logged in as a 'student' at 'brb' When I arrive on the dashboard @@ -52,7 +48,6 @@ Feature: Dashboard - To check contents on the dashboard Then I see teams news with title 'Dashboard - this is a team news' and description 'test team news description' Then I can see the assigned task 'Task11' - @isolated Scenario: teacher arrives on dashboard Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -62,7 +57,6 @@ Feature: Dashboard - To check contents on the dashboard Then I can see the assigned task 'Task11' Then I can see the draft task 'Task1' - @isolated Scenario: as a post-condition teacher deletes the school news Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -71,7 +65,6 @@ Feature: Dashboard - To check contents on the dashboard And I confirm the deletion on confirmation dialog box Then I do not see the news 'Dashboard - this is a school news' - @isolated Scenario: as a post-condition teacher deletes the team news Given I am logged in as a 'teacher' at 'brb' When I arrive on the dashboard @@ -80,14 +73,12 @@ Feature: Dashboard - To check contents on the dashboard And I confirm the deletion on confirmation dialog box Then I do not see the news 'Dashboard - this is a team news' - @isolated Scenario: student does not see news anymore on dashboard Given I am logged in as a 'student' at 'brb' When I arrive on the dashboard Then I do not see school news with title 'Dashboard - this is a school news' Then I do not see teams news with title 'Dashboard - this is a team news' - - @isolated + Scenario: as a post-condition teacher deletes the student as a team member Given I am logged in as a 'teacher' at 'brb' When I go to teams overview diff --git a/cypress/support/pages/news/pageNews.js b/cypress/support/pages/news/pageNews.js index 05ea50a0..162a0a1e 100644 --- a/cypress/support/pages/news/pageNews.js +++ b/cypress/support/pages/news/pageNews.js @@ -33,17 +33,17 @@ class News { confirmDeletionOnDialogBox () { cy.get(News.#deleteNewsConfirmation) .contains('Löschen') - .click() + .click().wait(3000) } clickOnDeleteNewsButton () { - cy.get(News.#deleteNews).click() + cy.get(News.#deleteNews).click().wait(3000) } openNewsDetailPage (newsName) { cy.get(News.#newsName) .contains(newsName) - .click() + .click().wait(3000) } seeCreatedNews (newsTitle, newsDesc) { @@ -55,7 +55,7 @@ class News { clickOnCreateNewsSaveButton () { cy.get(News.#newsCreateButton) - .click() + .click().wait(3000) } seeTimeInput () { @@ -99,4 +99,4 @@ class News { cy.get(News.#newsText).contains(descriptionOfNews).should('exist') } } -export default News \ No newline at end of file +export default News From aee93db86f403fc1a8dbb7f6929f7672465b1fef Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 3 Apr 2023 08:06:28 +0200 Subject: [PATCH 04/24] add timeout to get methods --- cypress/e2e/dashboard/dashboard.feature | 2 +- cypress/support/pages/news/pageNews.js | 26 ++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cypress/e2e/dashboard/dashboard.feature b/cypress/e2e/dashboard/dashboard.feature index e53f6511..e27b0acf 100644 --- a/cypress/e2e/dashboard/dashboard.feature +++ b/cypress/e2e/dashboard/dashboard.feature @@ -78,7 +78,7 @@ Feature: Dashboard - To check contents on the dashboard When I arrive on the dashboard Then I do not see school news with title 'Dashboard - this is a school news' Then I do not see teams news with title 'Dashboard - this is a team news' - + Scenario: as a post-condition teacher deletes the student as a team member Given I am logged in as a 'teacher' at 'brb' When I go to teams overview diff --git a/cypress/support/pages/news/pageNews.js b/cypress/support/pages/news/pageNews.js index 162a0a1e..d83388dd 100644 --- a/cypress/support/pages/news/pageNews.js +++ b/cypress/support/pages/news/pageNews.js @@ -31,39 +31,39 @@ class News { } confirmDeletionOnDialogBox () { - cy.get(News.#deleteNewsConfirmation) + cy.get(News.#deleteNewsConfirmation, { timeout: 20000 }) .contains('Löschen') .click().wait(3000) } clickOnDeleteNewsButton () { - cy.get(News.#deleteNews).click().wait(3000) + cy.get(News.#deleteNews, { timeout: 20000 }).click().wait(3000) } - openNewsDetailPage (newsName) { - cy.get(News.#newsName) + wopenNewsDetailPage (newsName) { + cy.get(News.#newsName, { timeout: 20000 }) .contains(newsName) .click().wait(3000) } seeCreatedNews (newsTitle, newsDesc) { - cy.get(News.#newsTitle) + cy.get(News.#newsTitle, { timeout: 20000 }) .contains(newsTitle) cy.get(News.#newsDescriptionVisible) - .contains(newsDesc) + .contains(newsDesc, { timeout: 20000 }) } clickOnCreateNewsSaveButton () { - cy.get(News.#newsCreateButton) + cy.get(News.#newsCreateButton, { timeout: 20000 }) .click().wait(3000) } seeTimeInput () { - cy.get(News.#newsTimeInput).should('exist') + cy.get(News.#newsTimeInput, { timeout: 20000 }).should('exist') } seeDateInput () { - cy.get(News.#newsDateInput).should('exist') + cy.get(News.#newsDateInpu, { timeout: 20000 }).should('exist') } enterNewsDescription (newsDescription) { @@ -83,20 +83,20 @@ class News { } clickOnAddNews () { - cy.get(News.#createNewNews) + cy.get(News.#createNewNews, { timeout: 20000 }) .click() } navigateToNewsOverview () { - cy.get(News.#newsOverviewNavigationButton) + cy.get(News.#newsOverviewNavigationButton, { timeout: 20000 }) .click() cy.url() .should('include', '/news') } teacherReadsNewsOnOverviewPage(titleOfNews, descriptionOfNews) { - cy.get(News.#pageTitle).contains(titleOfNews).should('exist') - cy.get(News.#newsText).contains(descriptionOfNews).should('exist') + cy.get(News.#pageTitle, { timeout: 20000 }).contains(titleOfNews).should('exist') + cy.get(News.#newsText, { timeout: 20000 }).contains(descriptionOfNews).should('exist') } } export default News From ea812768b452cf2d66cd3ba9d6634441393cf064 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 3 Apr 2023 08:09:58 +0200 Subject: [PATCH 05/24] add timeout to get methods --- cypress/support/pages/news/pageNews.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/news/pageNews.js b/cypress/support/pages/news/pageNews.js index d83388dd..911f1a3e 100644 --- a/cypress/support/pages/news/pageNews.js +++ b/cypress/support/pages/news/pageNews.js @@ -63,7 +63,7 @@ class News { } seeDateInput () { - cy.get(News.#newsDateInpu, { timeout: 20000 }).should('exist') + cy.get(News.#newsDateInput, { timeout: 20000 }).should('exist') } enterNewsDescription (newsDescription) { From 116fea2169a6d017dc31cfa3b3b1f65a59d08ec7 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 3 Apr 2023 08:51:23 +0200 Subject: [PATCH 06/24] add timeout to get methods --- cypress/support/pages/news/pageNews.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/news/pageNews.js b/cypress/support/pages/news/pageNews.js index 911f1a3e..47122311 100644 --- a/cypress/support/pages/news/pageNews.js +++ b/cypress/support/pages/news/pageNews.js @@ -40,7 +40,7 @@ class News { cy.get(News.#deleteNews, { timeout: 20000 }).click().wait(3000) } - wopenNewsDetailPage (newsName) { + openNewsDetailPage (newsName) { cy.get(News.#newsName, { timeout: 20000 }) .contains(newsName) .click().wait(3000) From b38af070c291a66edea2656da6f63a9be069f3bb Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 3 Apr 2023 18:35:52 +0200 Subject: [PATCH 07/24] assert test --- cypress/support/pages/news/pageNews.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/support/pages/news/pageNews.js b/cypress/support/pages/news/pageNews.js index 47122311..8f7685e2 100644 --- a/cypress/support/pages/news/pageNews.js +++ b/cypress/support/pages/news/pageNews.js @@ -33,6 +33,7 @@ class News { confirmDeletionOnDialogBox () { cy.get(News.#deleteNewsConfirmation, { timeout: 20000 }) .contains('Löschen') + .should('exist') .click().wait(3000) } From ae917f4873698b8892fa4d57a33bd9193f895d67 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 3 Apr 2023 20:52:23 +0200 Subject: [PATCH 08/24] fix administrate users tests --- .../support/pages/admin/pageAdministration.js | 4 +-- cypress/support/pages/news/pageNews.js | 33 ++++++++++--------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/cypress/support/pages/admin/pageAdministration.js b/cypress/support/pages/admin/pageAdministration.js index 79d0db01..d393a941 100644 --- a/cypress/support/pages/admin/pageAdministration.js +++ b/cypress/support/pages/admin/pageAdministration.js @@ -137,10 +137,10 @@ class Management { clickOnAddButton (role) { if (!(role == 'student')) { cy.intercept('POST', '**/teachers').as('post_role_api') - cy.intercept('GET', '**/teachers?**').as('get_roles_api') + cy.intercept('GET', '**/teachers**').as('get_roles_api') } else { cy.intercept('POST', '**/students').as('post_role_api') - cy.intercept('GET', '**/students?**').as('get_roles_api') + cy.intercept('GET', '**/students**').as('get_roles_api') } cy.get(Management.#addButton) .click() diff --git a/cypress/support/pages/news/pageNews.js b/cypress/support/pages/news/pageNews.js index 8f7685e2..bca1abf3 100644 --- a/cypress/support/pages/news/pageNews.js +++ b/cypress/support/pages/news/pageNews.js @@ -31,40 +31,43 @@ class News { } confirmDeletionOnDialogBox () { - cy.get(News.#deleteNewsConfirmation, { timeout: 20000 }) + cy.get(News.#deleteNewsConfirmation) .contains('Löschen') .should('exist') - .click().wait(3000) + .click() } clickOnDeleteNewsButton () { - cy.get(News.#deleteNews, { timeout: 20000 }).click().wait(3000) + cy.get(News.#deleteNews).click() } openNewsDetailPage (newsName) { - cy.get(News.#newsName, { timeout: 20000 }) + cy.get(News.#newsName) .contains(newsName) - .click().wait(3000) + .should('exist') + .click() } seeCreatedNews (newsTitle, newsDesc) { - cy.get(News.#newsTitle, { timeout: 20000 }) + cy.get(News.#newsTitle) .contains(newsTitle) + .should('exist') cy.get(News.#newsDescriptionVisible) - .contains(newsDesc, { timeout: 20000 }) + .contains(newsDesc) + .should('exist') } clickOnCreateNewsSaveButton () { - cy.get(News.#newsCreateButton, { timeout: 20000 }) - .click().wait(3000) + cy.get(News.#newsCreateButton) + .click() } seeTimeInput () { - cy.get(News.#newsTimeInput, { timeout: 20000 }).should('exist') + cy.get(News.#newsTimeInput).should('exist') } seeDateInput () { - cy.get(News.#newsDateInput, { timeout: 20000 }).should('exist') + cy.get(News.#newsDateInput).should('exist') } enterNewsDescription (newsDescription) { @@ -84,20 +87,20 @@ class News { } clickOnAddNews () { - cy.get(News.#createNewNews, { timeout: 20000 }) + cy.get(News.#createNewNews) .click() } navigateToNewsOverview () { - cy.get(News.#newsOverviewNavigationButton, { timeout: 20000 }) + cy.get(News.#newsOverviewNavigationButton) .click() cy.url() .should('include', '/news') } teacherReadsNewsOnOverviewPage(titleOfNews, descriptionOfNews) { - cy.get(News.#pageTitle, { timeout: 20000 }).contains(titleOfNews).should('exist') - cy.get(News.#newsText, { timeout: 20000 }).contains(descriptionOfNews).should('exist') + cy.get(News.#pageTitle).contains(titleOfNews).should('exist') + cy.get(News.#newsText).contains(descriptionOfNews).should('exist') } } export default News From 23ed873fdbedd963734dbcc0f5599a069951fb21 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 4 Apr 2023 19:18:21 +0200 Subject: [PATCH 09/24] set nonGlobalStepDefinition to true --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 593f107a..88756847 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "multiple-cucumber-html-reporter": "^1.21.4" }, "cypress-cucumber-preprocessor": { - "nonGlobalStepDefinitions": false, + "nonGlobalStepDefinitions": true, "stepDefinitions": "cypress/support/step_definition/", "cucumberJson": { "generate": true From 46e4a15e47b6ca811930919fdf4f3e5ee92197d2 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 4 Apr 2023 19:35:15 +0200 Subject: [PATCH 10/24] revert changes --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 88756847..593f107a 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "multiple-cucumber-html-reporter": "^1.21.4" }, "cypress-cucumber-preprocessor": { - "nonGlobalStepDefinitions": true, + "nonGlobalStepDefinitions": false, "stepDefinitions": "cypress/support/step_definition/", "cucumberJson": { "generate": true From 8cd7fff961a70fdb56dad4400dd4239bb3e9342a Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 4 Apr 2023 21:38:11 +0200 Subject: [PATCH 11/24] fix tests --- cypress/support/pages/course/pageCourses.js | 20 ++++++++++++++++---- cypress/support/pages/teams/pageTeams.js | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 8e04c699..2ef0429c 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -65,16 +65,28 @@ class Courses { const htmlTitlePage = $title.text() if (htmlTitlePage.includes('Kurse')) { cy.get(`[aria-label="Kurs ${roomName}"]`) - .click() + .click({ + multiple: true, + force: true + }) } else if (htmlTitlePage.includes('courses')) { cy.get(`[aria-label="Course ${roomName}"]`) - .click() + .click({ + multiple: true, + force: true + }) } else if (htmlTitlePage.includes('Cursos')) { cy.get(`[aria-label="Curso ${roomName}"]`) - .click() + .click({ + multiple: true, + force: true + }) } else if (htmlTitlePage.includes('Поточні')) { cy.get(`[aria-label="Курс ${roomName}"]`) - .click() + .click({ + multiple: true, + force: true + }) } }) cy.wait(['@board_api', '@userPermissions_api']) diff --git a/cypress/support/pages/teams/pageTeams.js b/cypress/support/pages/teams/pageTeams.js index 1e0ab9ff..a7414817 100644 --- a/cypress/support/pages/teams/pageTeams.js +++ b/cypress/support/pages/teams/pageTeams.js @@ -322,7 +322,7 @@ class Teams { .click() cy.url() .should('include', '/teams') - cy.get(Teams.#pageTitleTeamsOverview).should('exist') + cy.get(Teams.#pageTitleTeamsOverview, { timeout: 20000 }).should('exist') } selectTeam (teamName) { @@ -474,4 +474,4 @@ class Teams { .should('be.visible') } } -export default Teams \ No newline at end of file +export default Teams From 4ad3a8b0e09ec916881d9458e2cb7d1a559ecbc5 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Wed, 5 Apr 2023 20:05:20 +0200 Subject: [PATCH 12/24] fix tests --- cypress/support/pages/course/pageCourses.js | 4 ++++ cypress/support/pages/teams/pageTeams.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 2ef0429c..6941437f 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -65,24 +65,28 @@ class Courses { const htmlTitlePage = $title.text() if (htmlTitlePage.includes('Kurse')) { cy.get(`[aria-label="Kurs ${roomName}"]`) + .should('exist') .click({ multiple: true, force: true }) } else if (htmlTitlePage.includes('courses')) { cy.get(`[aria-label="Course ${roomName}"]`) + .should('exist') .click({ multiple: true, force: true }) } else if (htmlTitlePage.includes('Cursos')) { cy.get(`[aria-label="Curso ${roomName}"]`) + .should('exist') .click({ multiple: true, force: true }) } else if (htmlTitlePage.includes('Поточні')) { cy.get(`[aria-label="Курс ${roomName}"]`) + .should('exist') .click({ multiple: true, force: true diff --git a/cypress/support/pages/teams/pageTeams.js b/cypress/support/pages/teams/pageTeams.js index a7414817..17561dc7 100644 --- a/cypress/support/pages/teams/pageTeams.js +++ b/cypress/support/pages/teams/pageTeams.js @@ -322,7 +322,7 @@ class Teams { .click() cy.url() .should('include', '/teams') - cy.get(Teams.#pageTitleTeamsOverview, { timeout: 20000 }).should('exist') + cy.get(Teams.#pageTitleTeamsOverview, { timeout: 200000 }).should('exist') } selectTeam (teamName) { From 643534e1c982e42ecf34d21d65b034d4032ba069 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Wed, 5 Apr 2023 23:00:21 +0200 Subject: [PATCH 13/24] fix tests --- cypress/support/pages/course/pageCourses.js | 21 +++++-------------- cypress/support/pages/teams/pageTeams.js | 3 +-- .../authentication/loginStep.spec.js | 3 ++- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 6941437f..96587d56 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -54,6 +54,7 @@ class Courses { navigateToRoomsOverview () { cy.get(Courses.#courseOverviewNavigationButton) + .should('exist') .click() cy.wait('@courses_api') } @@ -66,31 +67,19 @@ class Courses { if (htmlTitlePage.includes('Kurse')) { cy.get(`[aria-label="Kurs ${roomName}"]`) .should('exist') - .click({ - multiple: true, - force: true - }) + .click() } else if (htmlTitlePage.includes('courses')) { cy.get(`[aria-label="Course ${roomName}"]`) .should('exist') - .click({ - multiple: true, - force: true - }) + .click() } else if (htmlTitlePage.includes('Cursos')) { cy.get(`[aria-label="Curso ${roomName}"]`) .should('exist') - .click({ - multiple: true, - force: true - }) + .click() } else if (htmlTitlePage.includes('Поточні')) { cy.get(`[aria-label="Курс ${roomName}"]`) .should('exist') - .click({ - multiple: true, - force: true - }) + .click() } }) cy.wait(['@board_api', '@userPermissions_api']) diff --git a/cypress/support/pages/teams/pageTeams.js b/cypress/support/pages/teams/pageTeams.js index 17561dc7..bff66062 100644 --- a/cypress/support/pages/teams/pageTeams.js +++ b/cypress/support/pages/teams/pageTeams.js @@ -320,8 +320,7 @@ class Teams { navigateToTeamsOverview () { cy.get(Teams.#teamsOverviewNavigationButton) .click() - cy.url() - .should('include', '/teams') + cy.wait('@teams_api') cy.get(Teams.#pageTitleTeamsOverview, { timeout: 200000 }).should('exist') } diff --git a/cypress/support/step_definition/authentication/loginStep.spec.js b/cypress/support/step_definition/authentication/loginStep.spec.js index 8eb0c548..9b45b988 100644 --- a/cypress/support/step_definition/authentication/loginStep.spec.js +++ b/cypress/support/step_definition/authentication/loginStep.spec.js @@ -24,8 +24,9 @@ Before(() => { cy.intercept('**/homework/**').as('homework_api') cy.intercept('**/rooms/**').as('rooms_api') cy.intercept('**/delete/**').as('delete_api') + cy.intercept('**/teams**').as('teams_api') }) Given('I am logged in as a {string} at {string}', (username, environment) => { cy.login(username, environment) - }) \ No newline at end of file + }) From 5563e88a1f963afbd5e6c7576d5f40d1ec9160c3 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Thu, 6 Apr 2023 22:01:56 +0200 Subject: [PATCH 14/24] add checks --- cypress/support/pages/course/pageCourses.js | 2 +- cypress/support/pages/teams/pageTeams.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 96587d56..629622b2 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -304,7 +304,7 @@ class Courses { } performRoomDeletion () { - cy.get(Courses.#deleteButton).click() + cy.get(Courses.#deleteButton).should('exist').click() cy.get(Courses.#confirmDeletionPopup) .click({ multiple: true, diff --git a/cypress/support/pages/teams/pageTeams.js b/cypress/support/pages/teams/pageTeams.js index bff66062..df4f37e1 100644 --- a/cypress/support/pages/teams/pageTeams.js +++ b/cypress/support/pages/teams/pageTeams.js @@ -319,6 +319,7 @@ class Teams { navigateToTeamsOverview () { cy.get(Teams.#teamsOverviewNavigationButton) + .should("exist") .click() cy.wait('@teams_api') cy.get(Teams.#pageTitleTeamsOverview, { timeout: 200000 }).should('exist') @@ -423,12 +424,14 @@ class Teams { } clickOnAddTeam () { - cy.get(Teams.#teamMainSection).then(($element) => { + cy.get(Teams.#teamMainSection).should("exist").then(($element) => { if ($element.hasClass('empty-state')) { cy.get(Teams.#addNewTeamEmptyOverviewButton) + .should("exist") .click() } else { cy.get(Teams.#addNewTeamButton) + .should("exist") .click() } }) From 4555e877a6055a452a85b77290b786284d9c3d72 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 11 Apr 2023 18:35:27 +0200 Subject: [PATCH 15/24] extends timeout --- cypress.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.config.js b/cypress.config.js index 47f6d2f5..8fa4d462 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -5,7 +5,7 @@ module.exports = defineConfig({ viewportHeight: 768, videoCompression: 18, chromeWebSecurity: true, - pageLoadTimeout: 80000, + pageLoadTimeout: 180000, defaultCommandTimeout: 80000, requestTimeout: 60000, responseTimeout: 60000, From 5aea536b8da1e28ab684bc8b5d9e167993bac567 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 11 Apr 2023 20:21:57 +0200 Subject: [PATCH 16/24] fix teams tests --- cypress/support/pages/teams/pageTeams.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/teams/pageTeams.js b/cypress/support/pages/teams/pageTeams.js index df4f37e1..638262c0 100644 --- a/cypress/support/pages/teams/pageTeams.js +++ b/cypress/support/pages/teams/pageTeams.js @@ -67,7 +67,7 @@ class Teams { static #videoConferenceNotStartedIcon = '[data-testid="video-conference-not-started-info-icon"]' static #videoConferenceNotStartedInfoModal = '[data-testid="modal_content"]' static #teamEventTitleOnCalanderTab = '[data-testid="team-event-calender-title"]' - static #pageTitleTeamsOverview = '[id="page-title"]' + static #pageTitleTeamsOverview = '[id="titlebar"]' static #teamsMembersOverviewPageTitle = '[id="page-title"]' From f384f626c65f595ac40f8e1d2c579d688eb44845 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 17 Apr 2023 09:37:33 +0200 Subject: [PATCH 17/24] cleanup methods --- cypress/plugins/index.js | 2 +- cypress/support/pages/course/pageCourses.js | 74 ++++++++++++++++++- cypress/support/pages/tasks/pageTasks.js | 9 +++ .../authentication/loginStep.spec.js | 2 + .../course/commonCourseSteps.spec.js | 32 +++++++- .../tasks/commonTaskSteps.spec.js | 42 +++++++++++ 6 files changed, 158 insertions(+), 3 deletions(-) diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 5bd5673c..a03a8b3b 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -31,4 +31,4 @@ module.exports = (on, config) => { fs.writeFile("cypress/.run/results.json", JSON.stringify(results)); } }) -} \ No newline at end of file +} diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 629622b2..c5d80d5f 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -220,6 +220,7 @@ class Courses { .then(interceptions => { expect(interceptions.response.statusCode).to.equal(200) }) + .wait(['@course_api']) } showCourseEditPage () { @@ -318,7 +319,8 @@ class Courses { '@roles_api', '@schools_api', '@alert_api', - '@dashboard_api' + '@dashboard_api', + '@rooms_overview_api' ], { timeout: 80000 } ) @@ -398,6 +400,76 @@ class Courses { cy.get(Courses.#chosenContainer).should('contain', userFullName) } + deleteAllCoursesMatchingName (roomName) { + cy.get('h1') + .eq(0) + .then($title => { + const htmlTitlePage = $title.text() + if (htmlTitlePage.includes('Kurse')) { + cy.get(`[class="rooms-container"]`).then($roomsContainer => { + if ($roomsContainer.find(`[aria-label="Kurs ${roomName}"]`).length) { + cy.get(`[aria-label="Kurs ${roomName}"]`).then(($rooms) => { + if ($rooms) { + cy.wrap($rooms).first().click() + cy.wait(['@board_api', '@userPermissions_api', '@rooms_api']); + this.openCourseEditPage(); + cy.get(Courses.#deleteButton).should('exist').click() + cy.get(Courses.#confirmDeletionPopup) + .click({ + multiple: true, + force: true + }) + .wait( + [ + '@runtime_config_api', + '@public_api', + '@me_api', + '@roles_api', + '@schools_api', + '@alert_api', + '@dashboard_api', + '@rooms_overview_api' + ], + {timeout: 80000} + ) + + if ($rooms.length > 1) { + this.deleteAllCoursesMatchingName(roomName) + } + } + }) + } + }) + } else if (htmlTitlePage.includes('courses')) { + cy.get(`[aria-label="Course ${roomName}"]`) + .should('exist') + .each(($el, index, $list) => { + cy.wrap($el).click(); + cy.wait(['@board_api', '@userPermissions_api']); + this.openCourseEditPage(); + this.performRoomDeletion(); + }) + } else if (htmlTitlePage.includes('Cursos')) { + cy.get(`[aria-label="Curso ${roomName}"]`) + .should('exist') + .each(($course) => { + cy.wrap($course).click(); + cy.wait(['@board_api', '@userPermissions_api']); + this.openCourseEditPage(); + this.performRoomDeletion(); + }) + } else if (htmlTitlePage.includes('Поточні')) { + cy.get(`[aria-label="Курс ${roomName}"]`) + .should('exist') + .each(($el, index, $list) => { + cy.wrap($el).click(); + cy.wait(['@board_api', '@userPermissions_api']); + this.openCourseEditPage(); + this.performRoomDeletion(); + }) + } + }) + } } diff --git a/cypress/support/pages/tasks/pageTasks.js b/cypress/support/pages/tasks/pageTasks.js index 70bc7055..bac94ebf 100644 --- a/cypress/support/pages/tasks/pageTasks.js +++ b/cypress/support/pages/tasks/pageTasks.js @@ -606,5 +606,14 @@ class Tasks { clickLowerTaskSectionIcon () { cy.get(Tasks.#lowerTaskSectionIcon).click() } + + taskExists (taskTitle) { + cy.get(Tasks.#taskCardTitle) + .then($tasks => { + return $tasks.find(taskTitle).length + }) + + return false + } } export default Tasks diff --git a/cypress/support/step_definition/authentication/loginStep.spec.js b/cypress/support/step_definition/authentication/loginStep.spec.js index 9b45b988..3df79749 100644 --- a/cypress/support/step_definition/authentication/loginStep.spec.js +++ b/cypress/support/step_definition/authentication/loginStep.spec.js @@ -25,6 +25,8 @@ Before(() => { cy.intercept('**/rooms/**').as('rooms_api') cy.intercept('**/delete/**').as('delete_api') cy.intercept('**/teams**').as('teams_api') + cy.intercept('**/courses/**').as('course_api') + cy.intercept('**/rooms-overview**').as('rooms_overview_api') }) Given('I am logged in as a {string} at {string}', (username, environment) => { diff --git a/cypress/support/step_definition/course/commonCourseSteps.spec.js b/cypress/support/step_definition/course/commonCourseSteps.spec.js index 489f8954..b4c58417 100644 --- a/cypress/support/step_definition/course/commonCourseSteps.spec.js +++ b/cypress/support/step_definition/course/commonCourseSteps.spec.js @@ -2,6 +2,36 @@ import Courses from '../../pages/course/pageCourses' const courses = new Courses() +before(() => { + cy.intercept('**/public').as('public_api'); + cy.intercept('**/me').as('me_api'); + cy.intercept('**/user/**').as('roles_api'); + cy.intercept('**/schools/**').as('schools_api'); + cy.intercept('**/dashboard').as('dashboard_api'); + cy.intercept('**/userPermissions?**').as('userPermissions_api'); + cy.intercept('**/classes?**').as('classes_api'); + cy.intercept('**/students?**').as('students_api'); + cy.intercept('**/locales/**').as('locales_api'); + cy.intercept('**/alerts').as('alerts_api'); + cy.intercept('**/alert').as('alert_api'); + cy.intercept('**/tasks**').as('tasks_api'); + cy.intercept('**/runtime.config.json').as('runtime_config_api'); + cy.intercept('**/board').as('board_api'); + cy.intercept('**/courses?**').as('courses_api'); + cy.intercept('**/courses/**').as('course_api'); + cy.intercept('**/homework/**').as('homework_api'); + cy.intercept('**/rooms/**').as('rooms_api'); + cy.intercept('**/delete/**').as('delete_api'); + cy.intercept('**/teams**').as('teams_api'); + cy.intercept('**/rooms-overview**').as('rooms_overview_api'); + cy.login('teacher', 'brb'); + courses.navigateToRoomsOverview(); + ['Cypress Test Creation and Deletion', 'Cypress Testkurs Edit'].forEach((courseName => { + courses.deleteAllCoursesMatchingName(courseName); + courses.courseIsNotVisiblOnOverviewPage(courseName); + })) +}) + When('I go to rooms overview', () => { courses.navigateToRoomsOverview() }) @@ -145,4 +175,4 @@ And('I clear substitute teacher field', () => { And('I add substitute teacher {string}', username => { courses.addSubstituteTeacher(username) -}) \ No newline at end of file +}) diff --git a/cypress/support/step_definition/tasks/commonTaskSteps.spec.js b/cypress/support/step_definition/tasks/commonTaskSteps.spec.js index c171c0b5..b1056432 100644 --- a/cypress/support/step_definition/tasks/commonTaskSteps.spec.js +++ b/cypress/support/step_definition/tasks/commonTaskSteps.spec.js @@ -1,7 +1,49 @@ import Tasks from '../../pages/tasks/pageTasks' +import Courses from "../../pages/course/pageCourses"; +import Dashboard from "../../pages/dashboard/pageDashboard"; const tasks = new Tasks() +before(() => { + cy.intercept('**/public').as('public_api'); + cy.intercept('**/me').as('me_api'); + cy.intercept('**/user/**').as('roles_api'); + cy.intercept('**/schools/**').as('schools_api'); + cy.intercept('**/dashboard').as('dashboard_api'); + cy.intercept('**/userPermissions?**').as('userPermissions_api'); + cy.intercept('**/classes?**').as('classes_api'); + cy.intercept('**/students?**').as('students_api'); + cy.intercept('**/locales/**').as('locales_api'); + cy.intercept('**/alerts').as('alerts_api'); + cy.intercept('**/alert').as('alert_api'); + cy.intercept('**/tasks**').as('tasks_api'); + cy.intercept('**/runtime.config.json').as('runtime_config_api'); + cy.intercept('**/board').as('board_api'); + cy.intercept('**/courses?**').as('courses_api'); + cy.intercept('**/courses/**').as('course_api'); + cy.intercept('**/homework/**').as('homework_api'); + cy.intercept('**/rooms/**').as('rooms_api'); + cy.intercept('**/delete/**').as('delete_api'); + cy.intercept('**/teams**').as('teams_api'); + cy.intercept('**/rooms-overview**').as('rooms_overview_api'); + cy.login('teacher', 'brb'); + const courses = new Courses(); + const dashboard = new Dashboard(); + tasks.navigateToTasksOverview(); + tasks.clickOnTabDraftTasks(); + ['Cy Task Creating from Task Overview Test', 'Cy Task to be delete on task page'].forEach((taskName => { + if (tasks.taskExists(taskName)) { + tasks.openThreeDotMenuForTask(taskName); + tasks.clickDeleteTaskInDotMenu(); + courses.clickDeleteInConfirmationWindow(); + dashboard.arriveOnDashboard(); + tasks.navigateToTasksOverview(); + tasks.clickOnTabDraftTasks(); + tasks.taskIsNotVisibleOnTasksOverviewPage(taskName); + } + })) +}) + When('I go to tasks overview', () => { tasks.navigateToTasksOverview() }) From 37082eab9c66416bee236a8d7968d9201d7e86be Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 17 Apr 2023 19:08:52 +0200 Subject: [PATCH 18/24] add check for task existance --- cypress/support/pages/course/pageCourses.js | 98 +++++++++------------ 1 file changed, 40 insertions(+), 58 deletions(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index c5d80d5f..9b6ab476 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -406,71 +406,53 @@ class Courses { .then($title => { const htmlTitlePage = $title.text() if (htmlTitlePage.includes('Kurse')) { - cy.get(`[class="rooms-container"]`).then($roomsContainer => { - if ($roomsContainer.find(`[aria-label="Kurs ${roomName}"]`).length) { - cy.get(`[aria-label="Kurs ${roomName}"]`).then(($rooms) => { - if ($rooms) { - cy.wrap($rooms).first().click() - cy.wait(['@board_api', '@userPermissions_api', '@rooms_api']); - this.openCourseEditPage(); - cy.get(Courses.#deleteButton).should('exist').click() - cy.get(Courses.#confirmDeletionPopup) - .click({ - multiple: true, - force: true - }) - .wait( - [ - '@runtime_config_api', - '@public_api', - '@me_api', - '@roles_api', - '@schools_api', - '@alert_api', - '@dashboard_api', - '@rooms_overview_api' - ], - {timeout: 80000} - ) - - if ($rooms.length > 1) { - this.deleteAllCoursesMatchingName(roomName) - } - } - }) - } - }) + this.deleteCursesByName('Kurs', roomName) } else if (htmlTitlePage.includes('courses')) { - cy.get(`[aria-label="Course ${roomName}"]`) - .should('exist') - .each(($el, index, $list) => { - cy.wrap($el).click(); - cy.wait(['@board_api', '@userPermissions_api']); - this.openCourseEditPage(); - this.performRoomDeletion(); - }) + this.deleteCursesByName('Course', roomName) } else if (htmlTitlePage.includes('Cursos')) { - cy.get(`[aria-label="Curso ${roomName}"]`) - .should('exist') - .each(($course) => { - cy.wrap($course).click(); - cy.wait(['@board_api', '@userPermissions_api']); - this.openCourseEditPage(); - this.performRoomDeletion(); - }) + this.deleteCursesByName('Curso', roomName) } else if (htmlTitlePage.includes('Поточні')) { - cy.get(`[aria-label="Курс ${roomName}"]`) - .should('exist') - .each(($el, index, $list) => { - cy.wrap($el).click(); - cy.wait(['@board_api', '@userPermissions_api']); - this.openCourseEditPage(); - this.performRoomDeletion(); - }) + this.deleteCursesByName('Курс', roomName) } }) } + deleteCursesByName (courseLabel, roomName) { + cy.get(`[class="rooms-container"]`).then($roomsContainer => { + if ($roomsContainer.find(`[aria-label="${courseLabel} ${roomName}"]`).length) { + cy.get(`[aria-label="${courseLabel} ${roomName}"]`).then(($rooms) => { + if ($rooms) { + cy.wrap($rooms).first().click() + cy.wait(['@board_api', '@userPermissions_api', '@rooms_api']); + this.openCourseEditPage(); + cy.get(Courses.#deleteButton).should('exist').click() + cy.get(Courses.#confirmDeletionPopup) + .click({ + multiple: true, + force: true + }) + .wait( + [ + '@runtime_config_api', + '@public_api', + '@me_api', + '@roles_api', + '@schools_api', + '@alert_api', + '@dashboard_api', + '@rooms_overview_api' + ], + {timeout: 80000} + ) + + if ($rooms.length > 1) { + this.deleteAllCoursesMatchingName(roomName) + } + } + }) + } + }) + } } export default Courses From 718d26098b267759e641a00c861674e70e994c82 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 17 Apr 2023 20:02:37 +0200 Subject: [PATCH 19/24] fix change language tests --- cypress/support/pages/account/pageAccount.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/support/pages/account/pageAccount.js b/cypress/support/pages/account/pageAccount.js index 4b297d47..a157debf 100644 --- a/cypress/support/pages/account/pageAccount.js +++ b/cypress/support/pages/account/pageAccount.js @@ -101,7 +101,10 @@ class Account { } selectLanguage (sel, language) { - return cy.contains(sel, language).should('be.visible').click().wait(500) + return cy.contains(sel, language) + .should('be.visible') + .click() + .wait(['@alerts_api']) } assertLanguageUpdate (updatedText) { From 38a873a2a2d0f06e78dae7499bed382467796f2e Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Mon, 17 Apr 2023 21:47:02 +0200 Subject: [PATCH 20/24] fix tests --- cypress/support/pages/course/pageCourses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 9b6ab476..5d55704e 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -56,7 +56,7 @@ class Courses { cy.get(Courses.#courseOverviewNavigationButton) .should('exist') .click() - cy.wait('@courses_api') + cy.wait(['@courses_api', '@alert_api', '@dashboard_api']) } navigateToRoomBoard (roomName) { From b4d5351b13d87c207c9b090ce6493f9bbc949d3e Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 18 Apr 2023 08:40:11 +0200 Subject: [PATCH 21/24] fix wait --- cypress/support/pages/course/pageCourses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 5d55704e..d7e5fe3c 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -56,7 +56,7 @@ class Courses { cy.get(Courses.#courseOverviewNavigationButton) .should('exist') .click() - cy.wait(['@courses_api', '@alert_api', '@dashboard_api']) + cy.wait(['@alert_api', '@dashboard_api', '@courses_api']) } navigateToRoomBoard (roomName) { From dc171b23b21a8fc5b7dc1756954b68e62d4b140d Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 18 Apr 2023 17:38:11 +0200 Subject: [PATCH 22/24] fix wait --- cypress/support/pages/course/pageCourses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index d7e5fe3c..a4ac4d84 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -56,7 +56,7 @@ class Courses { cy.get(Courses.#courseOverviewNavigationButton) .should('exist') .click() - cy.wait(['@alert_api', '@dashboard_api', '@courses_api']) + cy.wait(['@dashboard_api', '@courses_api']) } navigateToRoomBoard (roomName) { From d6c843cd0b7585f634efe0e600226d90dcfa4f9f Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Tue, 18 Apr 2023 18:31:35 +0200 Subject: [PATCH 23/24] use headed mode --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 593f107a..5eadbec9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "e2e testing", "main": "index.js", "scripts": { - "cy:run": "cypress run --browser chrome --headless", + "cy:run": "xvfb-run cypress run --headed --browser chrome", "cy:open": "cypress open", "pretest": "if exist cypress\\reports; then rmdir /S/Q cypress\\reports; fi;", "generate:report": "node cucumber-html-report.js", From cf94e869e46bd8c32e881f6ac4f387bdda88ef34 Mon Sep 17 00:00:00 2001 From: Tomasz Wiaderek Date: Wed, 19 Apr 2023 19:00:51 +0200 Subject: [PATCH 24/24] change configuration method --- .github/workflows/automatic-trigger.yml | 1 + .github/workflows/manual-trigger.yml | 1 + .github/workflows/scheduled-trigger.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/automatic-trigger.yml b/.github/workflows/automatic-trigger.yml index 23400502..35c4870c 100644 --- a/.github/workflows/automatic-trigger.yml +++ b/.github/workflows/automatic-trigger.yml @@ -67,6 +67,7 @@ jobs: DEBUG: '@cypress/github-action' with: #command: npm run tag:stable:${{ matrix.spec }} + command: npm run cy:run browser: chrome - name: 📬 Upload test artifacts 📬 diff --git a/.github/workflows/manual-trigger.yml b/.github/workflows/manual-trigger.yml index f2a9c60d..d8a62d24 100644 --- a/.github/workflows/manual-trigger.yml +++ b/.github/workflows/manual-trigger.yml @@ -82,6 +82,7 @@ jobs: DEBUG: '@cypress/github-action' with: #command: npm run tag:stable:${{ matrix.spec }} + command: npm run cy:run browser: chrome - name: 📬 Upload test artifacts 📬 diff --git a/.github/workflows/scheduled-trigger.yml b/.github/workflows/scheduled-trigger.yml index 3f9ac8b0..df3668ea 100644 --- a/.github/workflows/scheduled-trigger.yml +++ b/.github/workflows/scheduled-trigger.yml @@ -68,6 +68,7 @@ jobs: DEBUG: '@cypress/github-action' with: #command: npm run tag:stable:${{ matrix.spec }} + command: npm run cy:run browser: chrome - name: 📬 Upload test artifacts 📬