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 @@ -9,7 +9,12 @@ Feature: markdown presentation viewer


Scenario: preview markdown file in presentation viewer
When user "admin" previews markdown file "test-markdown.md" in presentation viewer
When user "admin" previews markdown file "test-markdown.md" in presentation viewer using context menu
Then markdown file "test-markdown.md" should be opened in the presentation viewer
And the content of the current slide should be "PRESENTATION VIEWER"
# close and re-open presentation viewer
When user "admin" closes the presentation viewer
And user "admin" previews markdown file "test-markdown.md" in presentation viewer using context menu
Then markdown file "test-markdown.md" should be opened in the presentation viewer
And the content of the current slide should be "PRESENTATION VIEWER"
# change slide with button in UI
Expand All @@ -25,7 +30,7 @@ Feature: markdown presentation viewer

@skipOnOpenCloud
Scenario: re-open markdown file in presentation viewer after opening in text editor
When user "admin" previews markdown file "test-markdown.md" in presentation viewer
When user "admin" previews markdown file "test-markdown.md" in presentation viewer using context menu
Then markdown file "test-markdown.md" should be opened in the presentation viewer
And the content of the current slide should be "PRESENTATION VIEWER"
When user "admin" opens file "test-markdown.md" in text editor using sidebar panel
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/pageObjects/PresentationViewerPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class PresentationViewer {
this.sidebarPanelSelector = '#app-sidebar'
this.sidebarToggleBtnSelector = '#files-toggle-sidebar'
this.actionsMenuSelector = '#sidebar-panel-actions-select'
this.closePresentationViewerButton = '#app-top-bar-close'
}

async getCurrentSlideContent() {
Expand All @@ -30,6 +31,10 @@ class PresentationViewer {
const key = direction === 'next' ? 'ArrowRight' : 'ArrowLeft'
await page.locator('body').press(key)
}

async closePresentationViewer() {
await page.click(this.closePresentationViewerButton)
}
}

module.exports = PresentationViewer
6 changes: 5 additions & 1 deletion tests/e2e/stepDefinitions/presentationViewerContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Given('user {string} has logged in', async function (user) {
})

When(
'user {string} previews markdown file {string} in presentation viewer',
'user {string} previews markdown file {string} in presentation viewer using context menu',
async function (user, fileName) {
await files.openMDFileInPresentationViewer()
}
Expand Down Expand Up @@ -77,3 +77,7 @@ When(
Then('file {string} should be opened in the text editor', async function (fileName) {
await expect(page.locator(presentationViewer.textEditorContainerSelector)).toBeVisible()
})

When('user {string} closes the presentation viewer', async function (user) {
await presentationViewer.closePresentationViewer()
})
Loading