@ -8,9 +8,10 @@ class Driver {
* @ param { string } browser - The type of browser this driver is controlling
* @ param { string } browser - The type of browser this driver is controlling
* @ param { number } timeout
* @ param { number } timeout
* /
* /
constructor ( driver , browser , timeout = 10000 ) {
constructor ( driver , browser , extensionUrl , timeout = 10000 ) {
this . driver = driver
this . driver = driver
this . browser = browser
this . browser = browser
this . extensionUrl = extensionUrl
this . timeout = timeout
this . timeout = timeout
}
}
@ -84,6 +85,12 @@ class Driver {
assert . ok ( ! dataTab , 'Found element that should not be present' )
assert . ok ( ! dataTab , 'Found element that should not be present' )
}
}
// Navigation
async navigate ( page = Driver . PAGES . HOME ) {
return await this . driver . get ( ` ${ this . extensionUrl } / ${ page } .html ` )
}
// Window management
// Window management
async openNewPage ( url ) {
async openNewPage ( url ) {
@ -173,4 +180,10 @@ class Driver {
}
}
}
}
Driver . PAGES = {
HOME : 'home' ,
NOTIFICATION : 'notification' ,
POPUP : 'popup' ,
}
module . exports = Driver
module . exports = Driver