Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow chrome options to be passed at runtime #164

Closed
sriv opened this issue Sep 18, 2018 · 1 comment · Fixed by #1214 or #1252
Closed

allow chrome options to be passed at runtime #164

sriv opened this issue Sep 18, 2018 · 1 comment · Fixed by #1214 or #1252
Assignees
Labels

Comments

@sriv
Copy link
Member

sriv commented Sep 18, 2018

Expected behavior

Should be able to pass chrome flags via taiko args, or as env variables. This is to ensure that the same script can be run on docker/local machine.

Actual behavior

The options need to be in code. Example:

await openBrowser({args:['--no-sandbox', '--disable-setuid-sandbox']});

This prevents the script to be run in multiple environments.

Versions

Paste `node` and `taiko` versions here.

node v10.10.0
taiko v0.2.0
@zabil zabil added feature and removed enhancement labels Mar 4, 2020
@NivedhaSenthil NivedhaSenthil self-assigned this Apr 23, 2020
NivedhaSenthil added a commit that referenced this issue Apr 23, 2020
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
sriv pushed a commit that referenced this issue Apr 23, 2020
Signed-off-by: NivedhaSenthil <nivedhasenthil@gmail.com>
@zabil zabil reopened this May 12, 2020
@zabil
Copy link
Member

zabil commented May 12, 2020

This does not work for

$ env TAIKO_BROWSER_ARGS=--window-size=1024,768 npx taiko --observe sample.js

sample.js

const { openBrowser, closeBrowser } = require('taiko');
(async () => {
    try {
        await openBrowser();
        screenshot()
    } catch (error) {
        console.error(error);
    } finally {
        await closeBrowser();
    }
})();

Possibly because we split using commas. There are a few options like these that have command in them.

negiDharmendra added a commit that referenced this issue May 13, 2020
…t be applied correctly. #164

Signed-off-by: Dharmendra Singh <dharmenn@thoughtworks.com>
negiDharmendra added a commit that referenced this issue May 13, 2020
…rgs which invalidates all the args after following that. #164

Signed-off-by: Dharmendra Singh <dharmenn@thoughtworks.com>
negiDharmendra added a commit that referenced this issue May 13, 2020
…#1252)

* Fixed an issue wherein browser arg with a comma in its value would not be applied correctly. #164

Signed-off-by: Dharmendra Singh <dharmenn@thoughtworks.com>

* Fixed an issue wherein setBrowserArg would inject '--' into browser args which invalidates all the args after following that. #164

Signed-off-by: Dharmendra Singh <dharmenn@thoughtworks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment