File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,17 @@ Feature: markdown presentation viewer
22 As a user
33 I want to view markdown documents in presentation format
44 So that I can easily present content in a structured manner
5-
5+
66 Background :
77 Given user "admin" has uploaded the markdown file "test-markdown.md" using API
88 And user "admin" has logged in
99
1010
1111 Scenario : preview markdown file in presentation viewer
1212 When user "admin" previews a markdown file "test-markdown.md" in presentation viewer
13- Then markdown file "test-markdown.md" should be opened in the presentation viewer
13+ Then markdown file "test-markdown.md" should be opened in the presentation viewer
14+
15+
16+ Scenario : check content of a slide
17+ When user "admin" previews a markdown file "test-markdown.md" in presentation viewer
18+ Then the content of the current slide should be "PRESENTATION VIEWER"
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ class PresentationViewer {
22 constructor ( ) {
33 this . slidesContainerSelector = '#presentation-viewer-main .slides'
44 this . presentationViewerHomepageSelector = '#presentation-viewer-main'
5+ this . currentSlideSelector = '#presentation-viewer-main section.present'
6+ }
7+
8+ async getCurrentSlideContent ( ) {
9+ return await page . locator ( this . currentSlideSelector ) . innerText ( )
510 }
611}
712
Original file line number Diff line number Diff line change 3939 await expect ( page . locator ( presentationViewer . slidesContainerSelector ) ) . toBeVisible ( )
4040 }
4141)
42+
43+ Then ( 'the content of the current slide should be {string}' , async function ( content ) {
44+ await expect ( page . locator ( presentationViewer . currentSlideSelector ) ) . toBeVisible ( )
45+ const currentSlideContent = await presentationViewer . getCurrentSlideContent ( )
46+ await expect ( currentSlideContent ) . toBe ( content )
47+ } )
You can’t perform that action at this time.
0 commit comments