-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from tailor-cms/chore/tweak-visual-testing
Tweak visual tests
- Loading branch information
Showing
4 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect, test } from '@playwright/test'; | ||
|
||
import { AddRepositoryDialog } from '../../pom/catalog/AddRepository'; | ||
import { Catalog } from '../../pom/catalog/Catalog'; | ||
import { percySnapshot } from '../../utils/percy.ts'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
const catalog = new Catalog(page); | ||
await catalog.visit(); | ||
const dialog = new AddRepositoryDialog(page); | ||
await dialog.open(); | ||
const { name } = await dialog.importRepository(); | ||
await page.reload(); | ||
await expect(page.getByText(name)).toBeVisible({ timeout: 10000 }); | ||
await catalog.findRepositoryCard(name).click(); | ||
await page.waitForLoadState('networkidle'); | ||
}); | ||
|
||
test('Take a snapshot of the repository structure page', async ({ page }) => { | ||
await percySnapshot(page, 'Repository structure page'); | ||
}); | ||
|
||
test('Take a snapshot of the settings page', async ({ page }) => { | ||
const tabNavigation = page.getByTestId('repositoryRoot_nav'); | ||
await tabNavigation.getByText('Settings').click(); | ||
await page.waitForLoadState('networkidle'); | ||
await percySnapshot(page, 'Repository settings page'); | ||
}); |