Skip to content

Commit

Permalink
test(img): migrate tests to playwright (#25488)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi authored Jun 16, 2022
1 parent e52392e commit b6e9c01
Show file tree
Hide file tree
Showing 30 changed files with 41 additions and 36 deletions.
10 changes: 0 additions & 10 deletions core/src/components/img/test/basic/e2e.ts

This file was deleted.

12 changes: 12 additions & 0 deletions core/src/components/img/test/basic/img.e2e.ts
Original file line number Diff line number Diff line change
@@ -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`);
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions core/src/components/img/test/draggable/e2e.ts

This file was deleted.

17 changes: 17 additions & 0 deletions core/src/components/img/test/draggable/img.e2e.ts
Original file line number Diff line number Diff line change
@@ -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', '');
});
});
10 changes: 0 additions & 10 deletions core/src/components/img/test/standalone/e2e.ts

This file was deleted.

12 changes: 12 additions & 0 deletions core/src/components/img/test/standalone/img.e2e.ts
Original file line number Diff line number Diff line change
@@ -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`);
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b6e9c01

Please sign in to comment.