test(img): migrate tests to playwright (#25488)
@ -1,10 +0,0 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
test('img: basic', async () => {
|
||||
const page = await newE2EPage({
|
||||
url: '/src/components/img/test/basic?ionic:_testing=true',
|
||||
});
|
||||
|
||||
const compare = await page.compareScreenshot();
|
||||
expect(compare).toMatchScreenshot();
|
||||
});
|
12
core/src/components/img/test/basic/img.e2e.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('img: basic', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto('/src/components/img/test/basic');
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
expect(await page.screenshot()).toMatchSnapshot(`img-basic-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 63 KiB |
@ -1,16 +0,0 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
test('img: draggable', async () => {
|
||||
const page = await newE2EPage({
|
||||
url: '/src/components/img/test/draggable?ionic:_testing=true',
|
||||
});
|
||||
|
||||
const imgDraggableTrue = await page.find('#img-draggable-true >>> img');
|
||||
expect(imgDraggableTrue.getAttribute('draggable')).toEqual('true');
|
||||
|
||||
const imgDraggableFalse = await page.find('#img-draggable-false >>> img');
|
||||
expect(imgDraggableFalse.getAttribute('draggable')).toEqual('false');
|
||||
|
||||
const imgDraggableUnset = await page.find('#img-draggable-unset >>> img');
|
||||
expect(imgDraggableUnset.getAttribute('draggable')).toEqual(null);
|
||||
});
|
17
core/src/components/img/test/draggable/img.e2e.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('img: draggable', () => {
|
||||
test('should correctly set draggable attribute on inner img element', async ({ page }) => {
|
||||
await page.goto('/src/components/img/test/draggable');
|
||||
|
||||
const imgDraggableTrue = page.locator('#img-draggable-true img');
|
||||
expect(imgDraggableTrue).toHaveAttribute('draggable', 'true');
|
||||
|
||||
const imgDraggableFalse = page.locator('#img-draggable-false img');
|
||||
expect(imgDraggableFalse).toHaveAttribute('draggable', 'false');
|
||||
|
||||
const imgDraggableUnset = page.locator('#img-draggable-unset img');
|
||||
expect(imgDraggableUnset).toHaveAttribute('draggable', '');
|
||||
});
|
||||
});
|
@ -1,10 +0,0 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
test('img: standalone', async () => {
|
||||
const page = await newE2EPage({
|
||||
url: '/src/components/img/test/standalone?ionic:_testing=true',
|
||||
});
|
||||
|
||||
const compare = await page.compareScreenshot();
|
||||
expect(compare).toMatchScreenshot();
|
||||
});
|
12
core/src/components/img/test/standalone/img.e2e.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { test } from '@utils/test/playwright';
|
||||
|
||||
test.describe('img: standalone', () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.goto('/src/components/img/test/standalone');
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
expect(await page.screenshot()).toMatchSnapshot(`img-standalone-${page.getSnapshotSettings()}.png`);
|
||||
});
|
||||
});
|
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 47 KiB |