Skip to content

Commit

Permalink
SEO Index - Fixing Playwright tests (#2601)
Browse files Browse the repository at this point in the history
Fixed: #2572
Affected Route: `*`
  • Loading branch information
amankumarrr committed May 9, 2024
1 parent bd6d14e commit 7340124
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/daily-image-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: ./.github/workflows/template-ui-tests.yml
with:
deploy_url: ${{ inputs.deploy_url || 'https://ssw.com.au' }}
tests_to_run: ${{ inputs.tests_to_run || 'images'}}
tests_to_run: ${{ inputs.tests_to_run || 'images seo-index'}}
continue-on-failure: true

env-output:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
uses: ./.github/workflows/template-ui-tests.yml
with:
deploy_url: ${{ needs.deploy-staging.outputs.url }}
tests_to_run: "images seo-main"
tests_to_run: "images seo-noindex" # staging slot should not be indexed

swap-staging:
name: Swap staging with production
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
uses: ./.github/workflows/template-ui-tests.yml
with:
deploy_url: ${{ needs.pr-deploy.outputs.url }}
tests_to_run: "images seo-pr"
tests_to_run: "images seo-noindex"

pagespeedInsights:
name: Run PageSpeed Insights
Expand Down
11 changes: 11 additions & 0 deletions ui-tests/seo-index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import test, { expect } from "@playwright/test";

test("🔎 Page can be indexed, no 'noindex' found", async ({
page,
baseURL,
}) => {
const response = await page.request.get(baseURL);
const headers = await response.headers();
const x_robot_tag = headers["x-robots-tag"];
expect(x_robot_tag).toBeFalsy();
});
14 changes: 0 additions & 14 deletions ui-tests/seo-main.spec.ts

This file was deleted.

11 changes: 11 additions & 0 deletions ui-tests/seo-noindex.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import test, { expect } from "@playwright/test";

test("🔎 Page cannot be indexed, 'noindex' header found!", async ({
page,
baseURL,
}) => {
const response = await page.request.get(baseURL);
const headers = await response.headers();
const x_robot_tag = headers["x-robots-tag"];
expect(x_robot_tag).toEqual("noindex");
});
14 changes: 0 additions & 14 deletions ui-tests/seo-pr.spec.ts

This file was deleted.

0 comments on commit 7340124

Please sign in to comment.