Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ package-lock.json
# Ignore Yarn lock file
yarn.lock
/src/assets/reacfoam/@carrotsearch/

# Playwright
/test-results/
/playwright-report/
/playwright/.cache/
15 changes: 1 addition & 14 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,7 @@
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "projects/website-angular/public"
}
],
"styles": ["projects/website-angular/src/styles.scss"],
"scripts": []
}
"builder": "@analogjs/vitest-angular:test"
}
}
},
Expand Down
32 changes: 32 additions & 0 deletions e2e/search.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { test, expect } from '@playwright/test';

test.describe('Search flow', () => {
test('search TP53, click first result, verify detail page', async ({ page }) => {
await page.goto('/content/query?q=TP53');
await expect(page.locator('.result-count')).toBeVisible({ timeout: 15000 });
await expect(page.locator('.result-count')).toContainText('results found');

const firstResult = page.locator('.entry-name').first();
await expect(firstResult).toBeVisible();
await firstResult.click();

await expect(page).toHaveURL(/\/content\/detail\//);
});

test('search nonexistent term, verify no-results section', async ({ page }) => {
await page.goto('/content/query?q=xyzzy_no_match_99999');
await expect(page.locator('.no-results')).toBeVisible({ timeout: 15000 });
await expect(page.locator('.no-results h2')).toContainText('No results found');
});

test('search apoptosis, click a facet, verify filter chip appears', async ({ page }) => {
await page.goto('/content/query?q=apoptosis');
await expect(page.locator('.result-count')).toBeVisible({ timeout: 15000 });

const firstFacet = page.locator('.facet-option').first();
await expect(firstFacet).toBeVisible();
await firstFacet.click();

await expect(page.locator('.filter-chip')).toBeVisible({ timeout: 10000 });
});
});
Loading
Loading