Skip to content

Commit

Permalink
updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
atlldwp committed Jan 17, 2025
1 parent fca3f41 commit 47db6c1
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 58 deletions.
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
14 changes: 7 additions & 7 deletions cypress/e2e/room_board/copyColumnAndListBoardInRoom.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@regression_test
@stable_test
#@regression_test
#@stable_test
Feature: Room - Add, remove BBB tool in the room board

As a teacher I want to add and remove BBB tool in the room board so that I can manage video confernce.
Expand All @@ -10,7 +10,7 @@ Feature: Room - Add, remove BBB tool in the room board
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 column board
# teacher copies multi column board

# teacher copies list board

Expand All @@ -21,10 +21,10 @@ Feature: Room - Add, remove BBB tool in the room board

@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 | edited_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 | edited_board_title |
| teacher1_brb | brb | Cypress Room Name | Board Cy Title |
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ 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 click on edit in board menu
Then I change the room board title to '<edited_board_title>'
Then I change the default 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>'

Expand Down Expand Up @@ -59,10 +59,10 @@ 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 click on edit in board menu
Then I change the room board title to '<edited_board_title>'
Then I change the default 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>'

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 | edited_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 | edited_board_title |
| teacher1_brb | brb | Cypress Room Name | Board Cy Title |
47 changes: 25 additions & 22 deletions cypress/support/pages/course/pageCourses.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ class Courses {
'[data-testid="lesson-card-menu-action-remove-0"]';
static #editButtonInDotMenu = '[data-testid="room-task-card-menu-edit-0"]';
static #editButtonInDotMenuOfTopic = '[data-testid="lesson-card-menu-action-edit-0"]';
static #backToDraftButtonInDotMenuOfTopic = '[data-testid="lesson-card-menu-action-revert-0"]';
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"]';
static #topicCardPublishBtn = '[data-testid="lesson-card-action-publish-0"]'
static #topicCardPublishBtn = '[data-testid="lesson-card-action-publish-0"]';
static #dropDownCourse = '[data-testid="room-menu"]';
static #btnCourseEdit = '[data-testid="room-menu-edit-delete"]';
static #pageTitle = '[id="page-title"]';
Expand Down Expand Up @@ -103,12 +104,13 @@ class Courses {
static #studentGroupNameOnStudentGroupPage = '[data-testid="group-name-entry"]';
static #editGroupButton = '[data-testid="edit-group"]';
static #deleteCourseGroupButton = '[data-testid="delete-course-group"]';
static #deleteCourseGroupConfirmationButton = '[data-testid="delete-course-group-btn"]';
static #deleteCourseGroupConfirmationButton =
'[data-testid="delete-course-group-btn"]';
static #videoConferenceCheckBoxCourse = '[data-testid="videoconf_checkbox"]';
static #toolsTabInCourseDetail = '[data-testid="tools-tab"]';
static #bbbToolIconInToolsTabCourse = '[data-testid="vc-card-logo"]';
static #bbbVideoStartDialogBoxCourse =
'[data-testid="videoconference-config-dialog-title"]';
'[data-testid="video-conference-config-dialog"]';
static #bbbDialogBoxCancelButtonCourse = '[data-testid="dialog-cancel"]';
static #bbbDisabledCheckBoxCourse = '[data-testid="videoconf_checkbox"]';
static #addBBBButton = '[data-testid="submit-btn-add-bbb-tool-modal"]';
Expand Down Expand Up @@ -395,7 +397,7 @@ class Courses {

clickOnAddNewToolFAB() {
cy.get(Courses.#addToolButton)
.invoke('css', 'transform', 'translateY(5px)') // remove this invoke after the bug is fixed - Ticket:
.invoke("css", "transform", "translateY(5px)") // remove this invoke after the bug is fixed - Ticket:
.click();
}

Expand Down Expand Up @@ -462,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 Expand Up @@ -658,7 +658,8 @@ class Courses {
deleteCoursesByName(courseLabel, courseName) {
cy.get(`[class="rooms-container"]`).then(($coursesContainer) => {
if (
$coursesContainer.find(`[aria-label="${courseLabel} ${courseName}"]`).length
$coursesContainer.find(`[aria-label="${courseLabel} ${courseName}"]`)
.length
) {
cy.get(`[aria-label="${courseLabel} ${courseName}"]`).then(($courses) => {
if ($courses) {
Expand Down Expand Up @@ -855,7 +856,9 @@ class Courses {
}

seeNumberOfTools(count) {
cy.get(Courses.#courseExternalToolSection).children().should("have.length", count);
cy.get(Courses.#courseExternalToolSection)
.children()
.should("have.length", count);
}

seeToolIsMarkedAsDeactivated(toolName) {
Expand Down Expand Up @@ -1167,25 +1170,25 @@ class Courses {
}

launchTool(toolName, toolURL) {
const launchedTool = { toolName: toolName, isLaunched: false };
const launchedTool = { toolName: toolName, isLaunched: false };

cy.window().then((win) => {
cy.stub(win, "open").as("openStub").callsFake((url) => {
expect(url).to.contain(toolURL);
launchedTool.isLaunched = true;
});
cy.stub(win, "open")
.as("openStub")
.callsFake((url) => {
expect(url).to.contain(toolURL);
launchedTool.isLaunched = true;
});
});

cy.wrap(launchedTool).as("launchedTool");

cy.get(Courses.#courseExternalToolSection)
.contains(toolName)
.click();
cy.get(Courses.#courseExternalToolSection).contains(toolName).click();

cy.get("@openStub").invoke("restore")
cy.get("@openStub").invoke("restore");
}

toolWasLaunched(toolName){
toolWasLaunched(toolName) {
cy.get("@launchedTool").then((launchedTool) => {
expect(launchedTool.toolName).to.equal(toolName);
expect(launchedTool.isLaunched).to.be.true;
Expand Down
8 changes: 4 additions & 4 deletions cypress/support/pages/course_board/pageBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class Board {
static #addColumnTitleInput = '[data-testid="column-title-0"]';
static #addNewCardButtonInColumn = '[data-testid="column-0-add-card-btn"]';
static #mainPageArea = '[id="main-content"]';
static #editOptionThreeDot = '[data-testid="board-menu-action-edit"]';
static #editOptionThreeDot = '[data-testid="kebab-menu-action-rename"]';
static #threeDotMenuInColumn = '[data-testid="column-menu-btn-0"]';
static #threeDotMenuInCard = '[data-testid="card-menu-btn-0-0"]';
static #threeDotMenuOnDeletedElement = '[data-testid="deleted-element-menu-btn"]';
static #deleteOptionThreeDot = '[data-testid="board-menu-action-delete"]';
static #deleteOptionThreeDot = '[data-testid="kebab-menu-action-delete"]';
static #confirmButtonInModal = '[data-testid="dialog-confirm"]';
static #deleteDialogBox = '[data-testid="dialog-title"]';
static #drawingElement = '[data-testid="drawing-element"]';
Expand All @@ -22,7 +22,7 @@ class Board {
static #newColumnBoardFABInCourseDetail = '[data-testid="fab_button_add_board"]';
static #threeDotInCourseBoardTitle = '[data-testid="board-menu-icon"]';
static #editOptionInThreeDotCourseBoardTitle =
'[data-testid="board-menu-action-edit"]';
'[data-testid="kebab-menu-action-rename"]';
static #draftChipInCourseBoardName = '[data-testid="board-draft-chip"]';
static #addCardInColumnButton = '[data-testid="column-0-add-card-btn"]';
static #addContentIntoCardButton = '[data-testid="add-element-btn"]';
Expand All @@ -31,7 +31,7 @@ class Board {
'[data-testid="create-element-external-tool-container"]';
static #externalToolElement = '[data-testid="board-external-tool-element"]';
static #deletedElement = '[data-testid="board-deleted-element"]';
static #boardMenuActionPublish = '[data-testid="board-menu-action-publish"]';
static #boardMenuActionPublish = '[data-testid="kebab-menu-action-publish"]';
static #boardLayoutDialogBoxTitle = '[data-testid="board-layout-dialog-title"]';
static #multiColumnBoardOptionInDialogBox =
'[data-testid="dialog-add-multi-column-board"]';
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
8 changes: 2 additions & 6 deletions cypress/support/pages/room/pageRooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Rooms {
// static #goToRoomOverviewButton = '[data-testid="Rooms"]';
static #roomDetailFAB = '[data-testid="room-menu"]';
static #roomDetailFABEdit = '[data-testid="room-action-edit"]';
static #roomDetailFABParticipants = '[data-testid="room-action-manage-participants"]';
static #roomDetailFABParticipants = '[data-testid="room-action-manage-members"]';
static #roomDetailFABDelete = '[data-testid="room-action-delete"]';
static #addContentButton = '[data-testid="add-content-button"]';
static #fabButtonAddBoard = '[data-testid="fab_button_add_board"]';
Expand All @@ -28,8 +28,6 @@ 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 @@ -94,7 +92,7 @@ class Rooms {
}

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

navigateToRoom(roomName) {
Expand Down Expand Up @@ -181,7 +179,5 @@ class Rooms {
clickOnFabButtonToAddBoard() {
cy.get(Rooms.#fabButtonAddBoard).click();
}


}
export default Rooms;
10 changes: 6 additions & 4 deletions cypress/support/pages/room_board/pageRoomBoards.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
class RoomBoards {
static #btnDialogCancel = '[data-testid="dialog-cancel"]';
static #btnDialogConfirm = '[data-testid="dialog-confirm"]';
static #boardMenuActionDelete = '[data-testid="board-menu-action-delete"]';
static #boardMenuActionDelete = '[data-testid="kebab-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 #btnBoardMenuActionEdit = '[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"]';
Expand Down Expand Up @@ -44,7 +44,9 @@ class RoomBoards {
});
}
seeGivenRoomBoardTitle(boardTitle) {
cy.get(RoomBoards.#roomBoardTitleOnPage).find('input').should('have.value', boardTitle);
cy.get(RoomBoards.#roomBoardTitleOnPage)
.find("input")
.should("have.value", boardTitle);
}
clickOutsideTheTitleToSaveTheModifiedTitle() {
cy.get(RoomBoards.#mainPageArea).click("bottom");
Expand Down Expand Up @@ -78,4 +80,4 @@ class RoomBoards {
}
}

export default RoomBoards;
export default RoomBoards;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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";
Expand Down
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 @@ -31,7 +31,7 @@ When("I click on edit in board menu", () => {
roomBoards.clickOnEditInBoardMenu();
});

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

Expand Down Expand Up @@ -62,4 +62,3 @@ When("I click on the button to confirm the deletion", () => {
Then("I do not see the board {string} in the room", (boardTitle) => {
roomBoards.doNotSeeBoardOnRoomDetailPage(boardTitle);
});

0 comments on commit 47db6c1

Please sign in to comment.