Questions tagged [web-component-tester]

For question about web-component-tester, a tool for testing Polymer-based web components.

web-component-tester is a browser-based testing environment for -based web components, configured out of the box with:

For more details, see

111 questions
16
votes
1 answer

SyntaxError: Unexpected token ILLEGAL on comment with Web Component Tester

I use Codeship to test my project based on the Polymer starter kit v1.1. When I run npm test inside the test pipeline I see the following error: > @ test /home/rof/src/github.com/TFarla/night-live > gulp…
10
votes
2 answers

Polymer web-component-tester / selenium is stalling

We are trying to run the web-component-tester however it keeps stalling on the Selenium step. When I run wct -l chrome --verbose I get the following hook: prepare hook: prepare:selenium hook done: prepare:selenium Starting Selenium server for local…
directjames
  • 103
  • 6
9
votes
1 answer

How do I run a specific test using the Polymer web-component-tester?

While developing a Polymer web component, more specifically while adding additional tests, it can become quite cumbersome to run all of the component's test each time I make an adjustment to the tests. The simplest answer would be to comment out the…
juriejan
  • 440
  • 3
  • 12
9
votes
1 answer

Specify browser location for wct-local test

The Polymer Starter Kit contains web-component-tester for unit testing your custom elements. In wct.conf.json you can specify the browsers to run the tests in. { "suites": ["app/test"], "plugins": { "local": { "browsers": ["firefox"] …
Stevy
  • 743
  • 5
  • 15
9
votes
3 answers

Configure Polymer web-component-tester to use a Selenium Grid server

I need to configure the Polymer web-component-tester to use a Selenium Grid running at http://jenkins.myapp.corp.web:4444/wd/hub so I can run my tests on Jenkins. What is the Grunt config for this? I guessing something like this: 'wct-test': { …
Carl von Buelow
  • 1,154
  • 7
  • 11
8
votes
2 answers

puppeteer: clicking button in shadowroot

I'm having difficulties with actions on elements in shadowroot in my test context. Lets say I have a web component and it contains a button From console in chrome, I can do the…
8
votes
1 answer

Web Component Tester: Apply afterEach() globally

I have hundreds of Polymer test suites. At the end of each test, I'd like to do some custom quality checks. Is there a way to do this globally for all my test suites?
x74x61
  • 423
  • 6
  • 18
7
votes
1 answer

JUnit formatted test output

Jenkins doesn't notice my test cases being ran in Polymer and I am not so sure how to generate the correct JUnit file. With the web-component-tester how do I generate JUnit formatted test output?
Nick Rucci
  • 1,058
  • 11
  • 20
5
votes
0 answers

Uncaught Error: WCT requires Mocha error in web-components-tester

I want to setup the web-component-tester to test my web components. I installed it via npm (devDependency) and created the following script: package.json: "scripts": { "wcttest": "./node_modules/.bin/wct --npm…
Cenasa
  • 531
  • 9
  • 27
5
votes
3 answers

Testing navigator.browserLanguage or navigator.language with Sinon.js

How to use sandbox.stub of Testing framework Sinon to overwrite e.g. navigator.language or navigator.userAgent for testing? When I try to use the following: suite('agent', function () { var sandbox; setup(function () { // create sandbox…
DoK
  • 851
  • 3
  • 15
  • 31
4
votes
2 answers

Web Component / HtmlElement : unit testing

I'm trying to test a web component. Here is my project structure : ├── package.json ├── src │   ├── app.js │   └── index.html └── test └── hello-world-test.html Here is my working code : class HelloWorld extends HTMLElement { …
Loo
  • 43
  • 4
4
votes
1 answer

Running polymer-3.x test in headless browser

I want to run tests without the browser pop-up.Installed wct-headless and configured wct.config.json as shown { "plugins": { "local": { "disabled": true }, "headless": { "browsers": [ "chrome", "firefox" …
Raj
  • 1,100
  • 3
  • 20
  • 33
4
votes
1 answer

unit testing native custom elements v1 web component with shadow dom

I have created a native custom element as web component with pure JS/HTML/CSS following the guide here. Now I am wondering how can I write unit tests for such a component. There is an excellent library web component tester but I believe it is only…
3
votes
0 answers

WCT script failing outside test with : 'Error thrown outside of test function'

I have a custom polymer element which creates another polymer element in its properties. The code is as such : Polymer({ is: 'pg-create-ad-new', properties:{ creative: { type: "String" }, storyId: { type: "String", value: ()=>{ …
3
votes
0 answers

Could not find WCT plugin named "local" when running Polymer test

After cloning Polymer Starter Kit, I installed WCT with: npm install -g web-component-tester Now, I am getting this error: Could not find WCT plugin named "local" How do I fix this?
subhash
  • 167
  • 1
  • 4
  • 15
1
2 3 4 5 6 7 8