Skip to content

Commit

Permalink
Merge branch 'main' into BC-5623-changeLanguage_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinpasscon authored Oct 25, 2023
2 parents 53fa64a + 691cb97 commit 282b5a6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cypress/e2e/topics/accessH5PEditor.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@release
Feature: To access the H5P editor as a teacher.

As a teacher, I want to be able to access the H5P Editor for a topic in my course to create learning content

@stable_test
Scenario: Access H5P Editor
Given I am logged in as a 'teacher1_dbc' at 'default'
When I go to rooms overview
When I go to room 'Course with subject and tasks'
When I click on topic 'Statistic' on course page
When I click on the button Edit on topic page
When I click on the Add Content H5P button
Then I can click on the Create H5P button


14 changes: 14 additions & 0 deletions cypress/support/pages/topics/pageTopics.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Topics {
static #addLearningMaterialBtn = '[data-testid="topic-addcontent-material-btn"]'
static #addEtherpadBtn = '[data-testid="topic-addcontent-etherpad-btn"]'
static #addTaskBtn = '[data-testid="topic-addcontent-task-btn"]'
static #addContentH5pBtn = '[data-testid="topic-addcontent-h5p-btn"]'
static #createH5pBtn = '[data-testid="topic-h5p-create-btn"]'
// class is used for cardHeader and cardBlock because the elements are too generic and depend on position of the element, so using data-testid would need much more logic (also in the feature file) and code than using class.
static #cardHeader = '[class="card-header"]'
static #cardBlock = '[class="card-block"]'
Expand Down Expand Up @@ -71,11 +73,23 @@ class Topics {
cy.get(Topics.#addTaskBtn).click()
}

clickOnAddContentH5PToTopic() {
cy.get(Topics.#addContentH5pBtn).click()
}

seeCreateH5PInTopic() {
cy.get(Topics.#createH5pBtn)
.should('exist')
.click()
}

clickOnSubmitChangesInTopicBtn() {
cy.get(Topics.#submitChangesInTopicBtn)
.click()
}



seeFormElementText(textElementPosition) {
if(textElementPosition === '0'){
cy.get(Topics.#textElementPos0).should('exist')
Expand Down
18 changes: 18 additions & 0 deletions cypress/support/step_definition/topics/accessH5PEditor.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { When, Then } = require("@badeball/cypress-cucumber-preprocessor")
import Topics from '../../pages/topics/pageTopics'

const topics = new Topics()

When('I click on the button Edit on topic page', () => {
topics.clickOnButtonEditInTopicPage()
})

When('I click on the Add Content H5P button', () =>{
topics.clickOnAddContentH5PToTopic();
})

Then('I can click on the Create H5P button', ()=>{
topics.seeCreateH5PInTopic();
})


0 comments on commit 282b5a6

Please sign in to comment.