README
PuppeDo
Puppeteer tests flow with node.js
Installation
Windows
Generate project
For start new project use PuppeDoCLI
Project structure
All files must have extensions *.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 running 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: browser
runtime: run
engine: puppeteer
browser: chrome
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
secondsToStartApp: optional
secondsDelayAfterStartApp: optional
log:
level: raw
screenshot: true
fullpage: true
Parameters
Parameter | Description |
---|---|
name | Name of environment. Use it for running envs with Running arguments. Feel free for naming but with caution use spaces. |
type | For environment files it should 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
Parameter | Description | Default Value | Dependence |
---|---|---|---|
type | Engine target: browser - browser, electron - electron app |
browser |
|
engine | Type of engine: puppeteer - puppeteer, playwright - playwright |
playwright |
|
browser | Name of browser: chromium , firefox , webkit |
chromium |
|
runtime | run - run new browser instance, connect - connect to exist browser via DevTools API need urlDevtoolsJson parameter |
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 | Delay before every action in milliseconds. | 0 |
|
windowSize | Viewport size. Object width, height in px. |
||
runtimeEnv | runtimeEnv settings | ||
killOnEnd | Is close browser on end of tests. | true |
runtimeEnv Settings
Parameter | Description |
---|---|
runtimeExecutable | todo |
program | todo |
cwd | todo |
args | todo |
env | todo |
secondsToStartApp | todo |
secondsDelayAfterStartApp | todo |
Logging Settings
Parameter | Description |
---|---|
level | todo |
screenshot | todo |
fullpage | todo |
screenshotName | todo |
fullpageName | todo |
Data and Selectors files
type: data
description: Simple Data
data:
value: test
Parameter | Description |
---|---|
type | data or selectors |
description | Description |
data | Object with data |
Test files
Todo
Test atoms files
Todo
Running Arguments
Parameter | 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', '.history'] |
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_EXTEND | Log every atoms time for tuning and breadcrumbs for test | false |
Boolean |
PPD_LOG_LEVEL_NESTED | Log only nested levels of log bellow this. 0 - log all |
0 |
Number |
PPD_LOG_LEVEL_TYPE_IGNORE | Log ignore types. [raw , debug , info , test , warn , error , env ] |
[] |
String[] |
PPD_LOG_SCREENSHOT | Screenshot of elements enable | false |
Boolean |
PPD_LOG_FULLPAGE | Full screen screenshot enable | false |
Boolean |
PPD_LOG_TEST_NAME | Show in log name of test on every line | true |
Boolean |
PPD_LOG_IGNORE_HIDE_LOG | Show all log even if it ignore inline | false |
Boolean |
PPD_LOG_DOCUMENTATION_MODE | Show documentation in descriptionExtend | false |
Boolean |
PPD_LOG_NAMES_ONLY | Show only names in list/ All by default | [] |
String[] |
PPD_LOG_TIMER_SHOW | Show timer in log | false |
Boolean |
PPD_LOG_TIMESTAMP_SHOW | Show timer in log | false |
Boolean |
PPD_LOG_INDENT_LENGTH | Indents in log | 4 |
Number |
PPD_CONTINUE_ON_ERROR_ENABLED | continueOnError flag | false |
Boolean |
Arguments applying order. From minor to major:
- Defaults
- CLI arguments
- ENV variables
- Arguments from script
Socket
Todo
RoadMap 2.0.0
- Arguments.
- PPD_LOG_LEVEL_NESTED
- PPD_LOG_SCREENSHOT
- PPD_LOG_FULLPAGE
rename bindData -> dataBind
rename bindSelectors -> selectorsBind