Skip to content

Commit 3a5de7d

Browse files
test(content): migrate to Playwright (#25979)
1 parent e9a1195 commit 3a5de7d

27 files changed

+60
-103
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { expect } from '@playwright/test';
2+
import { test } from '@utils/test/playwright';
3+
4+
test.describe('content: basic', () => {
5+
test('should not have visual regressions', async ({ page, skip }) => {
6+
skip.rtl();
7+
skip.mode('ios', 'ion-content does not have mode-specific styling');
8+
9+
await page.goto(`/src/components/content/test/basic`);
10+
11+
await page.setIonViewport();
12+
13+
expect(await page.screenshot()).toMatchSnapshot(`content-diff-${page.getSnapshotSettings()}.png`);
14+
});
15+
});
55.3 KB
Loading
31.9 KB
Loading
50.6 KB
Loading

core/src/components/content/test/basic/e2e.ts

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

core/src/components/content/test/basic/index.html

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<ion-content class="ion-padding" style="text-align: center; flex: 2" id="content">
3030
<ion-content id="content-part">
3131
<f style="height: 50%"></f>
32-
<ion-button onclick="toggleFullscreen()">Toggle content.fullscreen</ion-button>
3332
<p>
3433
<ion-button onclick="toggleDisplay('header')" color="secondary">Toggle header</ion-button>
3534
<ion-button onclick="toggleDisplay('footer')" color="secondary">Toggle footer</ion-button>
@@ -45,11 +44,6 @@
4544
<f></f>
4645
<f></f>
4746
<f></f>
48-
<f></f>
49-
<f></f>
50-
<f></f>
51-
<f></f>
52-
<f></f>
5347
</ion-content>
5448
</ion-content>
5549
<ion-content class="ion-padding" style="display: none" id="content3">
@@ -79,16 +73,7 @@
7973

8074
<script>
8175
const content = document.getElementById('content');
82-
content.scrollEvents = true;
83-
content.addEventListener('ionScrollStart', () => console.log('scroll start'));
84-
content.addEventListener('ionScroll', (ev) => console.log('scroll', ev.detail));
85-
content.addEventListener('ionScrollEnd', () => console.log('scroll end'));
8676

87-
function toggleFullscreen() {
88-
const content = document.getElementById('content');
89-
content.fullscreen = !content.fullscreen;
90-
console.log('content.fullscren =', content.fullscreen);
91-
}
9277
function toggleDisplay(id) {
9378
const el = document.getElementById(id);
9479
el.style.display = !el.style.display ? 'none' : null;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { expect } from '@playwright/test';
2+
import { test } from '@utils/test/playwright';
3+
4+
test.describe('content: fixed', () => {
5+
test('should not have visual regressions', async ({ page, skip }) => {
6+
skip.mode('ios', 'ion-content does not have mode-specific styling');
7+
8+
await page.goto(`/src/components/content/test/fixed`);
9+
10+
await page.setIonViewport();
11+
12+
expect(await page.screenshot()).toMatchSnapshot(`content-fixed-${page.getSnapshotSettings()}.png`);
13+
});
14+
});
64.6 KB
Loading
26.4 KB
Loading
62.3 KB
Loading

0 commit comments

Comments
 (0)