Package Exports
- @puppedo/core
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@puppedo/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
PuppeDo
Puppeteer tests flow with node.js
Installation
Windows
Generate project
For start new project use PuppeDoCLI
Project structure
All files must have exts *.yaml, *.yml, *.ppd. All data in any place in folder PPD_ROOT and PPD_ROOT_ADDITIONAL
Environment files
File with environment information. There is may more then one env in test. You can switch between envs.
If there exist more then one env with the same name they merge. Use in for development redefinition parts of env in private env file. I.e. for runing electron app from your local files.
name: mainEnv
type: env
description: My env
data:
myEnvData: foo
selectors:
myEnvSelectors: bar
dataExt:
- dataExt
- privateData
selectorsExt:
- selectorsExt
- privateSelectors
envsExt:
- privateEnv
browser:
type: puppeteer
runtime: run
args:
- "--window-size=1024,768"
headless: false
slowMo: 5
windowSize:
width: 1024
height: 768
runtimeEnv:
runtimeExecutable: optional
program: optional
cwd: optional
args: optional
env: optional
pauseAfterStartApp: optional
log:
level: raw
screenshot: true
fullpage: trueParametrs
| Parametr | Description |
|---|---|
| name | Name of environment. Use it for runing envs with Runing arguments. Feel free for naming but with caution use spaces. |
| type | For environment files it shoud be env. |
| description | Description |
| data | Object with data for passing in this env. |
| selectors | Object with selectors for passing in this env. |
| dataExt | Array of data that extend this env. Related to PPD_ROOT and PPD_ROOT_ADDITIONAL. You can use asterisk to load all files from folder data/* |
| selectorsExt | Array of selectors that extend this env. Related to PPD_ROOT and PPD_ROOT_ADDITIONAL. You can use asterisk to load all files from folder data/* |
| envsExt | Array of envs that extend this env. Related to PPD_ROOT and PPD_ROOT_ADDITIONAL. You can use asterisk to load all files from folder data/* |
| browser | Browser settings |
| log | Logging settings |
Browser Settings
| Parametr | Description | Default Value | Dependence |
|---|---|---|---|
| type | Type of browser: puppeteer - chrome browser, electron - electron app |
puppeteer |
|
| runtime | run - run new browser instanse, connect - connect to exist browser via DevTools API need urlDevtoolsJson parametr |
run |
urlDevtoolsJson |
| urlDevtoolsJson | Link to devtool server http://127.0.0.1:9222/. To start electron or chrome with this feature run it with arg --remote-debugging-port=9222. Use your port number. |
runtime is connect |
|
| args | Array of custom Arguments for Chrome | ||
| headless | Headless mode false - show browser. true - headless mode. If debug mode enabled in PuppeDo always Headless mode is false |
true |
PPD_DEBUG_MODE |
| slowMo | Dellay before every action in millisecconds. | 0 |
|
| windowSize | Viewport size. Object width, height in px. |
||
| runtimeEnv | runtimeEnv settings | ||
| killOnEnd | Is close browser on end of tests. | true |
runtimeEnv Settings
| Parametr | Description |
|---|---|
| runtimeExecutable | todo |
| program | todo |
| cwd | todo |
| args | todo |
| env | todo |
| pauseAfterStartApp | todo |
Logging Settings
| Parametr | Description |
|---|---|
| level | todo |
| screenshot | todo |
| fullpage | todo |
Data and Selectors files
type: data
description: Simple Data
needEnv: mainEnv
data:
value: test| Parametr | Description |
|---|---|
| type | data or selectors |
| description | Description |
| data | Object with data |
Test files
Todo
Test atoms files
Todo
Runing Arguments
| Parametr | Description | Default Value | Type |
|---|---|---|---|
| PPD_ROOT | Root folder of tests | process.cwd() |
String |
| PPD_ROOT_ADDITIONAL | Append folders of tests and stuff | [] |
String[] |
| PPD_ROOT_IGNORE | Ignore folders of tests starts with | ['.git', 'node_modules'] |
String[] |
| PPD_ENVS | Links of environments to run. | [] |
String[] |
| PPD_TESTS | Name of tests to run one by one | [] |
String[] |
| PPD_DATA | Object with data | {} |
Object |
| PPD_SELECTORS | Object with selectors | {} |
Object |
| PPD_OUTPUT | Path to log folder | output |
String |
| PPD_DEBUG_MODE | Debug mode | false |
Boolean |
| PPD_LOG_DISABLED | Disable logging | false |
Boolean |
| PPD_LOG_TIMER | Log every atoms time for tuning | false |
Boolean |
Arguments applying order. From minor to major:
- Defaults
- CLI arguments
- ENV variables
- Arguments from script