Skip to content
Merged
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
9 changes: 7 additions & 2 deletions tests/e2e/features/presentationViewer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ Feature: markdown presentation viewer
As a user
I want to view markdown documents in presentation format
So that I can easily present content in a structured manner

Background:
Given user "admin" has uploaded the markdown file "test-markdown.md" using API
And user "admin" has logged in


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
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
Then the content of the current slide should be "PRESENTATION VIEWER"
5 changes: 5 additions & 0 deletions tests/e2e/pageObjects/PresentationViewerPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ class PresentationViewer {
constructor() {
this.slidesContainerSelector = '#presentation-viewer-main .slides'
this.presentationViewerHomepageSelector = '#presentation-viewer-main'
this.currentSlideSelector = '#presentation-viewer-main section.present'
}

async getCurrentSlideContent() {
return await page.locator(this.currentSlideSelector).innerText()
}
}

Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/stepDefinitions/presentationViewerContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ Then(
await expect(page.locator(presentationViewer.slidesContainerSelector)).toBeVisible()
}
)

Then('the content of the current slide should be {string}', async function (content) {
await expect(page.locator(presentationViewer.currentSlideSelector)).toBeVisible()
const currentSlideContent = await presentationViewer.getCurrentSlideContent()
await expect(currentSlideContent).toBe(content)
})