-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conflict, add pollyjs dependecies (#7084)
Bug 1698835 - Add puppeteer adapter, add sample test for graphs view Bug 1698835 - Update sample test with puppeteer Bug 1698835 - Fix UnhandledPromiseRejectionWarning Bug 1698835 - Configure jest-puppeteer Bug 1698835 - Separate integration tests from unit tests Bug 1698835 - Update yarn.lock Bug 1698835 - Fix lint errors Bug 1698835 - Update yarn.lock Bug 1698835 - Add @neutrinojs/jest to dependencies Bug 1698835 - Update yarn.lock Bug 1698835 - Address pr requests, move recordings folder Bug 1698835 - Fix chromium error Bug 1698835 - Clean up and update recordings Bug 1698835 - Add documentation Bug 1698835 - Update docs
- Loading branch information
1 parent
cd6ae1a
commit a49e15d
Showing
10 changed files
with
3,369 additions
and
870 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
launch: { | ||
headless: true, | ||
}, | ||
server: { | ||
command: 'yarn start', | ||
}, | ||
}; |
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
63 changes: 63 additions & 0 deletions
63
tests/ui/integration/graphs-view/graphs_view_integration_test.jsx
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,63 @@ | ||
import path from 'path'; | ||
|
||
import { Polly } from '@pollyjs/core'; | ||
import PuppeteerAdapter from '@pollyjs/adapter-puppeteer'; | ||
import FsPersister from '@pollyjs/persister-fs'; | ||
import { setupPolly } from 'setup-polly-jest'; | ||
|
||
Polly.register(PuppeteerAdapter); | ||
Polly.register(FsPersister); | ||
|
||
describe('GraphsViewRecord Test Pupeteer', () => { | ||
const context = setupPolly({ | ||
adapters: ['puppeteer'], | ||
adapterOptions: { | ||
puppeteer: { page }, | ||
}, | ||
persister: 'fs', | ||
persisterOptions: { | ||
fs: { | ||
recordingsDir: path.resolve(__dirname, '../recordings'), | ||
}, | ||
}, | ||
recordIfMissing: true, | ||
matchRequestsBy: { | ||
headers: { | ||
exclude: ['user-agent'], | ||
}, | ||
}, | ||
}); | ||
|
||
beforeEach(async () => { | ||
jest.setTimeout(60000); | ||
|
||
await page.setRequestInterception(true); | ||
await page.goto(`${URL}/perfherder/graphs`); | ||
}); | ||
|
||
test('Record requests', async () => { | ||
expect(context.polly).not.toBeNull(); | ||
|
||
// Set selector Add test data | ||
const addTestDataSelector = 'button[title="Add test data"]'; | ||
|
||
// Wait for selector to appear in the page | ||
await page.waitForSelector(addTestDataSelector); | ||
|
||
// Click button Add test data | ||
await page.click(addTestDataSelector, { clickCount: 1 }); | ||
|
||
// Check details from Add Test Data Modal | ||
await page.waitForSelector('div[title="Framework"]'); | ||
|
||
const frameworks = await page.$$eval( | ||
'div[title="Framework"] a.dropdown-item', | ||
(element) => element.length, | ||
); | ||
|
||
expect(frameworks).toBe(9); | ||
|
||
// Wait for all requests to resolve | ||
await context.polly.flush(); | ||
}); | ||
}); |
Oops, something went wrong.