1

I'm using SauceLabs for my web component tests through the 'sauce' plugin in the web component tester. I'd like to use this plugin with different configurations depending which branch is being built on my CI.

I.E.: Latest chrome only on dev branches, and the whole battery of browsers/OS on master/staging branches (with deploy env.)

How can I achieve that?

2 Answers2

1

Copy a template file before you start wct

// Test master branch
$ cp wct.conf.master.json wct.conf.json && wct

// Test feature branch
$ cp wct.conf.feature.json wct.conf.json && wct
veith
  • 56
  • 5
  • The --config option does not exist anymore (as of wct@5.0.1) it seems, I don't see another way of specifying a specific config file sadly – Philippe Desjardins Mar 30 '17 at 17:49
  • We do it with a script now, which copies wct.conf.branch.json to wct.conf.json before we start the test. – veith Apr 01 '17 at 09:50
  • Yeah I guess I'll have to resort to something like that too, I filed an issue in the WCT repo, maybe they'll simplify this use case (https://github.com/Polymer/web-component-tester/issues/521) – Philippe Desjardins Apr 03 '17 at 13:30
1

The best way to do so for now remains the cp/mv method as stated in the official answer, but in web-component-tester@v6.0.0-prerelease.8, they included back the --config option (see this commit), so we'll be able to specify which config file to use at runtime without modifying any file.