-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1092 from Financial-Times/ADSDEV-2064/gtm-first-p…
…arty-mode--example
- Loading branch information
Showing
4 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const baseUrl = 'http://localhost:3456' | ||
|
||
describe('examples/ft-ui/gtm', () => { | ||
let response | ||
|
||
it('By default it loads GTM from googletagmanager.com', async () => { | ||
await page.goto(baseUrl, { waitUntil: 'load' }) | ||
await expect(page).toMatchElement('script[src="https://www.googletagmanager.com/gtm.js?id=GTM-NWQJW68"]') | ||
}) | ||
|
||
// Remove this once "ads-first-party-gtm" Toggler flag is removed | ||
if (!process.env.CI) { | ||
it('Behind a flag it loads GTM from first-party proxy', async () => { | ||
await page.goto(`${baseUrl}?ads-first-party-gtm=true`, { waitUntil: 'load' }) | ||
|
||
// Since the query sets the appName to "home-page", the PG load is triggered | ||
// This acts as a proxy for verifying GTM's behaviour | ||
await page.waitForSelector('script[src^="https://www.ft.com/__assets/hashed/pg-ads/adapters"]') | ||
|
||
await expect(page).toMatchElement('script[src="https://www.ft.com/page-resources/"]') | ||
}) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters