Skip to content
Closed
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
18 changes: 15 additions & 3 deletions test/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { defineConfig, devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testMatch: /test\/e2e\/specs\/.*(\.spec.ts)/,

timeout: 150000,
/* Run tests in files in parallel */
fullyParallel: true,
Expand All @@ -31,7 +29,21 @@ export default defineConfig({
/* Configure projects for major browsers */
projects: [
{
name: 'Google Chrome',
name: 'setup esm deploy url',
testMatch: /test\/Setup\/global\.setup\.ts/,
},
{
name: 'Google Chrome ESM',
testMatch: /test\/e2e\/specs\/ESM\/.*(\.spec.ts)/,
use: {
...devices['Desktop Chrome'],
channel: 'chrome',
},
dependencies: ['setup esm deploy url'],
},
{
name: 'Google Chrome Non ESM',
testMatch: /test\/e2e\/specs\/NonESM\/.*(\.spec.ts)/,
use: {
...devices['Desktop Chrome'],
channel: 'chrome',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
import { ConsoleMessage, expect, Page } from '@playwright/test';
import { vpTest } from '../fixtures/vpTest';
import { ESM_LINKS } from '../testData/esmPageLinksData';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { validatePageErrors } from '../src/helpers/validatePageErrors';
import { ExampleLinkType } from '../types/exampleLinkType';
import { ExampleLinkName } from '../testData/ExampleLinkNames';

const EDGE_ESM_URL = 'https://cld-vp-esm-pages.netlify.app/';
// On PR level it will use the preview deploy URL and locally it will use the latest EDGE.
const ESM_URL = process.env.PREVIEW_URL ?? EDGE_ESM_URL;
// Flag to indicate if the deploy preview URL is ready
let isPreviewUrlLoaded = false;
import { ConsoleMessage, expect } from '@playwright/test';
import { vpTest } from '../../fixtures/vpTest';
import { ESM_LINKS } from '../../testData/esmPageLinksData';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { validatePageErrors } from '../../src/helpers/validatePageErrors';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';
import { ESM_URL } from '../../testData/esmUrl';

/**
* Console error test generated by LINKS object array data.
*/
for (const link of ESM_LINKS) {
vpTest(`Test console errors on link ${link.name}`, async ({ page, consoleErrors, pomPages }) => {
vpTest.skip(link.name === 'Adaptive Streaming', 'Flaky on CI');
//Wait for deploy URL to be available if PREVIEW_URL is set, and it is not available yet
if (process.env.PREVIEW_URL && !isPreviewUrlLoaded) {
await waitForDeployPreviewUrl(link, page);
}
await page.goto(ESM_URL);
await pomPages.mainPage.clickLinkByName(link.name);
await waitForPageToLoadWithTimeout(page, 5000);
Expand Down Expand Up @@ -58,15 +48,3 @@ function handleCommonEsmBrowsersErrors(linkName: ExampleLinkName, consoleErrors:
validatePageErrors(consoleErrors, [], ['the server responded with a status of 404']);
}
}

/**
* Waits for a deploy preview URL to become available by making repeated requests and check that link is visible.
*/
async function waitForDeployPreviewUrl(link: ExampleLinkType, page: Page): Promise<void> {
await expect(async () => {
await page.goto(process.env.PREVIEW_URL);
const linkLocator = page.getByRole('link', { name: link.name, exact: true });
await expect(linkLocator).toBeVisible({ timeout: 10000 });
isPreviewUrlLoaded = true;
}).toPass({ intervals: [1_000], timeout: 120000 });
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

// Link to Analytics page
const link = getLinkByName(ExampleLinkName.Analytics);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

// Link to API and Events page
const link = getLinkByName(ExampleLinkName.APIAndEvents);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

// Link to audio player page
const link = getLinkByName(ExampleLinkName.AudioPlayer);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

// Link to autoplay on scroll page
const link = getLinkByName(ExampleLinkName.AutoplayOnScroll);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.Chapters);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.CloudinaryAnalytics);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.CodecsAndFormats);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.ColorsAPI);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.Components);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.DisplayConfigurations);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.FloatingPlayer);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.FluidLayouts);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.ForceHLSSubtitles);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

// Link to AI Highlights Graph page
const link = getLinkByName(ExampleLinkName.AIHighlightsGraph);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ConsoleMessage, expect } from '@playwright/test';
import { vpTest } from '../fixtures/vpTest';
import { LINKS } from '../testData/pageLinksData';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { validatePageErrors } from '../src/helpers/validatePageErrors';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { vpTest } from '../../fixtures/vpTest';
import { LINKS } from '../../testData/pageLinksData';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { validatePageErrors } from '../../src/helpers/validatePageErrors';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

/**
* Console error test generated by LINKS object array data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';

/**
* Testing if video on main page is playing by checking that is pause return false.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.MultiplePlayers);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.PlaylistByTag);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.Playlist);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.PosterOptions);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.Profiles);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.RawURL);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.Recommendations);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vpTest } from '../fixtures/vpTest';
import { vpTest } from '../../fixtures/vpTest';
import { test } from '@playwright/test';
import { waitForPageToLoadWithTimeout } from '../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../testData/pageLinksData';
import { ExampleLinkName } from '../testData/ExampleLinkNames';
import { waitForPageToLoadWithTimeout } from '../../src/helpers/waitForPageToLoadWithTimeout';
import { getLinkByName } from '../../testData/pageLinksData';
import { ExampleLinkName } from '../../testData/ExampleLinkNames';

const link = getLinkByName(ExampleLinkName.SeekThumbnails);

Expand Down
Loading