Skip to content

Commit b02d211

Browse files
committed
Refactor e2etests
1 parent 59a2751 commit b02d211

8 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"dev": "npm run sync && cross-env NODE_ENV=development FORCE_COLOR=1 npx astro dev",
4444
"dev:local": "FORCE_COLOR=1 dotenv -e .env.development -- npm run dev",
4545
"dev:local:verbose": "FORCE_COLOR=1 dotenv -e .env.development -- npm run dev -- --verbose",
46+
"dev:stop": "astro dev stop",
4647
"format": "npm run format:code && npm run format:style",
4748
"format:code": "FORCE_COLOR=1 npx prettier --write \"@types/**/*.{js,ts}\" \"src/**/*.{js,ts,tsx,astro}\" --plugin=prettier-plugin-astro",
4849
"format:markdown": "FORCE_COLOR=1 npx markdownlint-cli2 --fix \"**/*.{md,mdx}\"",

‎test/e2e/helpers/pageObjectModels/BreadCrumbPage.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ export class BreadCrumbPage extends BasePage {
8383
async openFirstArticleDetail(options?: { navigationMode?: 'client' | 'fresh' }): Promise<void> {
8484
await this.navigateToListingDetail({
8585
listingPath: '/articles',
86-
linkSelector: 'main a[href^="/deep-dive/"], main a[href^="/articles/"]',
86+
linkSelector: 'main a[href^="/articles/"]',
8787
minSegments: 2,
88-
notFoundMessage: 'Could not find deep-dive or article detail link on /articles',
88+
notFoundMessage: 'Could not find article detail link on /articles',
8989
...options,
9090
})
9191
}

‎test/e2e/specs/01-smoke/dynamic-pages.spec.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { BasePage, test, expect, setupConsoleErrorChecker, logConsoleErrors } from '@test/e2e/helpers'
77
import { wait } from '@test/e2e/helpers/waitTimeouts'
88

9-
const articleLinkSelector = 'a[href*="/deep-dive/"]'
9+
const articleLinkSelector = 'a[href*="/articles/"]'
1010
const serviceLinkSelector = 'a[href^="/services/"]:not([href="/services/"])'
1111
const caseStudyLinkSelector = 'a[href*="/case-studies/"]'
1212

@@ -54,8 +54,8 @@ test.describe('Dynamic Pages @smoke', () => {
5454
await expect(page.locator('main#main')).toBeVisible()
5555
await expect(page.locator('h1[id="article-title"]')).toBeVisible()
5656

57-
// Verify we're on a deep-dive detail page from the articles listing
58-
expect(page.getCurrentUrl()).toMatch(/\/deep-dive\/.+/)
57+
// Verify we're on an article detail page from the articles listing
58+
expect(page.getCurrentUrl()).toMatch(/\/articles\/.+/)
5959
})
6060

6161
test('@ready service detail page loads', async ({ page: playwrightPage }) => {

‎test/e2e/specs/02-pages/articles.spec.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ test.describe('Articles Page', () => {
7575
const page = await BasePage.init(playwrightPage)
7676
await page.goto('/articles')
7777

78-
// Get the first deep-dive link from the articles index page
78+
// Get the first article link from the articles index page
7979
await page.click('article a')
80-
// Should navigate to a deep-dive detail page
81-
await page.expectUrl(/\/deep-dive\/[^/]+/)
80+
// Should navigate to an article detail page
81+
await page.expectUrl(/\/articles\/[^/]+/)
8282
})
8383

8484
test('@ready page subtitle displays', async ({ page: playwrightPage }) => {

‎test/e2e/specs/02-pages/tags.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ test.describe('Tags Index Page', () => {
2121
test('@ready tag counts display', async ({ page: playwrightPage }) => {
2222
const page = await BasePage.init(playwrightPage)
2323
await page.goto('/tags')
24-
// Each tag carousel should render at least one deep-dive card link
25-
await page.expectElementVisible('a[href^="/deep-dive/"]')
24+
// Each tag carousel should render at least one article card link
25+
await page.expectElementVisible('a[href^="/articles/"]')
2626
})
2727

2828
test('@ready responsive: mobile view renders correctly', async ({ page: playwrightPage }) => {

‎test/e2e/specs/07-metadata/open-graph.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { BasePage, test, expect } from '@test/e2e/helpers'
88
import { wait } from '@test/e2e/helpers/waitTimeouts'
99

1010
const REQUIRED_META_TAGS = ['og:title', 'og:description']
11-
const articleDetailLinkSelector = 'a[href^="/deep-dive/"], a[href^="/articles/"]:not([href="/articles/"])'
11+
const articleDetailLinkSelector = 'a[href^="/articles/"]:not([href="/articles/"])'
1212

1313
test.describe('Open Graph Metadata', () => {
1414
test('@ready homepage has required OG tags', async ({ page: playwrightPage }) => {

‎test/e2e/specs/07-metadata/seo-tags.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { BasePage, test, expect } from '@test/e2e/helpers'
88
import { wait } from '@test/e2e/helpers/waitTimeouts'
99

10-
const articleDetailLinkSelector = 'a[href^="/deep-dive/"], a[href^="/articles/"]:not([href="/articles/"])'
10+
const articleDetailLinkSelector = 'a[href^="/articles/"]:not([href="/articles/"])'
1111

1212
test.describe('SEO Meta Tags', () => {
1313
test('@ready all pages have meta description', async ({ page: playwrightPage }) => {

‎test/e2e/specs/07-metadata/structured-data.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ interface ContactPageSchema extends JsonLdSchema {
3535
url?: string
3636
}
3737

38-
const articleDetailLinkSelector = 'a[href^="/deep-dive/"], a[href^="/articles/"]:not([href="/articles"])'
38+
const articleDetailLinkSelector = 'a[href^="/articles/"]:not([href="/articles"])'
3939

4040
const expectAbsoluteUrl = (value: unknown): void => {
4141
expect(typeof value).toBe('string')

0 commit comments

Comments
 (0)