joeljeske / karma-parallel

A Karma JS Framework to support sharding tests to run in parallel across multiple browsers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need to run same piece of code from js file on two emulators with different configuration

darklord549 opened this issue · comments

Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.

  • **I'm submitting a ... **

    • bug report
    • feature request
    • support request => Please do not submit support request here, see note at the top of this template.
  • Do you want to request a feature or report a bug?

  • What is the current behavior?

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
    https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

  • What is the expected behavior?

  • What is the motivation / use case for changing the behavior?

  • Please tell us about your environment:

  • version: 2.0.0-beta.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5 | Dart]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

First, when projects have an Issue Template, please fill it out. It does not help either one of us when you do not do give me the requested information.

If I understand your request, you want to run a test on multiple browsers, with slight variations depending on the browser. Is that correct? If so, that would be very possible without the use of this plugin, (although you could use this plugin and still accomplish your desired behavior).

First, add the set of browsers and the required launchers you want to test on:

// karma.conf.js
...
browsers: ['Chrome', 'Firefox', 'Safari', etc...]
...
// In a test file
it('should run a browser specific test', function() {
  // Test the `navigator.userAgent` to determine which browser you are running in
});

And like I mentioned, the above example would work if you use karma-parallel or not.

I'm closing this as it is more of a normal karma pattern than regarding this plugin.

My explanation can accomplish that and it does not use karma-parallel.