Skip to content

Commit 8227fd7

Browse files
committed
update and remove tests
1 parent 71690f1 commit 8227fd7

File tree

4 files changed

+8
-195
lines changed

4 files changed

+8
-195
lines changed

playwright/pageobjects/web-reader.page.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,12 @@ class WebReaderPage {
4444
this.scrollingMode = page.getByText('Scrolling', { exact: true });
4545

4646
// footer
47-
this.nextPageButton = this.page
48-
.getByRole('contentinfo')
49-
.getByRole('button', {
50-
name: 'Next Page',
51-
});
52-
this.previousPageButton = page
53-
.getByRole('contentinfo')
54-
.getByRole('button', { name: 'Previous Page' });
47+
this.nextPageButton = this.page.getByRole('button', {
48+
name: 'Next page',
49+
});
50+
this.previousPageButton = page.getByRole('button', {
51+
name: 'Previous page',
52+
});
5553
}
5654

5755
async changeScreenSize(): Promise<void> {
@@ -294,4 +292,4 @@ class PdfReaderPage extends WebReaderPage {
294292
}
295293
}
296294

297-
export { WebReaderPage, HtmlReaderPage, PdfReaderPage };
295+
export { HtmlReaderPage, PdfReaderPage, WebReaderPage };

playwright/tests/html-reader-navigation.spec.ts

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test, expect } from '@playwright/test';
1+
import { expect, test } from '@playwright/test';
22
import { HtmlReaderPage } from '../pageobjects/web-reader.page.ts';
33

44
test.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
}) => {

src/ui/PageButton.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

tests/PageButton.test.tsx

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)