-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
80 additions
and
1 deletion.
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,11 @@ | ||
# `e2e` | ||
|
||
> E2E tests of Neuron | ||
## Usage | ||
|
||
``` | ||
const e2e = require('e2e'); | ||
// TODO: DEMONSTRATE API | ||
``` |
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,21 @@ | ||
import { _electron as electron } from 'playwright' | ||
import { test } from '@playwright/test' | ||
|
||
test('Launch Neuron', async () => { | ||
const electronApp = await electron.launch({ args: ['./dist/main.js'] }) | ||
const isPackaged = await electronApp.evaluate(async ({ app }) => { | ||
// This runs in Electron's main process, parameter here is always | ||
// the result of the require('electron') in the main app script. | ||
return app.isPackaged | ||
}) | ||
|
||
expect(isPackaged).toBe(false) | ||
|
||
// Wait for the first BrowserWindow to open | ||
// and return its Page object | ||
const window = await electronApp.firstWindow() | ||
await window.screenshot({ path: 'intro.png' }) | ||
|
||
// close app | ||
await electronApp.close() | ||
}) |
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,25 @@ | ||
{ | ||
"name": "@nervosnetwork/neuron-e2e", | ||
"version": "0.112.0", | ||
"description": "E2E tests of Neuron", | ||
"author": "Keith <[email protected]>", | ||
"homepage": "https://github.com/nervosnetwork/neuron#readme", | ||
"license": "MIT", | ||
"main": "index.js", | ||
"private": true, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/nervosnetwork/neuron.git" | ||
}, | ||
"scripts": { | ||
"build:e2e": "cd .. && yarn package:e2e", | ||
"test:e2e": "npx cross-env NODE_ENV=test npx playwright test" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/nervosnetwork/neuron/issues" | ||
}, | ||
"devDependencies": { | ||
"@playwright/test": "1.40.1", | ||
"playwright": "1.40.1" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3841,6 +3841,13 @@ | |
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" | ||
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== | ||
|
||
"@playwright/[email protected]": | ||
version "1.40.1" | ||
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.40.1.tgz#9e66322d97b1d74b9f8718bacab15080f24cde65" | ||
integrity sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw== | ||
dependencies: | ||
playwright "1.40.1" | ||
|
||
"@pmmmwh/react-refresh-webpack-plugin@^0.5.1", "@pmmmwh/react-refresh-webpack-plugin@^0.5.3": | ||
version "0.5.10" | ||
resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.10.tgz#2eba163b8e7dbabb4ce3609ab5e32ab63dda3ef8" | ||
|
@@ -11235,7 +11242,7 @@ fs.realpath@^1.0.0: | |
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" | ||
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== | ||
|
||
fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2: | ||
fsevents@2.3.2, fsevents@^2.1.2, fsevents@^2.3.2, fsevents@~2.3.2: | ||
version "2.3.2" | ||
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" | ||
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== | ||
|
@@ -16153,6 +16160,20 @@ pkg-up@^3.1.0: | |
dependencies: | ||
find-up "^3.0.0" | ||
|
||
[email protected]: | ||
version "1.40.1" | ||
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.40.1.tgz#442d15e86866a87d90d07af528e0afabe4c75c05" | ||
integrity sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ== | ||
|
||
[email protected]: | ||
version "1.40.1" | ||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.40.1.tgz#a11bf8dca15be5a194851dbbf3df235b9f53d7ae" | ||
integrity sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw== | ||
dependencies: | ||
playwright-core "1.40.1" | ||
optionalDependencies: | ||
fsevents "2.3.2" | ||
|
||
plist@^3.0.4: | ||
version "3.0.6" | ||
resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.6.tgz#7cfb68a856a7834bca6dbfe3218eb9c7740145d3" | ||
|
509fba4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packaging for test is done in 7354781442