1- import { test , expect } from '@playwright/test' ;
1+ import { expect , test } from '@playwright/test' ;
22import { HtmlReaderPage } from '../pageobjects/web-reader.page.ts' ;
33
44test . describe ( 'Test navigation in HTML pub' , ( ) => {
@@ -14,29 +14,6 @@ test.describe('Test navigation in HTML pub', () => {
1414 await expect ( htmlReaderPage . lastChapter ) . toBeVisible ( ) ;
1515 } ) ;
1616
17- test ( 'Click next/previous buttons on first page in paginated mode' , async ( {
18- page,
19- } ) => {
20- const htmlReaderPage = new HtmlReaderPage ( page ) ;
21- await htmlReaderPage . loadPub ( '/html/moby-epub3' ) ;
22- await expect ( htmlReaderPage . nextPageButton ) . toBeVisible ( ) ;
23- await expect ( htmlReaderPage . nextPageButton ) . toBeEnabled ( ) ;
24- await expect ( htmlReaderPage . previousPageButton ) . toBeVisible ( ) ;
25- await expect ( htmlReaderPage . previousPageButton ) . toBeDisabled ( ) ;
26- await htmlReaderPage . nextPageButton . click ( ) ;
27- await htmlReaderPage . loadPage ( ) ;
28- await expect ( htmlReaderPage . nextPageButton ) . toBeVisible ( ) ;
29- await expect ( htmlReaderPage . nextPageButton ) . toBeEnabled ( ) ;
30- await expect ( htmlReaderPage . previousPageButton ) . toBeVisible ( ) ;
31- await expect ( htmlReaderPage . previousPageButton ) . toBeEnabled ( ) ;
32- await htmlReaderPage . previousPageButton . click ( ) ;
33- await htmlReaderPage . loadPage ( ) ;
34- await expect ( htmlReaderPage . nextPageButton ) . toBeVisible ( ) ;
35- await expect ( htmlReaderPage . nextPageButton ) . toBeEnabled ( ) ;
36- await expect ( htmlReaderPage . previousPageButton ) . toBeVisible ( ) ;
37- await expect ( htmlReaderPage . previousPageButton ) . toBeDisabled ( ) ;
38- } ) ;
39-
4017 test ( 'Click next/previous buttons on first page in scrolling mode' , async ( {
4118 page,
4219 } ) => {
@@ -64,34 +41,6 @@ test.describe('Test navigation in HTML pub', () => {
6441 await expect ( htmlReaderPage . previousPageButton ) . toBeDisabled ( ) ;
6542 } ) ;
6643
67- test ( 'Click next/previous buttons on last page in paginated mode' , async ( {
68- page,
69- } ) => {
70- const htmlReaderPage = new HtmlReaderPage ( page ) ;
71- await htmlReaderPage . loadPub ( '/html/moby-epub3' ) ;
72- await expect ( htmlReaderPage . tocButton ) . toBeVisible ( ) ;
73- await htmlReaderPage . tocButton . click ( ) ;
74- await expect ( htmlReaderPage . lastChapter ) . toBeVisible ( ) ;
75- await htmlReaderPage . lastChapter . click ( ) ;
76- await htmlReaderPage . loadPage ( ) ;
77- await expect ( htmlReaderPage . previousPageButton ) . toBeVisible ( ) ;
78- await expect ( htmlReaderPage . previousPageButton ) . toBeEnabled ( ) ;
79- await expect ( htmlReaderPage . nextPageButton ) . toBeVisible ( ) ;
80- await expect ( htmlReaderPage . nextPageButton ) . toBeDisabled ( ) ;
81- await htmlReaderPage . previousPageButton . click ( ) ;
82- await htmlReaderPage . loadPage ( ) ;
83- await expect ( htmlReaderPage . previousPageButton ) . toBeVisible ( ) ;
84- await expect ( htmlReaderPage . previousPageButton ) . toBeEnabled ( ) ;
85- await expect ( htmlReaderPage . nextPageButton ) . toBeVisible ( ) ;
86- await expect ( htmlReaderPage . nextPageButton ) . toBeEnabled ( ) ;
87- await htmlReaderPage . nextPageButton . click ( ) ;
88- await htmlReaderPage . loadPage ( ) ;
89- await expect ( htmlReaderPage . previousPageButton ) . toBeVisible ( ) ;
90- await expect ( htmlReaderPage . previousPageButton ) . toBeEnabled ( ) ;
91- await expect ( htmlReaderPage . nextPageButton ) . toBeVisible ( ) ;
92- await expect ( htmlReaderPage . nextPageButton ) . toBeDisabled ( ) ;
93- } ) ;
94-
9544 test ( 'Click next/previous buttons on last page in scrolling mode' , async ( {
9645 page,
9746 } ) => {
@@ -173,21 +122,6 @@ test.describe('Test navigation in HTML pub', () => {
173122 await expect ( htmlReaderPage . chapterHeading ) . toBeVisible ( ) ;
174123 } ) ;
175124
176- test ( 'Click internal link in paginated mode' , async ( { page } ) => {
177- const htmlReaderPage = new HtmlReaderPage ( page ) ;
178- await htmlReaderPage . loadPub ( '/html/moby-epub3' ) ;
179- await expect ( htmlReaderPage . nextPageButton ) . toBeVisible ( ) ;
180- await expect ( htmlReaderPage . nextPageButton ) . toBeEnabled ( ) ;
181- await expect ( htmlReaderPage . previousPageButton ) . toBeVisible ( ) ;
182- await expect ( htmlReaderPage . previousPageButton ) . toBeDisabled ( ) ;
183- await htmlReaderPage . nextPageButton . click ( ) ;
184- await htmlReaderPage . loadPage ( ) ;
185- await expect ( htmlReaderPage . internalLink ) . toBeVisible ( ) ;
186- await htmlReaderPage . internalLink . click ( ) ;
187- await htmlReaderPage . loadPage ( ) ;
188- await expect ( htmlReaderPage . titlePage ) . toBeVisible ( ) ;
189- } ) ;
190-
191125 test ( 'Click internal link in scrolling mode' , async ( { page } ) => {
192126 const htmlReaderPage = new HtmlReaderPage ( page ) ;
193127 await htmlReaderPage . loadPub ( '/html/moby-epub3' ) ;
@@ -207,22 +141,6 @@ test.describe('Test navigation in HTML pub', () => {
207141 await expect ( htmlReaderPage . titlePage ) . toBeVisible ( ) ;
208142 } ) ;
209143
210- test ( 'Click external link in paginated mode' , async ( { page } ) => {
211- const htmlReaderPage = new HtmlReaderPage ( page ) ;
212- await htmlReaderPage . loadPub ( '/html/moby-epub3' ) ;
213- await expect ( htmlReaderPage . tocButton ) . toBeVisible ( ) ;
214- await htmlReaderPage . tocButton . click ( ) ;
215- await expect ( htmlReaderPage . lastChapter ) . toBeVisible ( ) ;
216- await htmlReaderPage . lastChapter . click ( ) ;
217- await htmlReaderPage . loadPage ( ) ;
218- await expect ( htmlReaderPage . externalLink ) . toBeVisible ( ) ;
219- await htmlReaderPage . externalLink . click ( ) ;
220- const openLink = page . waitForEvent ( 'popup' ) ;
221- const newTab = await openLink ;
222- await newTab . waitForLoadState ( ) ;
223- await expect ( newTab ) . toHaveURL ( 'https://www.gutenberg.org' ) ;
224- } ) ;
225-
226144 test ( 'Remember last location when exit and reenter reader' , async ( {
227145 page,
228146 } ) => {
0 commit comments