Skip to content
Open
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
2 changes: 1 addition & 1 deletion tests/e2e/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const config = {
minTimeout: parseInt(process.env.MIN_TIMEOUT) || 5,
headless: process.env.HEADLESS === 'true',
debug: process.env.DEBUG === 'true',
targetServer: process.env.TARGET_SERVER.toLowerCase() || 'ocis'
targetServer: (process.env.TARGET_SERVER || 'ocis').toLowerCase()
}

module.exports = config
14 changes: 10 additions & 4 deletions tests/e2e/features/presentationViewer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ Feature: markdown presentation viewer
Scenario: preview markdown file in presentation viewer
When user "admin" previews a markdown file "test-markdown.md" in presentation viewer
Then markdown file "test-markdown.md" should be opened in the presentation viewer


Scenario: check content of a slide
When user "admin" previews a markdown file "test-markdown.md" in presentation viewer
And the content of the current slide should be "PRESENTATION VIEWER"
# change slide with button in UI
When user "admin" navigates to the next slide using navigation button
Then the content of the current slide should be "An extension for OpenCloud & ownCloud Infinite Scale (oCIS) that allows users to create slide presentations directly from markdown files."
When user "admin" navigates to the previous slide using navigation button
Then the content of the current slide should be "PRESENTATION VIEWER"
# change slide with keyboard
When user "admin" navigates to the next slide using keyboard
Then the content of the current slide should be "An extension for OpenCloud & ownCloud Infinite Scale (oCIS) that allows users to create slide presentations directly from markdown files."
When user "admin" navigates to the previous slide using keyboard
Then the content of the current slide should be "PRESENTATION VIEWER"
4 changes: 4 additions & 0 deletions tests/e2e/filesForUpload/test-markdown.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Presentation Viewer
---

An extension for OpenCloud & ownCloud Infinite Scale (oCIS) that allows users to create slide presentations directly from markdown files.

---
## Table of Contents
1. Introduction
Expand Down
20 changes: 19 additions & 1 deletion tests/e2e/pageObjects/PresentationViewerPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,28 @@ class PresentationViewer {
this.slidesContainerSelector = '#presentation-viewer-main .slides'
this.presentationViewerHomepageSelector = '#presentation-viewer-main'
this.currentSlideSelector = '#presentation-viewer-main section.present'
this.navigateNextSlideSelector = 'button[aria-label="next slide"]'
this.navigatePreviousSlideSelector = 'button[aria-label="previous slide"]'
}

async getCurrentSlideContent() {
return await page.locator(this.currentSlideSelector).innerText()
return await page
.locator(this.currentSlideSelector)
.innerText()
.then((text) => text.trim())
}

async changeSlideUsingNavigationButton(direction) {
if (direction === 'next') {
await page.click(this.navigateNextSlideSelector)
} else if (direction === 'previous') {
await page.click(this.navigatePreviousSlideSelector)
}
}

async changeSlideUsingKeyboard(direction) {
const key = direction === 'next' ? 'ArrowRight' : 'ArrowLeft'
await page.locator('body').press(key)
}
}

Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/stepDefinitions/presentationViewerContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ When(
}
)

When(
/^user "([^"]*)" navigates to the (previous|next) slide using navigation button$/,
async function (user, direction) {
await presentationViewer.changeSlideUsingNavigationButton(direction)
}
)

When(
/^user "([^"]*)" navigates to the (previous|next) slide using keyboard$/,
async function (user, direction) {
await presentationViewer.changeSlideUsingKeyboard(direction)
}
)

Then(
'markdown file {string} should be opened in the presentation viewer',
async function (fileName) {
Expand Down