test(note): migrate tests to playwright (#26052)
@ -1,10 +0,0 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
test('note: basic', async () => {
|
||||
const page = await newE2EPage({
|
||||
url: '/src/components/note/test/basic?ionic:_testing=true',
|
||||
});
|
||||
|
||||
const compare = await page.compareScreenshot();
|
||||
expect(compare).toMatchScreenshot();
|
||||
});
|
||||
75
core/src/components/note/test/basic/note.e2e.ts
Normal file
@ -0,0 +1,75 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('note: rendering', () => {
|
||||
test.beforeEach(({ skip }) => {
|
||||
skip.rtl('Note has no custom RTL logic');
|
||||
});
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-note>99</ion-note>
|
||||
`);
|
||||
const note = page.locator('ion-note');
|
||||
expect(await note.screenshot()).toMatchSnapshot(`note-diff-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
|
||||
test('should render color correctly', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-note color="danger">99</ion-note>
|
||||
`);
|
||||
const note = page.locator('ion-note');
|
||||
expect(await note.screenshot()).toMatchSnapshot(`note-color-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('note: item', () => {
|
||||
test.beforeEach(({ skip }) => {
|
||||
skip.mode('ios', 'Only MD ion-item has ion-note specific logic');
|
||||
});
|
||||
test('should not have visual regressions when in the start slot of an item', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-item>
|
||||
<ion-label>Label</ion-label>
|
||||
<ion-note slot="start">Start Note</ion-note>
|
||||
</ion-item>
|
||||
`);
|
||||
const item = page.locator('ion-item');
|
||||
expect(await item.screenshot()).toMatchSnapshot(`note-item-start-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
|
||||
test('should not have visual regressions when in the end slot of an item', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-item>
|
||||
<ion-label>Label</ion-label>
|
||||
<ion-note slot="end">End Note</ion-note>
|
||||
</ion-item>
|
||||
`);
|
||||
const item = page.locator('ion-item');
|
||||
expect(await item.screenshot()).toMatchSnapshot(`note-item-end-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('note: item-divider', () => {
|
||||
test.beforeEach(({ skip }) => {
|
||||
skip.mode('ios', 'Only MD ion-item-divider has ion-note specific logic');
|
||||
});
|
||||
test('should not have visual regressions when in the start slot of an item-divider', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-item-divider>
|
||||
<ion-note slot="start">Start Note</ion-note>
|
||||
</ion-item-divider>
|
||||
`);
|
||||
const itemDivider = page.locator('ion-item-divider');
|
||||
expect(await itemDivider.screenshot()).toMatchSnapshot(`note-item-divider-start-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
|
||||
test('should not have visual regressions when in the end slot of an item-divider', async ({ page }) => {
|
||||
await page.setContent(`
|
||||
<ion-item-divider>
|
||||
<ion-note slot="start">End Note</ion-note>
|
||||
</ion-item-divider>
|
||||
`);
|
||||
const itemDivider = page.locator('ion-item-divider');
|
||||
expect(await itemDivider.screenshot()).toMatchSnapshot(`note-item-divider-end-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 824 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 680 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 579 B |
|
After Width: | Height: | Size: 1020 B |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 6.5 KiB |