Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into N21-2292-ctl-tool-tes…
Browse files Browse the repository at this point in the history
…t-in-staging
  • Loading branch information
MBergCap committed Jan 22, 2025
2 parents 5acbe1a + dcaa0e2 commit 58a951e
Show file tree
Hide file tree
Showing 6 changed files with 337 additions and 0 deletions.
82 changes: 82 additions & 0 deletions cypress/e2e/course_board/changeBoardLayout.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# @regression_test
# @stable_test
# Note: the test can be set to stable when the feature is on staging
@unstable
Feature: Course Board - To change the board layout

As a teacher I want to change the board layout

# @stable_test
@unstable
Scenario: Teacher changes board layout
Given I am logged in as a '<teacher>' at '<namespace>'

# pre-condition: 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>' is selected by default
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

# teacher adds a board with multiple columns and cards 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
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 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

# teacher changes board layout to signle column
When I click on three dot menu in the board header
When I click on the option Change layout in three dot menu in course 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 single-column board in the dialog box
Then I see the single-column board

# teacher changes board layout to multi column
When I click on three dot menu in the board header
When I click on the option Change layout in three dot menu in course 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 multi-column board

# post-condition: 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

@staging_test
Examples:
| teacher | namespace | course_name | fullname_teacher |
| teacher1_nbc | nbc | Cypress Test Course | Karl Herzog |

@school_api_test
Examples:
| teacher | namespace | course_name | fullname_teacher |
| teacher1_nbc | nbc | Cypress Test Course | cypress teacher_1 |


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 |








52 changes: 52 additions & 0 deletions cypress/support/pages/course_board/pageBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Board {
static #externalToolElement = '[data-testid="board-external-tool-element"]';
static #deletedElement = '[data-testid="board-deleted-element"]';
static #boardMenuActionPublish = '[data-testid="kebab-menu-action-publish"]';
static #boardMenuActionChangeLayout = '[data-testid="board-menu-action-change-layout"]';
static #boardLayoutDialogBoxTitle = '[data-testid="board-layout-dialog-title"]';
static #multiColumnBoardOptionInDialogBox =
'[data-testid="dialog-add-multi-column-board"]';
Expand All @@ -41,6 +42,9 @@ 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"]';
static #firstBoardColumn = '[data-testid="board-column-0"]'

clickPlusIconToAddCardInColumn() {
cy.get(Board.#addCardInColumnButton).click();
Expand Down Expand Up @@ -76,6 +80,10 @@ class Board {
cy.get(Board.#boardMenuActionPublish).click();
}

clickChangeLayoutOptionInThreeDotMenuInCourseBoard() {
cy.get(Board.#boardMenuActionChangeLayout).click();
}

clickOnFABToCreateNewColumnBoard() {
cy.get(Board.#newColumnBoardFABInCourseDetail).click();
}
Expand Down Expand Up @@ -387,5 +395,49 @@ 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");
}

seeSingleColumnBoard(){
cy.get(Board.#firstBoardColumn)
.should("have.class", "d-flex flex-column align-stretch my-0")
.should("not.have.attr", "style", "min-width: 400px; max-width: 400px;");
}

seeMultiColumnBoard(){
cy.get(Board.#firstBoardColumn)
.should("have.class", "px-4")
.should("have.attr", "style", "min-width: 400px; max-width: 400px;");
}
}
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 @@ -43,6 +47,10 @@ When("I click on the option Publish in three dot menu in course board", () => {
board.clickPublishOptionInThreeDotMenuInCourseBoard();
});

When("I click on the option Change layout in three dot menu in course board", () => {
board.clickChangeLayoutOptionInThreeDotMenuInCourseBoard();
});

Then("I see the chip Draft in the course board", () => {
board.seeDraftChipOnCourseBoard();
});
Expand Down Expand Up @@ -70,3 +78,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();
});
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,11 @@ When("I choose multi-column board in the dialog box", () => {
When("I choose single-column board in the dialog box", () => {
board.clickOnSingleColumnBoardOptionInDialogBox();
});

When("I see the single-column board", () => {
board.seeSingleColumnBoard();
});

When("I see the multi-column board", () => {
board.seeMultiColumnBoard();
});

0 comments on commit 58a951e

Please sign in to comment.