Methods
browserScripts(testFolderPath, bundlePath, disableThirdParty) → {Promise}
Test browser scripts by opening a new page on a puppeteer browser and evaluating the script, script should have a structure like below
Parameters:
Name | Type | Default | Description |
---|---|---|---|
testFolderPath | string | path of the folder where scripts belong | |
bundlePath | string | path of the bundle needed for scripts to work | |
disableThirdParty | boolean | false | disable third party or not in browser |
- To Do
- goto necessary ?
Returns:
- promise resolving when test have passed
- Type:
- Promise
Example
() => {
return new Promise((resolve)=>{
//do test
resolve(); // test succeed
}};
folderInBrowserPage(testFolderPath, pageTest) → {Promise}
Parameters:
Name | Type | Description |
---|---|---|
testFolderPath | string | path of the folder where belong files to test |
pageTest | PageTestFile | description of the test |
Returns:
- a promise resolving when test have passed
- Type:
- Promise
html(folderPath, port) → {Promise}
Open html files in a page of a puppeteer browser in order to catch error
Parameters:
Name | Type | Description |
---|---|---|
folderPath | string | path of the folder where html files belong |
port | number | port of the server http listening |
Returns:
- promise resolving when test have passed
- Type:
- Promise
scripts(folderPath) → {Promise}
Test scripts by spawning them and waiting the process to exit, script should have a structure like below
Parameters:
Name | Type | Description |
---|---|---|
folderPath | string | path of the folder where scripts belong |
Returns:
- a promise resolving when test have passed
- Type:
- Promise
Example
//do test
process.exit(0);// test succeed
Type Definitions
PageTestFile(page, currentFile) → {Promise}
Parameters:
Name | Type | Description |
---|---|---|
page | puppeteer. | page where the test is going to be done |
currentFile | fs. | file being tested |
Returns:
- promise resolving when test has passed
- Type:
- Promise