Skip to content

Commit

Permalink
test updated
Browse files Browse the repository at this point in the history
  • Loading branch information
atlldwp committed Jan 20, 2025
1 parent 47db6c1 commit eaa4fde
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 37 deletions.
55 changes: 38 additions & 17 deletions cypress/e2e/room_board/copyColumnAndListBoardInRoom.feature
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
#@regression_test
#@stable_test
Feature: Room - Add, remove BBB tool in the room board
@regression_test
@stable_test
Feature: Room - Add and Remove BBB Tool in Room Boards

As a teacher I want to add and remove BBB tool in the room board so that I can manage video confernce.
As a teacher, I want to add and remove the BBB tool in the room board so that I can manage video conferences in the room.

Scenario: Teacher add and remove BBB tool in the room board, including pre-conditions
Scenario: Add and Remove BBB Tool from Room Board
Given I am logged in as a '<teacher>' at '<namespace>'
Given a room with name '<room_name>' exist
Given a multicolumn board with the name '<edited_board_title>' exists in the room
Given a list board with the name '<edited_board_title>' exists in the room

# teacher copies multi column board

# teacher copies list board

# post-condition: teacher deletes room
Given room with name '<room_name>' is deleted


Given a room named '<room_name>' exists
Given a multicolumn board named '<edited_board_title>' exists in the room
#Given a list board named '<edited_board_title>' exists in the room

# Teacher copies the multicolumn board
When I click on the multicolumn board in the room detail page
Then I see the page board details
Then I see the chip Draft
When I click on the three dot menu in room board
When I click on the menu Publish
Then I do not see the chip Draft
When I click on the three dot menu in room board
When I click on the option Copy
Then I see the chip Draft
When I click on the breadcrumb to navigate to the room detail page
Then I see the detail page of room '<room_name>'

# Teacher copies the list board
When I click on the single-column board in the room detail page
Then I see the page board details
Then I see the chip Draft
When I click on the three dot menu in room board
When I click on the menu Publish
Then I do not see the chip Draft
When I click on the three dot menu in room board
When I click on the option Copy
Then I see the chip Draft
When I click on the breadcrumb to navigate to the room detail page
Then I see the detail page of room '<room_name>'

# Post-condition: Delete the room
Given the room named '<room_name>' is deleted

@school_api_test
Examples:
Expand All @@ -28,3 +48,4 @@ Feature: Room - Add, remove BBB tool in the room board
Examples:
| teacher | namespace | room_name | edited_board_title |
| teacher1_brb | brb | Cypress Room Name | Board Cy Title |

32 changes: 31 additions & 1 deletion cypress/support/pages/room_board/pageRoomBoards.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,36 @@ class RoomBoards {
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"]';
static #breadCrumbToRoomNavigationFromBoard = '[data-testid="breadcrumb-1"]';

static #multicolumnBoardSelector = '[data-testid="board-tile-subtitle-0"]';
static #copyOptionSelector = '[data-testid="kebab-menu-action-copy"]';
static #chipDraftSelector = '[data-testid="board-draft-chip"]';
static #publishMenuSelector = '[data-testid="kebab-menu-action-publish"]';

clickMenuPublish() {
cy.get(RoomBoards.#publishMenuSelector).click();
}

verifyDraftChipNotVisible() {
cy.get(RoomBoards.#chipDraftSelector).should("not.be.visible");
}

clickMulticolumnBoardInRoomDetailPage() {
cy.get(RoomBoards.#multicolumnBoardSelector).click();
}

clickOptionCopy() {
cy.get(RoomBoards.#copyOptionSelector).click();
}

verifyChipDraftVisible() {
cy.get(RoomBoards.#chipDraftSelector).should("be.visible");
}

clickOnBreadcrumbToNavigateToRoomDetail() {
cy.get(RoomBoards.#breadCrumbToRoomNavigationFromBoard).click();
}

clearAndType(selector, newTitle) {
cy.get(selector)
Expand Down Expand Up @@ -49,7 +79,7 @@ class RoomBoards {
.should("have.value", boardTitle);
}
clickOutsideTheTitleToSaveTheModifiedTitle() {
cy.get(RoomBoards.#mainPageArea).click("bottom");
cy.get(RoomBoards.#mainPageArea).click("bottom").wait(500);
}
clickOnDeleteInBoardMenu() {
cy.get(RoomBoards.#boardMenuActionDelete).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Given("room with name {string} is deleted", (room_name) => {
rooms.roomIsNotVisibleOnOverviewPage(room_name);
});

Given("a room with name {string} exist", (room_name) => {
Given("a room named {string} exists", (room_name) => {
rooms.navigateToRoomsOverview();
rooms.clickOnCreateRoomFAB();
rooms.showRoomCreationPage();
Expand All @@ -26,27 +26,25 @@ Given("a room with name {string} exist", (room_name) => {
rooms.selectTodayStartDateForRoom();
rooms.selectEndDateForRoom();
rooms.submitRoom();
rooms.seeRoomDetailPage(newRoomName);
rooms.seeRoomDetailPage(room_name);
});

Given(
"a multicolumn board with the name {string} exists in the room",
(edited_board_title) => {
rooms.clickOnAddContentButton();
rooms.seeFabButtonToAddBoard();
rooms.clickOnFabButtonToAddBoard();
roomBoards.seeColumnBoardDialogBox();
roomBoards.clickOnButtonToAddMultiColumnBoard();
roomBoards.seeNewRoomBoardCreatePage();
roomBoards.clickOnThreeDotMenuInRoomBoardTitle();
roomBoards.clickOnEditInBoardMenu();
roomBoards.enterRoomBoardTitle(edited_board_title);
roomBoards.clickOutsideTheTitleToSaveTheModifiedTitle();
roomBoards.seeGivenRoomBoardTitle(edited_board_title);
}
);
Given("a multicolumn board named {string} exists in the room", (edited_board_title) => {
rooms.clickOnAddContentButton();
rooms.seeFabButtonToAddBoard();
rooms.clickOnFabButtonToAddBoard();
roomBoards.seeColumnBoardDialogBox();
roomBoards.clickOnButtonToAddMultiColumnBoard();
roomBoards.seeNewRoomBoardCreatePage();
roomBoards.clickOnThreeDotMenuInRoomBoardTitle();
roomBoards.clickOnEditInBoardMenu();
roomBoards.enterRoomBoardTitle(edited_board_title);
roomBoards.clickOutsideTheTitleToSaveTheModifiedTitle();
roomBoards.seeGivenRoomBoardTitle(edited_board_title);
roomBoards.clickOnBreadcrumbToNavigateToRoomDetail();
});

Given("a list board with the name {string} exists in the room", (edited_board_title) => {
Given("a list board named {string} exists in the room", (edited_board_title) => {
rooms.clickOnAddContentButton();
rooms.seeFabButtonToAddBoard();
rooms.clickOnFabButtonToAddBoard();
Expand All @@ -58,6 +56,7 @@ Given("a list board with the name {string} exists in the room", (edited_board_ti
roomBoards.enterRoomBoardTitle(edited_board_title);
roomBoards.clickOutsideTheTitleToSaveTheModifiedTitle();
roomBoards.seeGivenRoomBoardTitle(edited_board_title);
roomBoards.clickOnBreadcrumbToNavigateToRoomDetail();
});

Given(
Expand Down
24 changes: 24 additions & 0 deletions cypress/support/step_definition/room_boards/roomBoardSteps.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ import RoomBoards from "../../pages/room_board/pageRoomBoards";

const roomBoards = new RoomBoards();

When("I click on the multicolumn board in the room detail page", () => {
roomBoards.clickMulticolumnBoardInRoomDetailPage();
});

When("I click on the option Copy", () => {
roomBoards.clickOptionCopy();
});

When("I click on the menu Publish", () => {
roomBoards.clickMenuPublish(); // Method to click on the Publish menu
});

Then("I do not see the chip Draft", () => {
roomBoards.verifyDraftChipNotVisible(); // Method to verify the Draft chip is not visible
});

Then("I see the chip Draft", () => {
roomBoards.verifyChipDraftVisible();
});

When("I click on the breadcrumb to navigate to the room detail page", () => {
roomBoards.clickOnBreadcrumbToNavigateToRoomDetail();
});

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

0 comments on commit eaa4fde

Please sign in to comment.