Skip to content

Commit

Permalink
Update locators in about pages (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
dualcnhq authored Jan 9, 2025
1 parent 3949fe0 commit 0030a37
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"devDependencies": {
"@playwright/test": "^1.49.0",
"@types/node": "^20.11.17",
"browserstack-node-sdk": "^1.34.23",
"browserstack-node-sdk": "^1.34.33",
"dotenv": "^16.0.3",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const reportName = () => `${process.env.CATEGORY}/${formattedDateTime()}`;
export default defineConfig({
workers: 5,
// Timeout for each test
timeout: 2 * 60 * 1000, // 2 mins
timeout: 3 * 60 * 1000, // 3 mins
// Maximum time the whole test suite can run
globalTimeout: 20 * 60 * 1000, // 20 mins
testDir: './tests',
Expand Down
6 changes: 4 additions & 2 deletions tests/about/about.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ test('Canonical About page has correct title and text', async ({ page }) => {
await page.goto(identifier.about.url);
await expect(page).toHaveTitle(/About IA/);
await expect(page.locator('h1:has-text("About the Internet Archive")')).toBeVisible();
await expect(page.locator('a:has-text("Terms of Service")')).toBeVisible();
await expect(page.locator('a:has-text("Job Opportunities")')).toBeVisible();
await expect(page.locator('#maincontent').locator('a:has-text("Job Opportunities")')).toBeVisible();
await expect(page.locator('#maincontent').locator('a:has-text("Terms of Service")')).toBeVisible();
await expect(page.locator('#maincontent')).toContainText('501(c)(3) non-profit');
await expect(page.locator('news-stories')).toBeVisible();
});

test('About > Jobs page has correct title and text', async ({ page }) => {
Expand All @@ -33,6 +34,7 @@ test('About > Terms of Service page has correct title and text', async ({page})

test('About > News Stories page has correct title and text', async ({page}) => {
await page.goto(identifier.about.news);
await page.waitForURL(/news-stories/);
await expect(page).toHaveTitle(/News Stories/);
await expect(page.locator('h1:has-text("News stories")')).toBeVisible();
await expect(page.locator('#main-content')).toContainText(
Expand Down

0 comments on commit 0030a37

Please sign in to comment.