Skip to content

Commit

Permalink
N21-1298-tool-context-restrictions
Browse files Browse the repository at this point in the history
test for ctl tool context restriction
  • Loading branch information
MBergCap authored Dec 4, 2023
2 parents 332563b + a29383c commit 0eb5ed9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
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)
})


0 comments on commit 0eb5ed9

Please sign in to comment.