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

N21-2167 preferred tools for boards #246

Merged
merged 5 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions cypress/e2e/course/contextRestrictionOfCtlTools.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ Feature: Course - Restrict CTL tools to context course, board-element, media-boa
When I click on save external tool button
Then I see the tool 'CY Test Tool All Restrictions' in external tools table
Then I see the tool 'CY Test Tool All Restrictions' in external tools table has context restriction 'Kurs-Tools, Bereiche, Medienregal'
When I click the add external tool button
When I select the tool 'CY Test Tool Preferred Course Restriction' from available tools
When I click on save external tool button
Then I see the tool 'CY Test Tool Preferred Course Restriction' in external tools table
Then I see the tool 'CY Test Tool Preferred Course Restriction' in external tools table has context restriction 'Kurs-Tools'
When I click the add external tool button
When I select the tool 'CY Test Tool Preferred Board Restriction' from available tools
When I click on save external tool button
Then I see the tool 'CY Test Tool Preferred Board Restriction' in external tools table
Then I see the tool 'CY Test Tool Preferred Board Restriction' in external tools table has context restriction 'Bereiche'

@unstable_test
Scenario: Teacher adds ctl tools to context course, board-element and media-board
Expand Down Expand Up @@ -102,9 +112,9 @@ Feature: Course - Restrict CTL tools to context course, board-element, media-boa
When I click on plus icon to add content into card
When I select external tools from the menu
When I click on the tool configuration selection
# Teacher tries to a tool with context restriction course
# Teacher tries to add a tool with context restriction course
Then I do not see tool 'CY Test Tool Course Restriction' in the tool selection
# Teacher tries to a tool with context restriction media-board
# Teacher tries to add a tool with context restriction media-board
Then I do not see tool 'CY Test Tool Media-Board Restriction' in the tool selection
# Teacher adds a tool with context restriction board-element
When I select the tool 'CY Test Tool Board-Element Restriction' from available tools
Expand All @@ -127,6 +137,14 @@ Feature: Course - Restrict CTL tools to context course, board-element, media-boa
Then I see tool 'CY Test Tool 1' is selected
When I click on save external tool button
Then I see an external tool element with tool 'CY Test Tool 1'
# Teacher tries to add a preferred tool with context restriction course
When I click on plus icon to add card in column
When I click on plus icon to add content into card
Then I do not see preferred tool 'CY Test Tool Preferred Course Restriction' in the menu
# Teacher adds a preferred tool with context restriction board
Then I see preferred tool 'CY Test Tool Preferred Board Restriction' in the menu
When I select preferred tool 'CY Test Tool Preferred Board Restriction' from the menu
Then I see an external tool element with tool 'CY Test Tool Preferred Board Restriction'

# Teacher sees ctl tools with context restriction media-board in the media-shelf
When I go to media shelf
Expand All @@ -140,18 +158,15 @@ Feature: Course - Restrict CTL tools to context course, board-element, media-boa
Then I do not see tool 'CY Test Tool Board-Element Restriction' in the available media line

@unstable_test
Scenario: Post-test: Teacher deletes course, admin deletes external tools
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to rooms overview
When I go to room 'Cypress Test 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 'Cypress Test Course' on the room overview page
Scenario: Post-test: Admin deletes a course and external tools
Given I am logged in as a 'admin1_nbc' at 'nbc'
When I click on administration in menu
When I go to course administration page
When I click the delete button for course 'Cypress Test Course' in course table
Then I see the delete modal
When I click the confirmation button on the delete modal
MBergCap marked this conversation as resolved.
Show resolved Hide resolved

# Admin deletes external tools
Given I am logged in as a 'admin1_nbc' at 'nbc'
When I click on administration in menu
When I navigate to new school admin page via sub menu
When I click on external tools panel
Expand All @@ -166,3 +181,7 @@ Feature: Course - Restrict CTL tools to context course, board-element, media-boa
When I confirm deletion on deletion dialog
When I click on delete button of tool 'CY Test Tool All Restrictions'
When I confirm deletion on deletion dialog
When I click on delete button of tool 'CY Test Tool Preferred Course Restriction'
When I confirm deletion on deletion dialog
When I click on delete button of tool 'CY Test Tool Preferred Board Restriction'
When I confirm deletion on deletion dialog
83 changes: 83 additions & 0 deletions cypress/e2e/course_board/createEditDeleteCtlToolInBoard.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
@unstable_test
Feature: Course Board - To add, edit and delete a ctl tool in a board

As a teacher I want to add, edit and delete a ctl tool in my course Board

@unstable_test
Scenario: Pre-test: Admin creates a course and adds external tools to school
Given I am logged in as a 'admin1_nbc' at 'nbc'
When I go to rooms overview

# Admin creates a course
When I click on FAB to create a new room depending on sub menu
Then I see section one area on the course create page
When I enter the course title 'Cypress Test Course'
When I select 'Karl Herzog' from field teacher
When I click on button Next Steps after entering the room detail in section one
Then I see section two area on the course create page
When I select 'Amelia Strobl' from field student
When I click on button Next Steps after selecting room 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

# Admin adds tools via selection
When I click on administration in menu
When I navigate to new school admin page via sub menu
When I click on external tools panel
When I click the add external tool button
When I select the tool 'CY Test Tool Preferred' from available tools
When I click on save external tool button
Then I see the tool 'CY Test Tool Preferred' in external tools table
When I click the add external tool button
When I select the tool 'CY Test Tool Preferred With Param' from available tools
When I click on save external tool button
Then I see the tool 'CY Test Tool Preferred With Param' in external tools table

@unstable_test
Scenario: Teacher adds, edits and deletes tools in a column board
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to rooms overview
When I go to room 'Cypress Test Course'
When I go to the tab contents in course detail 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 detail
Then I 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 plus icon to add content into card
Then I see preferred tool 'CY Test Tool Preferred' in the menu
When I select preferred tool 'CY Test Tool Preferred' from the menu
Then I see an external tool element with tool 'CY Test Tool Preferred'
When I click on plus icon to add content into card
Then I see preferred tool 'CY Test Tool Preferred With Param' in the menu
When I select preferred tool 'CY Test Tool Preferred With Param' from the menu
Then I see tool 'CY Test Tool Preferred With Param' is selected
When I enter 'test' in required custom parameter field 'contextParam'
Then I see custom parameter input field 'contextParam' contains 'test'
When I click on save external tool button
Then I see an external tool element with tool 'CY Test Tool Preferred With Param'

@unstable_test
Scenario: Post-test: Admin deletes a course and external tools
Given I am logged in as a 'admin1_nbc' at 'nbc'
When I click on administration in menu
When I go to course administration page
When I click the delete button for course 'Cypress Test Course' in course table
Then I see the delete modal
When I click the confirmation button on the delete modal

# Admin deletes external tools
When I click on administration in menu
When I navigate to new school admin page via sub menu
When I click on external tools panel
Then I see the external tools table
When I click on delete button of tool 'CY Test Tool Preferred'
When I confirm deletion on deletion dialog
When I click on delete button of tool 'CY Test Tool Preferred With Param'
When I confirm deletion on deletion dialog
15 changes: 15 additions & 0 deletions cypress/support/pages/course_board/pageBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,20 @@ class Board {
clickOnMultiColumnBoardOptionInDialogBox() {
cy.get(Board.#multiColumnBoardOptionInDialogBox).click();
}

seePreferredExternalToolInMenu(toolName) {
MBergCap marked this conversation as resolved.
Show resolved Hide resolved
cy.get(`[data-testid="create-element-preferred-element-${toolName}"]`)
.should("be.visible");
}

selectPreferredExternalToolFromMenu(toolName) {
cy.get(`[data-testid="create-element-preferred-element-${toolName}"]`)
.click();
}

preferredExternalToolIsNotVisibleInMenu(toolName) {
cy.get(`[data-testid="create-element-preferred-element-${toolName}"]`)
.should("not.exist")
}
}
export default Board;
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@ When("I select external tools from the menu", () => {
Then("I see an external tool element with tool {string}", (toolName) => {
board.seeExternalToolElementWithTool(toolName);
});

Then("I see preferred tool {string} in the menu", (toolName) => {
board.seePreferredExternalToolInMenu(toolName);
});

Then("I select preferred tool {string} from the menu", (toolName) => {
board.selectPreferredExternalToolFromMenu(toolName);
});

Then("I do not see preferred tool {string} in the menu", (toolName) => {
board.preferredExternalToolIsNotVisibleInMenu(toolName);
});
Loading