Skip to content

Commit

Permalink
N21-2320 share links for board cards
Browse files Browse the repository at this point in the history
  • Loading branch information
MBergCap authored Jan 22, 2025
2 parents ebfa2a9 + 0281da8 commit 158a3de
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 0 deletions.
83 changes: 83 additions & 0 deletions cypress/e2e/course_board/shareBoardCardLink.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# @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
@unstable
Scenario: Teacher shares a link to a board card
Given I am logged in as a '<teacher_2>' at '<namespace>'
Given I am logged in as a '<teacher_1>' at '<namespace>'

# 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 '<course_name>'
Then I see teacher '<fullname_teacher_1>' is selected by default
When I select '<fullname_teacher_2>' 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 '<course_name>' on the course overview page
# first teacher adds a board with a card to the course
When I go to course '<course_name>'
Then I see course page '<course_name>'
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 '<teacher_2>' at '<namespace>'
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 '<course_name>'
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 '<course_name>' 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 |








88 changes: 88 additions & 0 deletions cypress/e2e/room_board/shareBoardCardLinkInRoom.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# @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
@unstable
Scenario: Teacher shares a link to a board card
Given I am logged in as a '<teacher_2>' at '<namespace>'
Given I am logged in as a '<teacher_1>' at '<namespace>'

# 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 '<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 '<school_name>' in school dropdown
Then I see role '<role_name>' in role dropdown
When I enter '<name_teacher_2>' 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 '<name_teacher_1>' in the room participants list
Then I see '<name_teacher_2>' 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 '<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
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 '<teacher_2>' at '<namespace>'
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: first teacher deletes the room
Given I am logged in as a '<teacher_1>' at '<namespace>'
When I go to room overview
When I go to room '<room_name>'
Then I see the detail page of room '<room_name>'
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_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 |








34 changes: 34 additions & 0 deletions cypress/support/pages/course_board/pageBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ class Board {
static #editButtonInThreeDotMenu = '[data-testid="kebab-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();
Expand Down Expand Up @@ -387,5 +389,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;
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down Expand Up @@ -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();
});

0 comments on commit 158a3de

Please sign in to comment.