From bc3d13edfa00a429d6a727b7b866cec00845a3e1 Mon Sep 17 00:00:00 2001 From: MBergCap Date: Thu, 16 Jan 2025 12:11:16 +0100 Subject: [PATCH 1/4] add shareBoardCardLink test --- .../course_board/shareBoardCardLink.feature | 80 +++++++++++++++++++ .../support/pages/course_board/pageBoard.js | 34 ++++++++ .../course_board/commonBoardSteps.spec.js | 20 +++++ 3 files changed, 134 insertions(+) create mode 100644 cypress/e2e/course_board/shareBoardCardLink.feature diff --git a/cypress/e2e/course_board/shareBoardCardLink.feature b/cypress/e2e/course_board/shareBoardCardLink.feature new file mode 100644 index 000000000..1885183ad --- /dev/null +++ b/cypress/e2e/course_board/shareBoardCardLink.feature @@ -0,0 +1,80 @@ +@regression_test +@stable_test +Feature: Course Board - To share a board card link + + As a teacher I want to share a link to a board card. + + @stable_test + Scenario: Teacher shares a link to a board card + Given I am logged in as a '' at '' + Given I am logged in as a '' at '' + + # pre-condition: first teacher creates a course + When I go to courses overview + When I click on FAB to create a new course depending on sub menu + Then I see section one area on the course create page + When I enter the course title '' + Then I see teacher '' is selected by default + When I select '' from field teacher + When I click on button Next Steps after entering the course detail in section one + Then I see section two area on the course create page + When I click on button Next Steps after selecting course participant details + Then I see the section three area as the finish page + When I click on button To Course Overview on the finish page + Then I see the course '' on the course overview page + # first teacher adds a board with a card to the course + When I go to course '' + Then I see course page '' + When I click on FAB to create new content + When I click on the button FAB New Column Board + Then I see a dialog box for column board + Then I see in dialog box option for multi-column board + Then I see in dialog box option for single column board + When I choose multi-column board in the dialog box + Then I see the page Course Board details + Then I see the chip Draft in the course board + When I click on three dot menu in the board header + When I click on the option Publish in three dot menu in course board + Then I do not see the chip Draft in the course board + When I click on the button Add column in the course board + When I click on the page outside of the column + When I click on plus icon to add card in column + When I click on the page outside of the card + Then I see a board card + + # first teacher copies link to board card + When I click on three dot menu in the card + When I select the option Copy link to card in three dot menu on the card + + # second teacher opens link to board card + Given I am logged in as a '' at '' + When I open the link to a board card + Then I see the page Course Board details + Then I see the focused board card + + # post-condition: second teacher deletes course + When I go to courses overview + When I go to course '' + When I open page Edit course + When I click on the button delete course + Then I see the modal to confirm the deletion + When I click on the button delete on the modal to confirm the course deletion + Then I do not see the course '' on the course overview page + + @school_api_test + Examples: + | teacher_1 | teacher_2 | namespace | fullname_teacher_1 | fullname_teacher_2 | course_name | + | teacher1_nbc | teacher2_nbc | nbc | cypress teacher_1 | cypress teacher_2 | Cypress Test Course | + + @staging_test + Examples: + | teacher_1 | teacher_2 | namespace | fullname_teacher_1 | fullname_teacher_2 | course_name | + | teacher1_nbc | teacher2_nbc | nbc | Karl Herzog | Lara Hande | Cypress Test Course | + + + + + + + + diff --git a/cypress/support/pages/course_board/pageBoard.js b/cypress/support/pages/course_board/pageBoard.js index 9939541b6..96b9a70ba 100644 --- a/cypress/support/pages/course_board/pageBoard.js +++ b/cypress/support/pages/course_board/pageBoard.js @@ -40,6 +40,8 @@ class Board { static #editButtonInThreeDotMenu = '[data-testid="board-menu-action"]'; static #externalToolElementAlert = '[data-testid="board-external-tool-element-alert"]'; + static #boardCard = '[data-testid="board-card-0-0"]'; + static #copyBoardCardLinkButton = '[data-testid="board-menu-action-share-link"]'; clickPlusIconToAddCardInColumn() { cy.get(Board.#addCardInColumnButton).click(); @@ -378,5 +380,37 @@ class Board { seeDeletedElement(name) { cy.get(Board.#deletedElement).contains(name).should("be.visible"); } + + seeBoardCard() { + cy.get(Board.#boardCard).should("be.visible"); + } + + selectCopyLinkToCardInThreeDotMenu(){ + cy.get(Board.#copyBoardCardLinkButton).click(); + + cy.window().then((win) => { + return win.navigator.clipboard.readText(); + }).then((link) => { + cy.wrap(link).as("boardCardLink"); + + cy.url().then((currentUrl) => { + expect(link).to.include(currentUrl); + }); + }); + } + + openBoardCardLink(){ + cy.get("@boardCardLink").then((link) => { + cy.visit(link); + }); + } + + clickOutsideTheCardToSaveTheCard() { + cy.get(Board.#mainPageArea).click("bottom"); + } + + seeFocusedBoardCard() { + cy.get(Board.#boardCard).should("be.focused"); + } } export default Board; diff --git a/cypress/support/step_definition/course_board/commonBoardSteps.spec.js b/cypress/support/step_definition/course_board/commonBoardSteps.spec.js index c11655d61..18d5d71a3 100644 --- a/cypress/support/step_definition/course_board/commonBoardSteps.spec.js +++ b/cypress/support/step_definition/course_board/commonBoardSteps.spec.js @@ -15,6 +15,10 @@ When("I select the option Edit in three dot menu on the card", () => { board.selectEditInThreeDotMenu(); }); +When("I select the option Copy link to card in three dot menu on the card", () => { + board.selectCopyLinkToCardInThreeDotMenu(); +}); + When("I click the edit button in three dot menu on the element", () => { board.clickEditButtonInThreeDotMenu(); }); @@ -70,3 +74,19 @@ Then("I see a whiteboard on the board", () => { Then("I select whiteboard from the menu", () => { board.selectWhiteboardFromMenu(); }); + +Then("I see a board card", () => { + board.seeBoardCard(); +}); + +When("I open the link to a board card", () => { + board.openBoardCardLink(); +}); + +When("I click on the page outside of the card", () => { + board.clickOutsideTheCardToSaveTheCard(); +}); + +Then("I see the focused board card", () => { + board.seeFocusedBoardCard(); +}); \ No newline at end of file From de077ff2ca8243b7f6f2ab0748a92be32aedd0cb Mon Sep 17 00:00:00 2001 From: MBergCap Date: Thu, 16 Jan 2025 12:11:36 +0100 Subject: [PATCH 2/4] add shareBoardCardLinkInRoom test --- .../shareBoardCardLinkInRoom.feature | 85 +++++++++++++++++++ cypress/support/pages/room/pageRooms.js | 2 +- 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/room_board/shareBoardCardLinkInRoom.feature diff --git a/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature b/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature new file mode 100644 index 000000000..40a23d304 --- /dev/null +++ b/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature @@ -0,0 +1,85 @@ +@regression_test +@stable_test +Feature: Room Board - To share a board card link + + As a teacher I want to share a link to a board card. + + @stable_test + Scenario: Teacher shares a link to a board card + Given I am logged in as a '' at '' + Given I am logged in as a '' at '' + + # pre-condition: first teacher creates a 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 '' + When I click on the button to save the room + When I click on three dot menu in room page + When I click on participants option in room menu + When I click on FAB to add participants + Then I see add participants modal + Then I see school '' in school dropdown + Then I see role '' in role dropdown + When I enter '' in name dropdown + When I select the first name from the dropdown + When I click on the button to add the participant + Then I see '' in the room participants list + Then I see '' in the room participants list + # first teacher adds a board with a card to the room + When I go to room overview + When I go to room '' + 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 + Then I see the chip Draft in the course board + When I click on three dot menu in the board header + When I click on the option Publish in three dot menu in course board + Then I do not see the chip Draft in the course board + When I click on the button Add column in the course board + When I click on the page outside of the column + When I click on plus icon to add card in column + When I click on the page outside of the card + Then I see a board card + + # first teacher copies link to board card + When I click on three dot menu in the card + When I select the option Copy link to card in three dot menu on the card + + # second teacher opens link to board card + Given I am logged in as a '' at '' + When I open the link to a board card + Then I see the page Course Board details + Then I see the focused board card + + # post-condition: second teacher deletes the room + Given I am logged in as a '' at '' + When I go to room overview + When I go to room '' + Then I see the detail page of 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 '' on room overview page + + @school_api_test + Examples: + | teacher_1 | teacher_2 | namespace | name_teacher_1 | name_teacher_2 | room_name | role_name | school_name | + | teacher1_nbc | teacher2_nbc | nbc | teacher_1 | teacher_2 | Cypress Test Room | Lehrkraft | cypress-automated-tests | + + @staging_test + Examples: + | teacher_1 | teacher_2 | namespace | name_teacher_1 | name_teacher_2 | room_name | role_name | school_name | + | teacher1_nbc | teacher2_nbc | nbc | Herzog | Hande | Cypress Test Room | Lehrkraft | Felix Mendelssohn-Gymnasium | + + + + + + + + diff --git a/cypress/support/pages/room/pageRooms.js b/cypress/support/pages/room/pageRooms.js index c5ea82b21..87ca7529c 100644 --- a/cypress/support/pages/room/pageRooms.js +++ b/cypress/support/pages/room/pageRooms.js @@ -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"]'; From 34472af3a06f60f52ba15a1b4e0bffcb63c6de6f Mon Sep 17 00:00:00 2001 From: MBergCap Date: Thu, 16 Jan 2025 12:24:41 +0100 Subject: [PATCH 3/4] fix --- cypress/e2e/room_board/shareBoardCardLinkInRoom.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature b/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature index 40a23d304..0662f036f 100644 --- a/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature +++ b/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature @@ -55,7 +55,7 @@ Feature: Room Board - To share a board card link Then I see the page Course Board details Then I see the focused board card - # post-condition: second teacher deletes the room + # post-condition: first teacher deletes the room Given I am logged in as a '' at '' When I go to room overview When I go to room '' From 0281da8bf836c3ca757c793fc75842bbac43c6d7 Mon Sep 17 00:00:00 2001 From: MBergCap Date: Wed, 22 Jan 2025 09:49:08 +0100 Subject: [PATCH 4/4] set test to unstable --- cypress/e2e/course_board/shareBoardCardLink.feature | 9 ++++++--- cypress/e2e/room_board/shareBoardCardLinkInRoom.feature | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/course_board/shareBoardCardLink.feature b/cypress/e2e/course_board/shareBoardCardLink.feature index 1885183ad..cdcbd8350 100644 --- a/cypress/e2e/course_board/shareBoardCardLink.feature +++ b/cypress/e2e/course_board/shareBoardCardLink.feature @@ -1,10 +1,13 @@ -@regression_test -@stable_test +# @regression_test +# @stable_test +# Note: the test can be set to stable when the feature is on staging +@unstable Feature: Course Board - To share a board card link As a teacher I want to share a link to a board card. - @stable_test + # @stable_test + @unstable Scenario: Teacher shares a link to a board card Given I am logged in as a '' at '' Given I am logged in as a '' at '' diff --git a/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature b/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature index 0662f036f..7bcdbfefd 100644 --- a/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature +++ b/cypress/e2e/room_board/shareBoardCardLinkInRoom.feature @@ -1,10 +1,13 @@ -@regression_test -@stable_test +# @regression_test +# @stable_test +# Note: the test can be set to stable when the feature is on staging +@unstable Feature: Room Board - To share a board card link As a teacher I want to share a link to a board card. - @stable_test + # @stable_test + @unstable Scenario: Teacher shares a link to a board card Given I am logged in as a '' at '' Given I am logged in as a '' at ''