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

Pass custom parameters to dalek command #164

Open
naoyteruh opened this issue Aug 23, 2015 · 1 comment
Open

Pass custom parameters to dalek command #164

naoyteruh opened this issue Aug 23, 2015 · 1 comment

Comments

@naoyteruh
Copy link

Hi,

Is there a way to pass parameters to "dalek" command ?
I would like to switch my test suite between environments.

dalek mytest.js myparameter

where my parameter would refer to my development environment, testing environment etc...

Regards,

@rafis
Copy link

rafis commented Nov 23, 2015

I don't exactly understand question, but maybe this will help (you can use *nix environment to pass params):

NODE_ENV=testing PARAM1=VALUE1 dalek mytest.js

In mytest.js add following:

module.exports = {
    'Page title is correct': function (test) {
        test.open('http://myfront.megaproject.consul');
        if ('VALUE1' == process.ENV.PARAM1) {
            test.title().is('My Title - Staging');
        } else {
            test.title().is('My Title');
        }
        test.done();
    }
};

Notice how process.ENV.PARAM1 used to access to PARAM1 which has VALUE1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants