diff --git a/cypress/e2e/course/addCtlToolToCourse.feature b/cypress/e2e/course/addCtlToolToCourse.feature index 56ef562a..242ddd46 100644 --- a/cypress/e2e/course/addCtlToolToCourse.feature +++ b/cypress/e2e/course/addCtlToolToCourse.feature @@ -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 diff --git a/cypress/support/pages/course/pageCourses.js b/cypress/support/pages/course/pageCourses.js index 9954b1d0..614f984f 100644 --- a/cypress/support/pages/course/pageCourses.js +++ b/cypress/support/pages/course/pageCourses.js @@ -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') } @@ -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 diff --git a/cypress/support/step_definition/course/toolCourseSteps.spec.js b/cypress/support/step_definition/course/toolCourseSteps.spec.js index 9ac8a73b..87c5536c 100644 --- a/cypress/support/step_definition/course/toolCourseSteps.spec.js +++ b/cypress/support/step_definition/course/toolCourseSteps.spec.js @@ -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) +}) +