Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC 8490 Testing boards in room #274

Merged
merged 26 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3467309
Add functionality to manage boards in room, including UI interactions…
wolfganggreschus Dec 6, 2024
e191926
Add edit functionality for room boards, including title input in menu
wolfganggreschus Dec 6, 2024
b25e271
Add functionality to save modified board title by clicking outside th…
wolfganggreschus Dec 6, 2024
e47b7f8
Add delete functionality for boards in room with cancel dialog verifi…
wolfganggreschus Dec 6, 2024
8d27672
Add cancel deletion functionality for board in room
wolfganggreschus Dec 6, 2024
50558ef
Add functionality to verify edited board title after modification
wolfganggreschus Dec 6, 2024
b376e2c
Add confirmation button visibility for delete dialog in room boards
wolfganggreschus Dec 11, 2024
062e700
Add visibility checks for board presence after deletion in room overview
wolfganggreschus Dec 11, 2024
0dd7916
Refactor board deletion confirmation steps and update visibility asse…
wolfganggreschus Dec 11, 2024
23637a6
Add comments to clarify teacher actions for creating and editing mult…
wolfganggreschus Dec 11, 2024
b99d677
Refactor room board interactions by creating a new RoomBoards class a…
wolfganggreschus Dec 11, 2024
9fa1ff0
Refactor room board feature tests by removing outdated scenarios and …
wolfganggreschus Dec 11, 2024
10b146d
Update feature file to separate examples for school and staging tests…
wolfganggreschus Dec 11, 2024
fc9a119
Remove outdated staging test examples from room board feature file
wolfganggreschus Dec 11, 2024
9f9e7ca
Update Cypress test script to use Edge browser for school API tests
wolfganggreschus Dec 11, 2024
b2010fe
Refactor room board feature steps and update related method names for…
wolfganggreschus Dec 11, 2024
10173cf
Refactor room board feature steps for clarity and update Cypress test…
wolfganggreschus Dec 12, 2024
a15876c
Add clearAndType method to RoomBoards class for improved input handling
wolfganggreschus Dec 12, 2024
2f5a451
Update confirmation dialog wording in delete board feature
wolfganggreschus Dec 12, 2024
5d34df9
Replace multi-column board feature test with combined multi and singl…
wolfganggreschus Dec 12, 2024
a78396a
Add single column board creation and deletion steps to room board fea…
wolfganggreschus Dec 12, 2024
34718d5
Clarify comments for delete process steps in multi-column board feature
wolfganggreschus Dec 12, 2024
ec26c1c
Fix typos in room board feature and update test script to use Edge br…
wolfganggreschus Dec 13, 2024
9c84396
Update comment to reflect single column board title editing in featur…
wolfganggreschus Dec 15, 2024
e74bbb0
updatded feture line
atlldwp Dec 16, 2024
ac4b7f0
Merge branch 'main' into BC-8490-cy-board-crud
atlldwp Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
@regression_test
@stable_test
Feature: Room - Add, edit and delete board in room

As a teacher I want to add, edit and delete board in the room.

Scenario: Teacher add, edit, and delete board in the room, including pre-conditions
Given I am logged in as a '<teacher>' at '<namespace>'

# pre-condition: teacher creating a new room
When I go to room overview
When I click on FAB to create new room
Then I see room creation page
When I enter the room name '<room_name>'
When I click on the button to save the room
Then I see the detail page of room '<room_name>'

# teacher creates a new multi column board in the room
Given I am logged in as a '<teacher>' at '<namespace>'
When I go to room overview
When I go to room '<room_name>'
When I click on the button add content
Then I see the button to add board
When I click on the fab button to add a Board
Then I see the dialog box to select the Board type
When I click on button to add multi column board
Then I see the page board details

# teacher edits title of the new multi column board
When I click on the three dot menu in room board
When I click on edit in board menu
Then I change the room board title to '<edited_board_title>'
When I click on the page outside of the title of the board
Then I see my room board is named '<edited_board_title>'

# cancel delete-process of the new multi column board
When I click on the three dot menu in room board
When I click on delete in board menu
Then I see the button to cancel the dialog
When I click on the button to cancel the deletion
Then I see the page board details
Then I see the board '<edited_board_title>' on the room overview page

# confirm delete-process of the new multi column board
When I click on the three dot menu in room board
When I click on delete in board menu
Then I see the button to confirm the dialog
Then I click on the button to confirm the deletion
Then I do not see the board '<edited_board_title>' in the room

# teacher creates a new single column board in the room
Given I am logged in as a '<teacher>' at '<namespace>'
When I go to room overview
When I go to room '<room_name>'
When I click on the button add content
Then I see the button to add board
When I click on the fab button to add a Board
Then I see the dialog box to select the Board type
When I click on button to add single column board
Then I see the page board details
wolfganggreschus marked this conversation as resolved.
Show resolved Hide resolved

# teacher edits title of the new single column board
When I click on the three dot menu in room board
When I click on edit in board menu
Then I change the room board title to '<edited_board_title>'
When I click on the page outside of the title of the board
Then I see my room board is named '<edited_board_title>'

# confirm delete-process of single column board
When I click on the three dot menu in room board
When I click on delete in board menu
Then I see the button to confirm the dialog
Then I click on the button to confirm the deletion
Then I do not see the page board details

# post-condition: teacher deletes room
When I click on three dot menu in room page
When I click on delete option in room menu
Then I see confirmation modal for deleting the room
When I click on delete button in confirmation modal
Then I do not see '<room_name>' on room overview page


@school_api_test
Examples:
| teacher | namespace | room_name | board_name | edited_board_title |
| teacher1_brb | brb | Cypress Room Name | Cypress Board Name | Board Cy Title |

@staging_test
Examples:
| teacher | namespace | room_name | board_name | edited_board_title |
| teacher1_brb | brb | Cypress Room Name | Cypress Board Name | Board Cy Title |
1 change: 0 additions & 1 deletion cypress/support/pages/course_board/pageBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Board {
static #editButtonInThreeDotMenu = '[data-testid="board-menu-action"]';
static #externalToolElementAlert = '[data-testid="board-external-tool-element-alert"]';


clickPlusIconToAddCardInColumn() {
cy.get(Board.#addCardInColumnButton).click();
}
Expand Down
15 changes: 15 additions & 0 deletions cypress/support/pages/room/pageRooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Rooms {
static #roomDetailFABEdit = '[data-testid="room-action-edit"]';
static #roomDetailFABParticipants = '[data-testid="room-action-manage-participants"]';
static #roomDetailFABDelete = '[data-testid="room-action-delete"]';
static #addContentButton = '[data-testid="add-content-button"]';
static #fabButtonAddBoard = '[data-testid="fab_button_add_board"]';
static #confirmDeletionModalTitle = '[data-testid="delete-dialog-item"]';
static #confirmDeletionModalDelete = '[data-testid="dialog-confirm"]';
static #addParticipantsModal = '[data-testid="dialog-add-participants"]';
Expand All @@ -26,6 +28,8 @@ class Rooms {
static #inputSatrtdateForRoom = '[data-testid="room-start-date-input"]';
static #inputEndtdateForRoom = '[data-testid="room-end-date-input"]';



selectEndDateForRoom() {
const currentDate = new Date();
//set the date which is two days later than the current day
Expand Down Expand Up @@ -168,5 +172,16 @@ class Rooms {
notSeeParticipantInList(participantName) {
cy.get(Rooms.#participantTable).should("not.contain", participantName);
}
clickOnAddContentButton() {
cy.get(Rooms.#addContentButton).click();
}
seeFabButtonToAddBoard() {
cy.get(Rooms.#fabButtonAddBoard).should("be.visible");
}
clickOnFabButtonToAddBoard() {
cy.get(Rooms.#fabButtonAddBoard).click();
}


}
export default Rooms;
81 changes: 81 additions & 0 deletions cypress/support/pages/room_board/pageRoomBoards.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"use strict";

class RoomBoards {
static #btnDialogCancel = '[data-testid="dialog-cancel"]';
static #btnDialogConfirm = '[data-testid="dialog-confirm"]';
static #boardMenuActionDelete = '[data-testid="board-menu-action-delete"]';
static #mainPageArea = '[id="main-content"]';
static #roomBoardTitleOnPage = '[data-testid="board-title"]';
static #boardMenuIcon = '[data-testid="board-menu-icon"]';
static #btnBoardMenuActionEdit = '[data-testid="board-menu-action-edit"]';
static #dialogAddMultiColumnBoard = '[data-testid="dialog-add-multi-column-board"]';
static #dialogAddSingleColumnBoard = '[data-testid="dialog-add-single-column-board"]';
static #boardLayoutDialogTitle = '[data-testid="board-layout-dialog-title"]';

clearAndType(selector, newTitle) {
cy.get(selector)
.first()
.then((element) => {
const currentTitle = element.val();
if (currentTitle) {
cy.wrap(element).type("{backspace}".repeat(currentTitle.length));
}
cy.wrap(element).type(newTitle);
});
}
seeColumnBoardDialogBox() {
cy.get(RoomBoards.#boardLayoutDialogTitle).should("be.visible");
}
clickOnButtonToAddMultiColumnBoard() {
cy.get(RoomBoards.#dialogAddMultiColumnBoard).click();
}
clickOnButtonToAddSingleColumnBoard() {
cy.get(RoomBoards.#dialogAddSingleColumnBoard).click();
}
seeNewRoomBoardCreatePage() {
cy.url().should("include", "/board");
}
doNotSeeNewRoomBoardCreatePage() {
cy.url().should("not.include", "/board");
}
enterRoomBoardTitle(boardTitle) {
cy.get(RoomBoards.#roomBoardTitleOnPage).within(() => {
this.clearAndType("input", boardTitle);
});
}
seeGivenRoomBoardTitle(boardTitle) {
cy.get(RoomBoards.#roomBoardTitleOnPage).find('input').should('have.value', boardTitle);
}
clickOutsideTheTitleToSaveTheModifiedTitle() {
cy.get(RoomBoards.#mainPageArea).click("bottom");
}
clickOnDeleteInBoardMenu() {
cy.get(RoomBoards.#boardMenuActionDelete).click();
}
seeBoardOnRoomDetailPage(boardName) {
cy.contains(boardName).should("exist");
}
doNotSeeBoardOnRoomDetailPage(boardName) {
cy.contains(boardName).should("not.exist");
}
seeBtnDialogCancel() {
cy.get(RoomBoards.#btnDialogCancel).should("be.visible");
}
clickOnBtnDialogCancel() {
cy.get(RoomBoards.#btnDialogCancel).click();
}
seeBtnDialogConfirmDelete() {
cy.get(RoomBoards.#btnDialogConfirm).should("be.visible");
}
clickBtnDialogConfirmDelete() {
cy.get(RoomBoards.#btnDialogConfirm).click();
}
clickOnThreeDotMenuInRoomBoardTitle() {
cy.get(RoomBoards.#boardMenuIcon).click();
}
clickOnEditInBoardMenu() {
cy.get(RoomBoards.#btnBoardMenuActionEdit).click();
}
}

export default RoomBoards;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Then("I see the page Course Board details", () => {
board.seeNewCourseBoardCreatePage();
});


When("I click on the option Edit in three dot menu in course board", () => {
board.clickOnEditInThreeDotCourseBoardTitle();
});
Expand Down
16 changes: 16 additions & 0 deletions cypress/support/step_definition/room/roomSteps.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const { When, Then } = require("@badeball/cypress-cucumber-preprocessor");
import Rooms from "../../pages/room/pageRooms";
import RoomBoards from "../../pages/room_board/pageRoomBoards";

const rooms = new Rooms();
const roomBoards = new RoomBoards();

When("I select the colour for the room", () => {
rooms.selectRoomColour();
Expand Down Expand Up @@ -127,3 +129,17 @@ Then(
rooms.notSeeParticipantInList(participantName);
}
);

When("I click on the button add content", () => {
rooms.clickOnAddContentButton();
});

Then("I see the button to add board", () => {
rooms.seeFabButtonToAddBoard();
});

When ("I click on the fab button to add a Board", () => {
rooms.clickOnFabButtonToAddBoard();
});


65 changes: 65 additions & 0 deletions cypress/support/step_definition/room_boards/roomBoardSteps.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
const { When, Then } = require("@badeball/cypress-cucumber-preprocessor");
import RoomBoards from "../../pages/room_board/pageRoomBoards";

const roomBoards = new RoomBoards();

Then("I see the dialog box to select the Board type", () => {
roomBoards.seeColumnBoardDialogBox();
});

When("I click on button to add multi column board", () => {
roomBoards.clickOnButtonToAddMultiColumnBoard();
});

When("I click on button to add single column board", () => {
roomBoards.clickOnButtonToAddSingleColumnBoard();
});

Then("I see the page board details", () => {
roomBoards.seeNewRoomBoardCreatePage();
});

Then("I do not see the page board details", () => {
roomBoards.doNotSeeNewRoomBoardCreatePage();
});

When("I click on the three dot menu in room board", () => {
roomBoards.clickOnThreeDotMenuInRoomBoardTitle();
});

When("I click on edit in board menu", () => {
roomBoards.clickOnEditInBoardMenu();
});

Then("I change the room board title to {string}", (boardTitle) => {
roomBoards.enterRoomBoardTitle(boardTitle);
});

When("I click on the page outside of the title of the board", () => {
roomBoards.clickOutsideTheTitleToSaveTheModifiedTitle();
});
Then("I see my room board is named {string}", (boardTitle) => {
roomBoards.seeGivenRoomBoardTitle(boardTitle);
});
When("I click on delete in board menu", () => {
roomBoards.clickOnDeleteInBoardMenu();
});
Then("I see the button to cancel the dialog", () => {
roomBoards.seeBtnDialogCancel();
});
When("I click on the button to cancel the deletion", () => {
roomBoards.clickOnBtnDialogCancel();
});
Then("I see the board {string} on the room overview page", (boardTitle) => {
roomBoards.seeBoardOnRoomDetailPage(boardTitle);
});
Then("I see the button to confirm the dialog", () => {
roomBoards.seeBtnDialogConfirmDelete();
});
When("I click on the button to confirm the deletion", () => {
roomBoards.clickBtnDialogConfirmDelete();
});
Then("I do not see the board {string} in the room", (boardTitle) => {
roomBoards.doNotSeeBoardOnRoomDetailPage(boardTitle);
});

Loading