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

Extend or modify the syntax of the config file #278

Closed
CalmNad opened this issue Jan 3, 2013 · 10 comments
Closed

Extend or modify the syntax of the config file #278

CalmNad opened this issue Jan 3, 2013 · 10 comments

Comments

@CalmNad
Copy link

CalmNad commented Jan 3, 2013

Propose to extend or modify the syntax for the config file.

Instead:

browsers = ['Chrome'];

Use:

browsers = {
    'Chrome':  '--disable-web-security --some-other-keys'
};

or

browsers = {
    'Chrome':  [
        '--disable-web-security',
        '--some-other-keys'
    ]
};

Or add browsers = {...} as alternative syntax.

@dignifiedquire
Copy link
Member

I had somewhat the same idea, as there will be more options for browsers and reporters. But I would suggest something along the lines of

browsers = {
  // user specified values
  chrome: {
    args: [
        '--disable-web-security',
        '--some-other-keys'
    ],
    headless: true
  },
  // default values
  firefox: {}
};

But it should be backwards compatible and still accept

browsers = ['chrome', 'firefox'];

which would just use the default values as options.

@taichi
Copy link
Member

taichi commented Jan 4, 2013

👍

@vojtajina
Copy link
Contributor

browsers should be always an array, so based on Friedel's:

browsers = [{
  name: 'chrome', // maybe "type" or something
  args: ['--disabled-web-security'],
  headless: true
}, {
  name: 'Firefox'
}];

On Thu, Jan 3, 2013 at 8:36 PM, SATO taichi notifications@github.comwrote:

[image: 👍]


Reply to this email directly or view it on GitHubhttps://github.com/vojtajina/testacular/issues/278#issuecomment-11872324.

@zhjuncai
Copy link

great feature.

Next time I don't need to open chrome manually to provide args --disable-web-security.

@DavidSouther
Copy link
Contributor

Has anyone started working on this?

@dignifiedquire
Copy link
Member

Not that I know of. I'm busy with finishing the docs so we can finally release 0.6. But if you have time feel free to start :)

@CalmNad
Copy link
Author

CalmNad commented Jan 21, 2013

Do not forget about PhantomJS ("We need more pylons" i.e. agrs (--web-security=false :)

animous added a commit to animous/testacular that referenced this issue Jan 24, 2013
Support optional `cmd` and `args` parameters in the `browsers`
configuration. The `args` are appended to the default command-line
options for the browser. If `overrideArgs` is true, then the `args`
replace the default command-line options for the browser. Occurrences
of `$TEMPDIR` or `$URL` within the `args` are replaced by the temp
directory and URL. Use case is to pass special options, e.g., to
load browser extensions.

Closes karma-runner#278
animous added a commit to animous/testacular that referenced this issue Jan 30, 2013
Support optional `cmd` and `args` parameters in the `browsers`
configuration. The `args` are appended to the default command-line
options for the browser. If `overrideArgs` is true, then the `args`
replace the default command-line options for the browser. Occurrences
of `$TEMPDIR` or `$URL` within the `args` are replaced by the temp
directory and URL. Use case is to pass special options, e.g., to
load browser extensions.

Closes karma-runner#278
@vojtajina
Copy link
Contributor

Guys, check out #533

@vojtajina
Copy link
Contributor

The new config syntax has already landed in the master, so I'm closing this.

@vojtajina
Copy link
Contributor

It looks like this:

module.exports = function(config) {
  config.set({
    browsers: ['chrome_without_security'],
    customLaunchers: {
      chrome_without_security: {
        base: 'Chrome',
        flags: ['--web-security-disabled']
      }
    }
  });
};

Which can be sued from CLI:

karma start --browsers chrome_without_security

See #533 #604 for more.

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

No branches or pull requests

6 participants