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:
NameTypeDefaultDescription
testFolderPathstring

path of the folder where scripts belong

bundlePathstring

path of the bundle needed for scripts to work

disableThirdPartybooleanfalse

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:
NameTypeDescription
testFolderPathstring

path of the folder where belong files to test

pageTestPageTestFile

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:
NameTypeDescription
folderPathstring

path of the folder where html files belong

portnumber

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:
NameTypeDescription
folderPathstring

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:
NameTypeDescription
pagepuppeteer.Page

page where the test is going to be done

currentFilefs.Dirent

file being tested

Returns:
  • promise resolving when test has passed
Type: 
Promise