Skip to content

Commit

Permalink
bc-6075 changed method names
Browse files Browse the repository at this point in the history
  • Loading branch information
csp175 committed Jan 10, 2024
1 parent 1ee35b1 commit b934b26
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
@release
Feature: Learnstore - Activating and deactivating access for students
Feature: Learning store - Activating and deactivating access for students

As an admin I want to activate and deactivate students access to learnstore
As an admin I want to activate and deactivate students access to learning store

@stable_test
Scenario Outline: Admin activates and deactivates students access to Learnstore
# Admin deactivates students access to Learnstore - pre-condition to set the needed configuration
Scenario Outline: Admin activates and deactivates students access to Learning store
# Admin deactivates students access to Learning store - pre-condition to set the needed configuration
Given I am logged in as a '<admin>' at '<namespace>'
When I go to administration page
When I go to school administration
When I click the checkbox to disable students access to learnstore
When I click the checkbox to disable students access to learning store
When I click on admin setting save button
Then I see checkbox Disable students is unchecked
# Student doesn't see link to Learnstore in menu
Then I see checkbox to enable students access to learning store is unchecked
# Student doesn't see link to Learning store in menu
Given I am logged in as a '<student>' at '<namespace>'
Then I do not see Learning Store in side bar
# Admin activates students access to Learnstore
# Admin activates students access to Learning store
Given I am logged in as a '<admin>' at '<namespace>'
When I go to administration page
When I go to school administration
When I click the checkbox to enable students access to learnstore
When I click the checkbox to enable students access to learning store
When I click on admin setting save button
# Student sees link to Learnstore in menu
# Student sees link to Learning store in menu
Given I am logged in as a '<student>' at '<namespace>'
Then I see Learning Store in side bar
When I go to LearnStore overview
# Admin deactivates students access to Learnstore again (tests change from access to no-access)
When I go to Learning Store overview
# Admin deactivates students access to Learning store again (tests change from access to no-access)
Given I am logged in as a '<admin>' at '<namespace>'
When I go to administration page
When I go to school administration
When I click the checkbox to disable students access to learnstore
When I click the checkbox to disable students access to learning store
When I click on admin setting save button
# Student doesn't see link to Learnstore in menu
# Student doesn't see link to Learning store in menu
Given I am logged in as a '<student>' at '<namespace>'
Then I do not see Learning Store in side bar

Expand Down
12 changes: 6 additions & 6 deletions cypress/support/pages/admin/pageAdministration.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Management {
static #teamAdministrationNavigationButton = '[data-testid="Teams"]'
static #schoolAdministrationNavigationButton = '[data-testid="Schule"]'
static #studentTeamCheckbox = '[data-testid="student_team_checkbox"]'
static #LearnstoreCheckbox = '[id="studentlernstorevisibility"]'
static #learningstoreStudentAccessCheckbox = '[id="studentlernstorevisibility"]'
static #submitButtonTeamsAdmin = '[data-testid="button_save_team_administration"]'
static #startMigrationButton = '[data-testid="migration-start-button"]'
static #migrationInformationText = '[data-testid="text-description"]'
Expand Down Expand Up @@ -102,16 +102,16 @@ class Management {
})
}

clickCheckboxToDisableAccessToLearnstore () {
cy.get(Management.#LearnstoreCheckbox).uncheck()
clickCheckboxToDisableAccessToLearningstore () {
cy.get(Management.#learningstoreStudentAccessCheckbox).uncheck()
}

clickCheckboxToEnableAccessToLearnstore () {
cy.get(Management.#LearnstoreCheckbox).check()
clickCheckboxToEnableAccessToLearningstore () {
cy.get(Management.#learningstoreStudentAccessCheckbox).check()
}

assertStudentsAccessIsUnchecked() {
cy.get(Management.#LearnstoreCheckbox).should('not.be.checked');
cy.get(Management.#learningstoreStudentAccessCheckbox).should('not.be.checked');
}

clickSaveButtonToAllowStudentCreateTeam () {
Expand Down
15 changes: 7 additions & 8 deletions cypress/support/pages/learning_store/pageLearningStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

class Learning_Store {

static #learnStoreOverviewNavigationButton = '[data-testid="Lern-Store"]'
static #learnstoreMenuLink = '[data-testid="Lern-Store"]'
static #learningstoreMenuLink = '[data-testid="Lern-Store"]'

navigateToLearnStoreOverview() {
navigateToLearningstoreOverview() {
cy.visit('/content')
cy.get(Learning_Store.#learnStoreOverviewNavigationButton).click()
cy.get(Learning_Store.#learningstoreMenuLink).click()
cy.url().should('include', '/content')
}

assertLearnstoreNotVisibleInMenu() {
cy.get(Learning_Store.#learnstoreMenuLink).should('not.exist')
assertLearningstoreNotVisibleInMenu() {
cy.get(Learning_Store.#learningstoreMenuLink).should('not.exist')
}

assertLearnstoreVisibleInMenu() {
cy.get(Learning_Store.#learnstoreMenuLink).should('exist')
assertLearningstoreVisibleInMenu() {
cy.get(Learning_Store.#learningstoreMenuLink).should('exist')
}
}
export default Learning_Store
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
const { When, Then } = require("@badeball/cypress-cucumber-preprocessor")
import Learning_Store from '../../pages/learning_store/pageLearningStore'
import Learning_Store from '../../pages/learning_store/pageLearningstore'

const learningStore = new Learning_Store()
const learningstore = new Learning_Store()

When('I go to LearnStore overview', () => {
learningStore.navigateToLearnStoreOverview()
})
When('I go to Learning Store overview', () => {
learningstore.navigateToLearningstoreOverview()
})

When('I do not see Learning Store in side bar', () => {
learningstore.assertLearningstoreNotVisibleInMenu()
})

When('I see Learning Store in side bar', () => {
learningstore.assertLearningstoreVisibleInMenu()
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { When, Then } = require("@badeball/cypress-cucumber-preprocessor")
import Management from '../../pages/admin/pageAdministration'

const management = new Management()


When('I click the checkbox to disable students access to learning store', () => {
management.clickCheckboxToDisableAccessToLearningstore()
})

When('I click the checkbox to enable students access to learning store', () => {
management.clickCheckboxToEnableAccessToLearningstore()
})

Then('I see checkbox to enable students access to learning store is unchecked', () => {
management.assertStudentsAccessIsUnchecked()
})
41 changes: 0 additions & 41 deletions cypress/support/step_definition/learnstore/learnstoreSteps.spec.js

This file was deleted.

0 comments on commit b934b26

Please sign in to comment.