diff options
Diffstat (limited to 'test/e2e/func.js')
-rw-r--r-- | test/e2e/func.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/test/e2e/func.js b/test/e2e/func.js index 13dfb82f9..5301d78ae 100644 --- a/test/e2e/func.js +++ b/test/e2e/func.js @@ -56,23 +56,31 @@ async function setupBrowserAndExtension ({ browser, extPath }) { return { driver, extensionId, extensionUri } } -function buildChromeWebDriver (extPath) { +function buildChromeWebDriver (extPath, opts = {}) { const tmpProfile = fs.mkdtempSync(path.join(os.tmpdir(), 'mm-chrome-profile')) + const args = [ + `load-extension=${extPath}`, + `user-data-dir=${tmpProfile}`, + ] + if (opts.responsive) { + args.push('--auto-open-devtools-for-tabs') + } return new webdriver.Builder() .withCapabilities({ chromeOptions: { - args: [ - `load-extension=${extPath}`, - `user-data-dir=${tmpProfile}`, - ], + args, binary: process.env.SELENIUM_CHROME_BINARY, }, }) .build() } -function buildFirefoxWebdriver () { - return new webdriver.Builder().build() +function buildFirefoxWebdriver (opts = {}) { + const driver = new webdriver.Builder().build() + if (opts.responsive) { + driver.manage().window().setSize(320, 600) + } + return driver } async function getExtensionIdChrome (driver) { |