fix: e2e tests
This commit is contained in:
parent
dc5706b2c8
commit
419d430dbc
4 changed files with 19 additions and 10 deletions
|
|
@ -19,7 +19,9 @@ export class DocSearchPage {
|
|||
this.searchButton = page.locator('.DocSearch-Button');
|
||||
this.modal = page.locator('.DocSearch-Modal');
|
||||
this.input = page.locator('.DocSearch-Input');
|
||||
this.hits = page.locator('.DocSearch-Hits').first();
|
||||
this.hits = page
|
||||
.locator('.DocSearch-Hits #docsearch-hits_docsearch-list')
|
||||
.first();
|
||||
this.clearButton = page.locator('.DocSearch-Clear');
|
||||
this.firstHit = page
|
||||
.locator('#docsearch-hits_docsearch-list .DocSearch-Hit a')
|
||||
|
|
|
|||
|
|
@ -198,9 +198,9 @@ test.describe('Recent and Favorites', () => {
|
|||
test('Recent search can be pinned', async ({ page }) => {
|
||||
await page
|
||||
.locator('#docsearch-recentSearches-item-0')
|
||||
.locator('[title="Pin this search"]')
|
||||
.locator('[title="Save this search"]')
|
||||
.click();
|
||||
await expect(page.getByText('Pinned')).toBeVisible();
|
||||
await expect(page.getByText('Favorite')).toBeVisible();
|
||||
await expect(
|
||||
page.locator('#docsearch-favoriteSearches-item-0')
|
||||
).toBeVisible();
|
||||
|
|
@ -208,13 +208,15 @@ test.describe('Recent and Favorites', () => {
|
|||
|
||||
test('Pinned can be deleted', async ({ docSearch, page }) => {
|
||||
await page
|
||||
.locator('#docsearch-recentSearches-item-0')
|
||||
.locator('[title="Pin this search"]')
|
||||
.locator('#docsearch-recentSearches-list .DocSearch-Hit')
|
||||
.first()
|
||||
.locator('[title="Save this search"]')
|
||||
.click();
|
||||
await expect(page.getByText('Pinned')).toBeVisible();
|
||||
await expect(page.getByText('Favorite')).toBeVisible();
|
||||
await page
|
||||
.locator('#docsearch-favoriteSearches-item-0')
|
||||
.locator('[title="Remove this saved search"]')
|
||||
.locator('#docsearch-favoriteSearches-list .DocSearch-Hit')
|
||||
.first()
|
||||
.locator('[title="Remove this search from favorites"]')
|
||||
.click();
|
||||
await expect(docSearch.hits).not.toBeVisible();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,11 +26,11 @@
|
|||
"build:examples": "bun --filter './examples/*' build",
|
||||
"fmt": "oxfmt --config ./.oxfmtrc.json .",
|
||||
"pw:clean": "rm -rf playwright-report test-results",
|
||||
"pw:run": "start-server-and-test 'bun run website:test' http://localhost:3000 'playwright test'",
|
||||
"pw:run": "playwright test",
|
||||
"pw:run:chromium": "bun run pw:run -- --project=chromium",
|
||||
"pw:run:firefox": "bun run pw:run -- --project=firefox",
|
||||
"pw:run:webkit": "bun run pw:run -- --project=webkit",
|
||||
"pw:ui": "start-server-and-test 'bun run website:test' http://localhost:3000 'playwright test --ui'",
|
||||
"pw:ui": "playwright test --ui",
|
||||
"lint:css": "stylelint **/src/**/*.css",
|
||||
"lint": "oxlint .",
|
||||
"lint:fix": "oxlint --fix .",
|
||||
|
|
|
|||
|
|
@ -11,6 +11,11 @@ export default defineConfig({
|
|||
baseURL: 'http://localhost:3000',
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
webServer: {
|
||||
command: 'bun run website:test',
|
||||
reuseExistingServer: true,
|
||||
port: 3000,
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
|
|
|
|||
Loading…
Reference in a new issue