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

It would be nice to specify any tests suite/spec to be run in every browser instance

KhalipskiSiarhei 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?
    feature

  • What is the current behavior?
    It would be nice to have possibility to run any specific test or tests suite/spec in every browser instance. Currently we have a test suite with name ~test-fixture.spec.ts and this spec is run the last if we use one browser because of naming. In this test suite we check console (not errors should be identified) and some other generic staff to check if our code is OK when all tests were run. But as soon as we use some browsers this test suite is run in one browser only.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via

  • What is the expected behavior?
    It would be nice to specify any test suite or test to be run in every browser. For example, if we can specify ~test-fixture.spec.ts to be run in every browser instance then we will be able to check all our generic cases in all parallel browser instances.

  • What is the motivation / use case for changing the behavior?
    Allow to check any predefined checks for all browser instances.

  • Please tell us about your environment:

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

This would be a great feature. I was thinking that the easiest and most compatible way to accomplish this would be by creating a common naming prefix for a describe block that should be run for each instance. Perhaps "[parallel-all]" or something?

It would be used like

describe('[parallel-all] this will be run in every instance', function() {
// ...
});

describe('this will run in the first instance', function() {
// ...
});

describe('this will be run in the second instance', function() {
// ...
});

This way, it would be compatible with the standard mocha/jasmine api (meaning it would not break if someone later removed this framework, and it would not require any build-time or bundling changes. What do you think?

I went ahead and added this feature and its in v0.2.6. Any top-level describe block that starts with the string "[always]" will run in every browser instance. It is noted in the readme.

@joeljeske thanks for this functionality. It is exactly what we were needed!