Skip to content

Test geolocation #13954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Get runner geolocation
run: |
curl https://ipinfo.io

- name: Set up Node environment
uses: ./.github/actions/setup-node-env

Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@guardian/eslint-config-typescript": "9.0.1",
"@guardian/identity-auth": "6.0.1",
"@guardian/identity-auth-frontend": "8.1.0",
"@guardian/libs": "22.5.0",
"@guardian/libs": "0.0.0-canary-20250519114734",
"@guardian/ophan-tracker-js": "2.2.10",
"@guardian/react-crossword": "6.3.0",
"@guardian/shimport": "1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions dotcom-rendering/playwright/lib/cmp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const cmpAcceptAll = async (page: Page, rootIframe?: string): Promise<void> => {
.locator(CMP_LAYER1_ACCEPT_ALL_BUTTON);
await acceptAllButton.click();
// wait for consent settings to apply
await new Promise((r) => setTimeout(r, 2000));
await new Promise((r) => setTimeout(r, 5000));
};

/**
Expand All @@ -38,7 +38,7 @@ const cmpRejectAll = async (page: Page): Promise<void> => {
.locator(CMP_LAYER2_REJECT_ALL_BUTTON);
await rejectAllButton.click();
// wait for consent settings to apply
await new Promise((r) => setTimeout(r, 2000));
await new Promise((r) => setTimeout(r, 5000));
};

const allowRejectAll = (context: BrowserContext): Promise<void> => {
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/playwright/lib/load-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const loadPage = async ({
const paramsString = queryParamsOn
? `?${new URLSearchParams({
adtest: 'fixed-puppies-ci',
_sp_geo_override: `${region}-${region}`,
...queryParams,
}).toString()}`
: '';
Expand Down
2 changes: 2 additions & 0 deletions dotcom-rendering/playwright/tests/article.embeds.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test.describe('Embeds', () => {
await loadPage({
page,
path: '/Article/https://www.theguardian.com/sport/blog/2015/dec/02/the-joy-of-six-sports-radio-documentaries',
region: 'GB',
});
await cmpAcceptAll(page);

Expand All @@ -38,6 +39,7 @@ test.describe('Embeds', () => {
await loadPage({
page,
path: '/Article/https://www.theguardian.com/sport/2019/nov/15/forget-a-super-bowl-slump-the-la-rams-have-a-jared-goff-problem',
region: 'GB',
});
await cmpAcceptAll(page);

Expand Down
Loading