From af60b47a3819024648e4c1c2a9b0525e51c79447 Mon Sep 17 00:00:00 2001 From: atlldwp Date: Mon, 10 Feb 2025 16:25:08 +0100 Subject: [PATCH] updated tests --- ...reMultiColumnRoomBoardInSameSchool.feature | 8 +++--- ...mBoardWithDifferentSchoolOnMainDev.feature | 12 ++++----- ...mBoardWithDifferentSchoolOnStaging.feature | 10 +++---- .../pages/room_board/pageRoomBoards.js | 26 ++++++++++--------- .../room_boards/roomBoardSteps.spec.js | 4 +-- 5 files changed, 31 insertions(+), 29 deletions(-) diff --git a/cypress/e2e/room_board/shareMultiColumnRoomBoardInSameSchool.feature b/cypress/e2e/room_board/shareMultiColumnRoomBoardInSameSchool.feature index d04757ea..4fb58b42 100644 --- a/cypress/e2e/room_board/shareMultiColumnRoomBoardInSameSchool.feature +++ b/cypress/e2e/room_board/shareMultiColumnRoomBoardInSameSchool.feature @@ -1,10 +1,10 @@ @regression_test @stable_test -Feature: Rooms - Share Multi-Column Boards in the Rooms with teacher from the same school +Feature: Rooms - Share multi-column room board in the Rooms with teacher from the same school As a teacher, I want to share a multi-column board with another teacher within the same school so that I can collaborate effectively. - Scenario: Share a Multi-Column Board with a Teacher within the Same School + Scenario: Share a multi-column board with a Teacher within the Sameschool # pre-condition: Creating teacher accounts Given I am logged in as a '' at '' @@ -23,7 +23,7 @@ Feature: Rooms - Share Multi-Column Boards in the Rooms with teacher from the sa Then I see the information box in share modal Then I see the button Cancel in the share modal Then I see the checkbox Link valid for the same school is by default checked - Then I see the checkbox Link valid for 21 days is checked + Then I see the checkbox Link valid for 21 days is by default checked When I click on the button Continue Then I see the Share via modal Then I see the result url text box in the modal @@ -41,7 +41,7 @@ Feature: Rooms - Share Multi-Column Boards in the Rooms with teacher from the sa When I open the shared URL Then I see the modal to import the shared board into the room Then I see the title in the share modal - When I select the target room from the room list in the modal + When I select the room from the room list in the modal When I click on the Continue button in the modal When I enter a new name for the imported board '' in the modal When I click on the button Import in the modal diff --git a/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnMainDev.feature b/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnMainDev.feature index 65190f90..c4b6fd1e 100644 --- a/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnMainDev.feature +++ b/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnMainDev.feature @@ -1,12 +1,12 @@ @unstable_test -# Note: This feature can not currently be executed using the school API, as two new schools cannot be created within the same scenario in the feature file. Creating them in two different scenarios results in separate sessions, which prevents the copied board URL from the first scenario from being used in the second scenario. +# Note: This feature can not be currently executed using the school API, as creating two different school within the same scenario is not possible. And creating them in two different scenarios results in separate sessions, which prevents the copied board URL from the first scenario from being used in the second scenario. -Feature: Rooms - Share multi-column boards in the rooms with the teacher from different school +Feature: Rooms - Share multi-column board in the rooms with the teacher from different school As a teacher, I want to share a multi-column board with another teacher from a different school so that I can collaborate effectively. - Scenario: Share a multi-column board with a teacher from different School + Scenario: Share a multi-column board with a teacher from differentschool # pre-condition: creating teacher accounts for two different schools Given I am logged in as a '' at '' @@ -26,7 +26,7 @@ Feature: Rooms - Share multi-column boards in the rooms with the teacher from di Then I see the button Cancel in the share modal Then I see the checkbox Link valid for the same school is by default checked Then I click to uncheck Link valid for the same school - Then I see the checkbox Link valid for 21 days is checked + Then I see the checkbox Link valid for 21 days is by default checked When I click on the button Continue Then I see the Share via modal Then I see the result url text box in the modal @@ -36,7 +36,7 @@ Feature: Rooms - Share multi-column boards in the rooms with the teacher from di Then I copy the board URL Then I see the alert success message - # pre-condition: second teacher is logged into the application, and a room is available + # pre-condition: second teacher logged into the application, and a room exists Given I am logged in as a '' at '' Given a room named '' exists @@ -44,7 +44,7 @@ Feature: Rooms - Share multi-column boards in the rooms with the teacher from di When I open the shared URL Then I see the modal to import the shared board into the room Then I see the title in the share modal - When I select the target room from the room list in the modal + When I select the room from the room list in the modal When I click on the Continue button in the modal When I enter a new name for the imported board '' in the modal When I click on the button Import in the modal diff --git a/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnStaging.feature b/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnStaging.feature index fe5e7e08..a7d29d5b 100644 --- a/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnStaging.feature +++ b/cypress/e2e/room_board/shareMultiColumnRoomBoardWithDifferentSchoolOnStaging.feature @@ -3,11 +3,11 @@ # Note: This feature should only be executed in the staging environment due to the school API limitation, which prevents creating two separate schools in the same scenario and using the copied URL from Scenario One in Scenario Two due to new sessions. -Feature: Rooms - Share multi-column boards in the rooms with the teacher from different school +Feature: Rooms - Share multi-column board in the rooms with the teacher from different school As a teacher, I want to share a multi-column board with another teacher from a different school so that I can collaborate effectively. - Scenario: Share a multi-column board with a teacher from different School + Scenario: Share a multi-column board with a teacher from different school # pre-condition: room and multi-column board exist Given I am logged in as a '' at '' @@ -24,7 +24,7 @@ Feature: Rooms - Share multi-column boards in the rooms with the teacher from di Then I see the button Cancel in the share modal Then I see the checkbox Link valid for the same school is by default checked Then I click to uncheck Link valid for the same school - Then I see the checkbox Link valid for 21 days is checked + Then I see the checkbox Link valid for 21 days is by default checked When I click on the button Continue Then I see the Share via modal Then I see the result url text box in the modal @@ -34,7 +34,7 @@ Feature: Rooms - Share multi-column boards in the rooms with the teacher from di Then I copy the board URL Then I see the alert success message - # pre-condition: second teacher is logged into the application, and a room is available + # pre-condition: second teacher logged into the application, and a room exists Given I am logged in as a '' at '' Given a room named '' exists @@ -42,7 +42,7 @@ Feature: Rooms - Share multi-column boards in the rooms with the teacher from di When I open the shared URL Then I see the modal to import the shared board into the room Then I see the title in the share modal - When I select the target room from the room list in the modal + When I select the room from the room list in the modal When I click on the Continue button in the modal When I enter a new name for the imported board '' in the modal When I click on the button Import in the modal diff --git a/cypress/support/pages/room_board/pageRoomBoards.js b/cypress/support/pages/room_board/pageRoomBoards.js index 5483d527..a2600e2c 100644 --- a/cypress/support/pages/room_board/pageRoomBoards.js +++ b/cypress/support/pages/room_board/pageRoomBoards.js @@ -43,7 +43,7 @@ class RoomBoards { static #continueButton = '[data-testid="dialog-next"]'; static #shareEmailOption = '[data-testid="shareMailAction"]'; static #copyLinkOption = '[data-testid="copyAction"]'; - static #urlInputBoxCOpyBoard = '[data-testid="share-course-result-url"]'; + static #urlInputBoxCopyBoard = '[data-testid="share-course-result-url"]'; static #scanQRCodeOption = '[data-testid="qrCodeAction"]'; static #roomSelectionBoxModal = '[data-testid="import-destination-select"]'; static #continueButtonInImportModal = '[data-testid="dialog-next"]'; @@ -54,11 +54,12 @@ class RoomBoards { static #cancelButtonInShareModal = '[data-testid="dialog-cancel"]'; static #sharedBoardResultUrlTextBox = '[data-testid="share-course-result-url"]'; static #shareImportAlert = '[data-testid="alert-text"]'; + static #checkBoxCopyShareBoardModal = 'input[type="checkbox"]'; uncheckLinkValidForSameSchool() { cy.get(RoomBoards.#sameSchoolCheckbox).click(); cy.get(RoomBoards.#sameSchoolCheckbox) - .find('input[type="checkbox"]') + .find(RoomBoards.#checkBoxCopyShareBoardModal) .should("not.be.checked"); } @@ -88,7 +89,7 @@ class RoomBoards { } selectRoomForImport() { - // Go to paraent element + // Go to parent element cy.get(RoomBoards.#shareSettingsDialog) // Locate the selection input of the room name .find(RoomBoards.#roomSelectionBoxModal) @@ -116,7 +117,7 @@ class RoomBoards { cy.get(RoomBoards.#sameSchoolCheckbox) // Move to the parent container holding the checkbox .parent() - .find('input[type="checkbox"]') + .find(RoomBoards.#checkBoxCopyShareBoardModal) .should("be.checked"); } @@ -124,7 +125,7 @@ class RoomBoards { cy.get(RoomBoards.#days21Checkbox) // Move to the parent container holding the checkbox .parent() - .find('input[type="checkbox"]') + .find(RoomBoards.#checkBoxCopyShareBoardModal) .should("be.checked"); } @@ -149,7 +150,7 @@ class RoomBoards { } copyBoardURLInModal() { - cy.get(RoomBoards.#urlInputBoxCOpyBoard) + cy.get(RoomBoards.#urlInputBoxCopyBoard) // Move to the parent container holding the text box .parent() .find('input[type="text"]') @@ -157,17 +158,18 @@ class RoomBoards { .should("be.visible") // Get the value from the text box, which is the url to the copy board .invoke("val") - .then((url) => { + .then((boardUrl) => { // Validate URL - expect(url).to.be.a("string").and.not.be.empty; - cy.wrap(url).as("copiedURL"); // Store the URL + expect(boardUrl).to.be.a("string").and.not.be.empty; + cy.wrap(boardUrl).as("copiedURL"); + // copy button in clicked on the modal to check the success message cy.get(RoomBoards.#copyLinkOption).click(); }); } openSharedBoardURL() { - cy.get("@copiedURL").then((url) => { - cy.visit(url); + cy.get("@copiedURL").then((boardUrl) => { + cy.visit(boardUrl); // Wait for 500 msec for any JavaScript actions to complete cy.wait(500); }); @@ -217,7 +219,7 @@ class RoomBoards { verifyModeratorApprovalCheckboxCheckedInBBBModal() { cy.get(RoomBoards.#moderatorApprovalCheckbox) // Find the checkbox inside the parent options - .find('input[type="checkbox"]') + .find(RoomBoards.#checkBoxCopyShareBoardModal) .should("be.checked"); } diff --git a/cypress/support/step_definition/room_boards/roomBoardSteps.spec.js b/cypress/support/step_definition/room_boards/roomBoardSteps.spec.js index 410010c1..01bdf1f0 100644 --- a/cypress/support/step_definition/room_boards/roomBoardSteps.spec.js +++ b/cypress/support/step_definition/room_boards/roomBoardSteps.spec.js @@ -39,7 +39,7 @@ Then("I see the modal to import the shared board into the room", () => { roomBoards.verifyImportSharedBoardModal(); }); -When("I select the target room from the room list in the modal", () => { +When("I select the room from the room list in the modal", () => { roomBoards.selectRoomForImport(); }); @@ -66,7 +66,7 @@ Then("I see the checkbox Link valid for the same school is by default checked", roomBoards.verifySameSchoolLinkCheckboxChecked(); }); -Then("I see the checkbox Link valid for 21 days is checked", () => { +Then("I see the checkbox Link valid for 21 days is by default checked", () => { roomBoards.verify21DaysLinkCheckboxChecked(); });