Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atlldwp committed Feb 10, 2025
1 parent 6eb30e8 commit af60b47
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -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 '<teacher2>' at '<namespace>'
Expand All @@ -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
Expand All @@ -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 '<import_board_title>' in the modal
When I click on the button Import in the modal
Expand Down
Original file line number Diff line number Diff line change
@@ -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 '<teacherExt1>' at '<namespace>'
Expand All @@ -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
Expand All @@ -36,15 +36,15 @@ 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 '<teacherExt1>' at '<namespace>'
Given a room named '<room_name_target>' exists

# second teacher from the second school can access the shared URL and import the multi-column board
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 '<import_board_title>' in the modal
When I click on the button Import in the modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<teacher1>' at '<namespace>'
Expand All @@ -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
Expand All @@ -34,15 +34,15 @@ 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 '<teacherExt1>' at '<namespace>'
Given a room named '<room_name_target>' exists

# second teacher from the second school can access the shared URL and import the multi-column board
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 '<import_board_title>' in the modal
When I click on the button Import in the modal
Expand Down
26 changes: 14 additions & 12 deletions cypress/support/pages/room_board/pageRoomBoards.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]';
Expand All @@ -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");
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -116,15 +117,15 @@ 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");
}

verify21DaysLinkCheckboxChecked() {
cy.get(RoomBoards.#days21Checkbox)
// Move to the parent container holding the checkbox
.parent()
.find('input[type="checkbox"]')
.find(RoomBoards.#checkBoxCopyShareBoardModal)
.should("be.checked");
}

Expand All @@ -149,25 +150,26 @@ 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"]')
// Ensure text box is visible
.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);
});
Expand Down Expand Up @@ -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");
}

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

Expand All @@ -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();
});

Expand Down

0 comments on commit af60b47

Please sign in to comment.