Skip to content
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

Consolidating e2e tests to use new getEntriesAndErrors #82

Merged
merged 2 commits into from
Apr 3, 2024
Merged
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: 2 additions & 2 deletions test/e2e/ajax1/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const AJAX_DELAY = 500; // see text-mutation.html
Expand All @@ -13,7 +13,7 @@ test.describe('TTVC', () => {
});

// await entryCountIs(page, 1);
const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + AJAX_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/ajax2/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const AJAX_DELAY = 500; // see text-mutation.html
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + AJAX_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/ajax3/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const AJAX_DELAY = 500; // see text-mutation.html
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + AJAX_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/ajax4/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {entryCountIs, getEntries} from '../../util/entries';
import {entryCountIs, getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;

Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
});

await entryCountIs(page, 1, 30000);
const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/ajax5/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {test, expect} from '@playwright/test';

import {entryCountIs, getEntries} from '../../util/entries';
import {entryCountIs, getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;

Expand All @@ -17,7 +17,7 @@ test.describe('TTVC', () => {
// pass
}

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

// ttvc should never be reported
expect(entries.length).toBe(0);
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/bfcache/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 1000;

Expand All @@ -11,7 +11,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

let entries = await getEntries(page);
let {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY);
Expand All @@ -22,7 +22,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

entries = await getEntries(page);
({entries} = await getEntriesAndErrors(page));

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY);
Expand All @@ -31,7 +31,7 @@ test.describe('TTVC', () => {

await page.goBack({waitUntil: 'networkidle'});

entries = await getEntries(page);
({entries} = await getEntriesAndErrors(page));

// note: webkit clears previous values from this list on page restore
expect(entries[entries.length - 1].duration).toBeGreaterThanOrEqual(0);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/composition1/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const AJAX_DELAY = 500;
Expand All @@ -13,7 +13,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);
expect(entries.length).toBe(1);

const expectedTtvc = PAGELOAD_DELAY + AJAX_DELAY + SCRIPT_DELAY;
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/composition2/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const AJAX_DELAY = 500;
Expand All @@ -16,7 +16,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);
expect(entries.length).toBe(1);

const expectedTtvc = PAGELOAD_DELAY + SCRIPT_DELAY + AJAX_DELAY + CPU_DELAY + SCRIPT_DELAY;
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/composition3/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {entryCountIs, getEntries} from '../../util/entries';
import {entryCountIs, getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const AJAX_DELAY = 500;
Expand All @@ -15,7 +15,7 @@ test.describe('TTVC', () => {
});

await entryCountIs(page, 1);
const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);
expect(entries.length).toBe(1);

const expectedTtvc = PAGELOAD_DELAY + SCRIPT_DELAY + AJAX_DELAY + CPU_DELAY + SCRIPT_DELAY;
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/composition4/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {entryCountIs, getEntries} from '../../util/entries';
import {entryCountIs, getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const AJAX_DELAY = 500;
Expand All @@ -14,7 +14,7 @@ test.describe('TTVC', () => {
});

await entryCountIs(page, 1);
const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);
expect(entries.length).toBe(1);

const expectedTtvc = PAGELOAD_DELAY + AJAX_DELAY + TIMEOUT_DELAY + AJAX_DELAY;
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/cpu1/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {entryCountIs, getEntries} from '../../util/entries';
import {entryCountIs, getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const CPU_DELAY = 500;
Expand All @@ -13,7 +13,7 @@ test.describe('TTVC', () => {
});

await entryCountIs(page, 1);
const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + CPU_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/error1/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const IMAGE_DELAY = 500;
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + IMAGE_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/error2/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const IMAGE_DELAY = 500;
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
const expectedTtvc = PAGELOAD_DELAY + IMAGE_DELAY;
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/error3/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const SCRIPT_DELAY = 200;
Expand All @@ -14,7 +14,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
const expectedTtvc = PAGELOAD_DELAY + SCRIPT_DELAY;
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/error4/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const SCRIPT_DELAY = 500;
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + SCRIPT_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/error6/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;

Expand All @@ -14,7 +14,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(errors.length).toBe(0);

Expand Down
4 changes: 2 additions & 2 deletions test/e2e/iframe1/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const IFRAME_DELAY = 500;
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + IFRAME_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/iframe2/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;
const IFRAME_DELAY = 500;
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + IFRAME_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/iframe3/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 200;

Expand All @@ -11,7 +11,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/images1/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 1000;
const IMAGE_DELAY = 500;
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + IMAGE_DELAY);
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/images2/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {test, expect} from '@playwright/test';

import {FUDGE} from '../../util/constants';
import {getEntries} from '../../util/entries';
import {getEntriesAndErrors} from '../../util/entries';

const PAGELOAD_DELAY = 1000;
const IMAGE_DELAY = 500;
Expand All @@ -12,7 +12,7 @@ test.describe('TTVC', () => {
waitUntil: 'networkidle',
});

const entries = await getEntries(page);
const {entries} = await getEntriesAndErrors(page);

expect(entries.length).toBe(1);
expect(entries[0].duration).toBeGreaterThanOrEqual(PAGELOAD_DELAY + IMAGE_DELAY);
Expand Down
Loading
Loading