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- 8491 copy boards in the room #282

Merged
merged 18 commits into from
Jan 27, 2025
2 changes: 1 addition & 1 deletion cypress/e2e/admin/forcePasswordChangeTeacher.feature
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Feature: Admin - user must set a new password during login
Given I am logged in as a '<admin>' at '<namespace>'
When I click on administration in menu
When I go to '<role_to_manage>' administration
When I enter '<role_to_manage>' email '<ustudentser_email>' in search input field
When I enter '<role_to_manage>' email '<user_email>' in search input field
When I click edit '<role_to_manage>' button for '<user_email>'
When I click delete user button to delete user with lastname '<user_lastname>'
When I click on delete button in pop up
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Feature: Course Board - To create, edit and delete a single column course board
Given I am logged in as a '<student>' at '<namespace>'
When I go to courses overview
When I go to course '<course_name>'
Then I can see board '<board_title>' on course page
Then I can see board on course page
When I click on card Course Board
Then I see a whiteboard on the board
Then I see '<card_text_content>' in board card text element
Expand Down
3 changes: 3 additions & 0 deletions cypress/e2e/login_management/cloudLogin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ Feature: Login Management - Login of users managed by SVS
Scenario Outline: User makes a direct login with username and password

Given I am logged in as a '<student>' at '<namespace>'
Then I log out
Given I am logged in as a '<teacher>' at '<namespace>'
Then I log out
Given I am logged in as a '<admin>' at '<namespace>'
Then I log out

@staging_test
Examples:
Expand Down
55 changes: 55 additions & 0 deletions cypress/e2e/room_board/copyMultiSingleColumnBoardsInRoom.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@regression_test
@stable_test
Feature: Room - Copy multi-column and single-column boards in the room

As a teacher, I want to copy both multi-column and single-column boards in the room so that I can effectively manage its contents.

Scenario: Copy multi-column and single-column board in the room, including pre & post conditions

# pre-condition: room and boards are existing
Given I am logged in as a '<teacher>' at '<namespace>'
Given a room named '<room_name>' exists
Given a multi-column board named '<new_board_title>' exists in the room
Given a single-column board named '<new_board_title>' exists in the room

# teacher copies the multi-column board
When I click on the multi-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 select the three dot menu action 'publish'
Then I do not see the chip Draft
When I click on the three dot menu in room board
When I select the three dot menu action '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>'
Then I see copied multi-column board tile in the rooms details page

# teacher copies the single-column 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 select the three dot menu action 'publish'
Then I do not see the chip Draft
When I click on the three dot menu in room board
When I select the three dot menu action '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>'
Then I see copied single-column board tile in the room details page

# post-condition: delete the room
Given the room named '<room_name>' is deleted

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

@staging_test
Examples:
| teacher | namespace | room_name | new_board_title |
| teacher1_brb | brb | Cypress Room Name | Board Cy Title |

Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@ Feature: Room - Add, edit and delete board in room
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
# teacher edits the default title of the new multi column board
When I click on the three dot menu in room board
When I select the three dot menu action 'rename'
Then I change the room board title to '<edited_board_title>'
Then I change the default room board title to '<new_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>'
Then I see my room board is named '<new_board_title>'

# cancel delete-process of the new multi column board
When I click on the three dot menu in room board
When I select the three dot menu action 'delete'
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
Then I see the board '<new_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 select the three dot menu action 'delete'
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
Then I do not see the board '<new_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>'
Expand All @@ -59,12 +59,12 @@ Feature: Room - Add, edit and delete board in room
When I click on button to add single column board
Then I see the page board details

# teacher edits title of the new single column board
# teacher edits the default title of the new single column board
When I click on the three dot menu in room board
When I select the three dot menu action 'rename'
Then I change the room board title to '<edited_board_title>'
Then I change the default room board title to '<new_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>'
Then I see my room board is named '<new_board_title>'

# confirm delete-process of single column board
When I click on the three dot menu in room board
Expand All @@ -83,10 +83,10 @@ Feature: Room - Add, edit and delete board in room

@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 |
| teacher | namespace | room_name | new_board_title |
| teacher1_brb | brb | Cypress Room 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 |
| teacher | namespace | room_name | new_board_title |
| teacher1_brb | brb | Cypress Room Name | Board Cy Title |
8 changes: 3 additions & 5 deletions cypress/support/pages/course/pageCourses.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Courses {
static #backToDraftButtonInDotMenuOfTopic =
'[data-testid="lesson-card-menu-action-revert-0"]';
static #taskCardTitleInCoursePageWithIndex = '[data-testid="task-title-0"]';
static #boardCardTitleInCoursePageWithIndex = '[data-testid="board-title-0"]';
static #boardCardTitleInCoursePageWithIndex = '[data-testid="board-card-title-0"]';
static #taskCardThreeDotMenuInCoursePageWithIndex =
'[data-testid="task-card-menu-0"]';
static #taskCardInCoursePageWithIndex = '[data-testid="room-task-card-0"]';
Expand Down Expand Up @@ -464,12 +464,10 @@ class Courses {
.should("be.visible");
}

seeBoardOnCoursePage(boardTitle) {
seeBoardOnCoursePage() {
// no cy.wait('@rooms_api') here as the reload takes care of this
cy.reload(); // Reload is necessary because after deletion of a content element a message window with its title stays hidden in the DOM
cy.get(Courses.#boardCardTitleInCoursePageWithIndex)
.contains(boardTitle)
.should("be.visible");
cy.get(Courses.#boardCardTitleInCoursePageWithIndex).should("be.visible");
}

contentIsNotVisibleOnCoursePage(contentTitle) {
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/pages/mediashelf/pageMediaShelf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MediaShelf {
static #mediaElementNoLongerAvailableChip =
'[data-testid="warning-chip-no-longer-available"]';
static #threeDotMenuOnMediaElement = '[data-testid="board-menu-icon"]';
static #deleteMediaElementButton = '[data-testid="board-menu-action-delete"]';
static #deleteMediaElementButton = '[data-testid="kebab-menu-action-delete"]';
static #createLineButton = '[data-testid="create-line-button"]';
static #emptyStateSign = '[data-testid="empty-state"]';
static #emptyStateInfoText = '[data-testid="emptyTaskMessage"]';
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/pages/room/pageRooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Rooms {
}

seeRoomEditParticipantsPage() {
cy.get(Rooms.#roomTitle).contains("Raum-Mitglieder");
cy.get(Rooms.#roomTitle).should("be.visible");
}

navigateToRoom(roomName) {
Expand Down
55 changes: 53 additions & 2 deletions cypress/support/pages/room_board/pageRoomBoards.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,54 @@ class RoomBoards {
static #mainPageArea = '[id="main-content"]';
static #roomBoardTitleOnPage = '[data-testid="board-title"]';
static #boardMenuIcon = '[data-testid="board-menu-icon"]';
static #btnBoardMenuActionRename = '[data-testid="kebab-menu-action-rename"]';
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"]';
static #singleColumnBoardSelector = '[data-testid="board-tile-title-1"]';
static #multiColumnCopiedBoardSelector = '[data-testid="board-tile-title-2"]';
static #singleColumnCopiedBoardSelector = '[data-testid="board-tile-title-3"]';

verifyMultiColumnCopiedBoardTileVisibleOnRoomDetailsPage() {
cy.get(RoomBoards.#multiColumnCopiedBoardSelector).should("be.visible");
}

verifySingleColumnCopiedBoardTileVisibleOnRoomDetailsPage() {
cy.get(RoomBoards.#singleColumnCopiedBoardSelector).should("be.visible");
}

clickSingleColumnBoardInRoomDetailPage() {
cy.get(RoomBoards.#singleColumnBoardSelector).click();
}

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

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

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 @@ -39,10 +84,13 @@ class RoomBoards {
}
enterRoomBoardTitle(boardTitle) {
cy.get(RoomBoards.#roomBoardTitleOnPage).within(() => {
this.clearAndType("input", boardTitle);
this.clearAndType("input", boardTitle); // Clear and type the new title
cy.get("input").type("{esc}"); // Press Esc after typing, it works this way to save the title in a stable way.
cy.wait(1000);
});
}
seeGivenRoomBoardTitle(boardTitle) {

seeUpdatedRoomBoardTitle(boardTitle) {
cy.get(RoomBoards.#roomBoardTitleOnPage)
.find("input")
.should("have.value", boardTitle);
Expand Down Expand Up @@ -74,6 +122,9 @@ class RoomBoards {
clickOnThreeDotMenuInRoomBoardTitle() {
cy.get(RoomBoards.#boardMenuIcon).click();
}
clickOnEditInBoardMenu() {
cy.get(RoomBoards.#btnBoardMenuActionRename).click();
}
}

export default RoomBoards;
Original file line number Diff line number Diff line change
@@ -1,21 +1,78 @@
import { Given, Then, When } from "@badeball/cypress-cucumber-preprocessor";
import { Given } from "@badeball/cypress-cucumber-preprocessor";
import Board from "../../pages/course_board/pageBoard";
import Courses from "../../pages/course/pageCourses";
import RoomBoards from "../../pages/room_board/pageRoomBoards";
import Rooms from "../../pages/room/pageRooms";

const roomBoards = new RoomBoards();
const rooms = new Rooms();
const courses = new Courses();
const board = new Board();

Given("a course with name {string} exists with {string} as teacher and {string} as student", (courseName, teacherName, studentName) => {
courses.navigateToCoursesOverview();
courses.clickOnCreateCourseFAB();
courses.fillCourseCreationForm(courseName);
courses.selectCourseColour();
courses.selectTeacherInCourseCreatePage(teacherName);
courses.clickOnNextStepsBtnAfterEnteringCourseDetails();
courses.selectStudentInCourseCreatePage(studentName);
courses.clickOnNextStepButtonOnCourseParticipationDetail();
Given("the room named {string} is deleted", (room_name) => {
rooms.openThreeDotMenuForRoom();
rooms.openDeleteInThreeDotMenuForRoom();
rooms.seeConfirmationModalForRoomDeletion();
rooms.clickDeleteInConfirmationModal();
rooms.roomIsNotVisibleOnOverviewPage(room_name);
});

Given("a room named {string} exists", (room_name) => {
rooms.navigateToRoomsOverview();
rooms.clickOnCreateRoomFAB();
rooms.showRoomCreationPage();
rooms.fillRoomFormName(room_name);
rooms.selectRoomColour();
rooms.selectTodayStartDateForRoom();
rooms.selectEndDateForRoom();
rooms.submitRoom();
rooms.seeRoomDetailPage(room_name);
});

Given("a multi-column board named {string} exists in the room", (new_board_title) => {
rooms.clickOnAddContentButton();
rooms.seeFabButtonToAddBoard();
rooms.clickOnFabButtonToAddBoard();
roomBoards.seeColumnBoardDialogBox();
roomBoards.clickOnButtonToAddMultiColumnBoard();
roomBoards.seeNewRoomBoardCreatePage();
roomBoards.clickOnThreeDotMenuInRoomBoardTitle();
roomBoards.clickOnEditInBoardMenu();
roomBoards.enterRoomBoardTitle(new_board_title);
roomBoards.clickOutsideTheTitleToSaveTheModifiedTitle();
roomBoards.seeUpdatedRoomBoardTitle(new_board_title);
roomBoards.clickOnBreadcrumbToNavigateToRoomDetail();
});

Given("a single-column board named {string} exists in the room", (new_board_title) => {
rooms.clickOnAddContentButton();
rooms.seeFabButtonToAddBoard();
rooms.clickOnFabButtonToAddBoard();
roomBoards.seeColumnBoardDialogBox();
roomBoards.clickOnButtonToAddSingleColumnBoard();
roomBoards.seeNewRoomBoardCreatePage();
roomBoards.clickOnThreeDotMenuInRoomBoardTitle();
roomBoards.clickOnEditInBoardMenu();
roomBoards.enterRoomBoardTitle(new_board_title);
roomBoards.clickOutsideTheTitleToSaveTheModifiedTitle();
roomBoards.seeUpdatedRoomBoardTitle(new_board_title);
roomBoards.clickOnBreadcrumbToNavigateToRoomDetail();
});

Given(
"a course with name {string} exists with {string} as teacher and {string} as student",
(courseName, teacherName, studentName) => {
courses.navigateToCoursesOverview();
courses.clickOnCreateCourseFAB();
courses.fillCourseCreationForm(courseName);
courses.selectCourseColour();
courses.selectTeacherInCourseCreatePage(teacherName);
courses.clickOnNextStepsBtnAfterEnteringCourseDetails();
courses.selectStudentInCourseCreatePage(studentName);
courses.clickOnNextStepButtonOnCourseParticipationDetail();
}
);

Given("a board exists in course {string}", (courseName) => {
courses.navigateToCoursesOverview();
courses.navigateToCoursePage(courseName);
Expand All @@ -40,4 +97,4 @@ Given("course with name {string} is deleted", (courseName) => {
courses.confirmCourseDeletionOnModal();
courses.navigateToCoursesOverview();
courses.courseIsNotVisiblOnOverviewPage(courseName);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ When("I can see task {string} on course page", (taskTitle) => {
courses.seeTaskOnCoursePage(taskTitle);
});

When("I can see board {string} on course page", (contentTitle) => {
courses.seeBoardOnCoursePage(contentTitle);
When("I can see board on course page", () => {
courses.seeBoardOnCoursePage();
});

When("I can not see content {string}", (contentTitle) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import Board from "../../pages/course_board/pageBoard";

const board = new Board();

When("I select the three dot menu action {string}", (kebabMenuAction) => {
board.clickOnKebabMenuAction(kebabMenuAction);
});

When("I click on the board", () => {
board.clickOnCourseBoardCardInCourseDetailPage();
});
Expand Down
Loading
Loading