-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): Improve compatibility with Docker/CI
- Loading branch information
1 parent
dfeea8f
commit 704004f
Showing
14 changed files
with
153 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
yarn install --frozen-lockfile | ||
|
||
Xvfb :99 -screen 0 1280x800x16 & yarn concurrently -r --kill-others -s first -n profiles,cucumber \ | ||
'yarn start:profiles:no-progress' \ | ||
'yarn wait-on ./build/development/chromium/ && yarn wait-on http://localhost:8080 && yarn cucumber-js' |
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,2 @@ | ||
// puppeteer types needs this, but it’s only available in TypeScript 4+ | ||
declare type Lowercase<T> = string; |
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,24 @@ | ||
import { Page, Frame } from 'puppeteer'; | ||
import expect from 'expect'; | ||
import { findIframe } from 'test/e2e/support/iframe'; | ||
import { iFrameId } from 'app/content/constants/iframe'; | ||
|
||
export const getIframe = async (page: Page): Promise<Frame> => { | ||
await page.waitForSelector(`iframe[id="${iFrameId}"]`); | ||
const frame = findIframe(page); | ||
expect(frame).toBeDefined(); | ||
return frame as Frame; | ||
}; | ||
|
||
export default { | ||
async waitForNotification(page: Page, delayInSeconds: number) { | ||
const frame = await getIframe(page); | ||
if (frame) { | ||
await frame.waitForSelector( | ||
`section[data-test-id="notification-container"]`, | ||
{ timeout: delayInSeconds * 1000 } | ||
); | ||
} | ||
return frame; | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { Frame } from 'puppeteer'; | ||
|
||
const noticeTitle = "[data-test-type='noticeTitle']"; | ||
|
||
export default { | ||
async getNoticesTitle(frame: Frame) { | ||
return (frame as Frame).$$("[data-test-type='noticeTitle']"); | ||
await frame.waitForSelector(noticeTitle); | ||
return frame.$$(noticeTitle); | ||
} | ||
}; |
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