Skip to content

Commit

Permalink
Unskip liveblog-ad-limit test (#1685)
Browse files Browse the repository at this point in the history
* Unskip liveblog-ad-limit test

* Wait for window.mockLiveUpdate function to be available

* Wait for mockLiveUpdate in liveblog-live-update
  • Loading branch information
arelra authored Nov 27, 2024
1 parent 2316ce8 commit a446fff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions playwright/tests/liveblog-ad-limit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import { cmpAcceptAll } from '../lib/cmp';
import { loadPage } from '../lib/load-page';
import { countLiveblogInlineSlots } from '../lib/util';

/**
* TODO serial e2e tests
* - It would be good to see if these tests could be run in parallel in the future
*/
const pages = blogs.filter(({ name }) => name === 'under-ad-limit');

const desktopBreakpoint = breakpoints.filter(
Expand All @@ -22,6 +18,8 @@ const MAX_AD_SLOTS = 8;
const addAndAwaitNewBlocks = async (page: Page, blockContent: string) => {
// scroll to the top so we get a toast to click on
await page.evaluate(() => window.scrollTo(0, 0));
// @ts-expect-error -- browser land
await page.waitForFunction(() => window.mockLiveUpdate !== undefined);
await page.evaluate((blockContent) => {
// @ts-expect-error -- browser land
// eslint-disable-next-line @typescript-eslint/no-unsafe-call -- browser land
Expand Down Expand Up @@ -51,7 +49,7 @@ const addAndAwaitNewBlocks = async (page: Page, blockContent: string) => {
await expect(newBlock).toBeVisible();
};

test.skip('A minimum amount of ad slots load', () => {
test.describe('A minimum amount of ad slots load', () => {
pages.forEach(({ path, expectedMinInlineSlots }) => {
/**
* First ensure that the we receive the expected initial amount of ad slots.
Expand Down
4 changes: 4 additions & 0 deletions playwright/tests/liveblog-live-update.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ test.describe.serial('Liveblog live updates', () => {
isMobile,
);

await page.waitForFunction(
// @ts-expect-error -- browser land
() => window.mockLiveUpdate !== undefined,
);
await page.evaluate(() => {
// @ts-expect-error -- browser land
// eslint-disable-next-line @typescript-eslint/no-unsafe-call -- browser land
Expand Down

0 comments on commit a446fff

Please sign in to comment.