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-1298 tool context restrictions #160

Merged
merged 9 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions cypress/e2e/course/addCtlToolToCourse.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,14 @@ Feature: Course - To add a ctl tool to a course
Then I can see the tool configuration page title
When I click on the tool configuration selection
Then I can enter 'Test' as tool name in the selection

@unstable_test
Scenario: Teacher can't add a tool with the restricted context 'board-lement'
Given I am logged in as a 'teacher1_nbc' at 'nbc'
When I go to rooms overview
When I go to room 'German'
When I click on the tools tab
When I click on the button to add a tool
Then I can see the tool configuration page title
When I click on the tool configuration selection
Then I can not see tool 'CY Test Tool Board-Element Restriction' in the tool selection list
6 changes: 6 additions & 0 deletions cypress/support/pages/course/pageCourses.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ class Courses {
static #contextExternalToolConfiguratorPageTitle = '[data-testid="context-external-tool-configurator-title"]'
static #groupSelection = '[id="classId_chosen"]'
static #chosenStudents= '[id="studentsId_chosen"] > .chosen-choices'
static #toolConfigurationSelectItem = '[data-testId="configuration-select-item"]'

seeSectionOneAreaOnCourseCreatePage () {
cy.get(Courses.#sectionOneAreaOnCourseCreationPage).should('exist')
}
Expand Down Expand Up @@ -512,5 +514,9 @@ class Courses {
removeGroup (groupName) {
cy.get(Courses.#groupSelection).find('.chosen-choices').contains(groupName).siblings('a').click();
}

checkIfToolIsVisible(toolName) {
cy.get(Courses.#toolConfigurationSelectItem).should('not.contain', toolName);
}
}
export default Courses
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ Then('I can enter {string} as tool name in the selection', toolName => {
courses.enterAnToolNameInToolConfigurationSelect(toolName)
})

Then('I can not see tool {string} in the tool selection list', toolName => {
courses.checkIfToolIsVisible(toolName)
})


Loading