Skip to content

Commit

Permalink
tests: update screenshots for CI runs
Browse files Browse the repository at this point in the history
  • Loading branch information
chanceaclark committed May 3, 2024
1 parent 782588d commit 66f384f
Show file tree
Hide file tree
Showing 33 changed files with 20 additions and 17 deletions.
3 changes: 0 additions & 3 deletions apps/core/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ config();

export default defineConfig({
testDir: './tests',
expect: {
toHaveScreenshot: { maxDiffPixels: 500 },
},
fullyParallel: true,
reporter: 'html',
use: {
Expand Down
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.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { expect, test } from '@playwright/test';
import routes from '~/tests/routes';

test('blog post card', async ({ page }) => {
// Arrange
await page.goto(routes.BLOG);
await expect(page.getByRole('heading', { name: 'Blog', exact: true })).toBeVisible();
await page.getByRole('heading', { name: 'Blog', exact: true }).waitFor();

await expect(
page.getByRole('heading', { name: 'Blog', exact: true }).locator('..'),
).toHaveScreenshot();
// Act
const blogPostCard = page.getByRole('listitem').filter({ hasText: 'Your first blog post!' });

// Assert
await expect(blogPostCard).toHaveScreenshot();
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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.
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.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import routes from '~/tests/routes';

test('Sheet basic', async ({ page }) => {
await page.goto(routes.QUICK_ADD_93);
await expect(page.getByLabel('Choose options')).toBeVisible();
await page.getByLabel('Choose options').waitFor();
await page.waitForLoadState('networkidle');

await expect(page.getByLabel('Choose options')).toHaveScreenshot();
});
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.
20 changes: 11 additions & 9 deletions apps/core/tests/visual-regression/packages/components/tabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ import { expect, test } from '@playwright/test';
const testAccountEmail = process.env.TEST_ACCOUNT_EMAIL || '';
const testAccountPassword = process.env.TEST_ACCOUNT_PASSWORD || '';

test('Tabs', async ({ page }) => {
test('tabs', async ({ page }) => {
// Arrange
await page.goto('/');

await page.getByLabel('Login').click();
await expect(page.getByLabel('Email')).toBeVisible();

await page.getByRole('link', { name: 'Login' }).click();
await page.getByRole('heading', { name: 'Log In', level: 2 }).waitFor();
await page.getByLabel('Email').fill(testAccountEmail);
await page.getByLabel('Password').fill(testAccountPassword);
await page.getByRole('button', { name: 'Log in' }).click();
await expect(page.getByRole('heading', { name: 'My Account' })).toBeVisible();
await page.getByRole('heading', { name: 'My Account', level: 1 }).waitFor();
await page.getByRole('link', { name: 'Orders' }).click();
await page.getByRole('heading', { name: 'Orders', level: 2 }).waitFor();

await page.getByRole('link', { name: 'Account settings' }).click();
await expect(page.getByLabel('Account Tabs')).toBeVisible();
// Act
const accountTabs = page.getByRole('tablist', { name: 'Account Tabs' });

await expect(page.getByLabel('Account Tabs')).toHaveScreenshot();
// Assert
await expect(accountTabs).toHaveScreenshot();
});

0 comments on commit 66f384f

Please sign in to comment.