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
0
votes
1 answer

Webcomponent Tester - How to assert a function not to be called?

Using Polymer 1.* and webcomponent tester... I have spy(alert, 'open') and expect(alert.open).to.have.not.been.called;. How can I assert a function is not called? Right now this. If I inverse it with expect(alert.open).to.have.been.called;, it…
dman
  • 10,406
  • 18
  • 102
  • 201
0
votes
1 answer

Can not stub private element in WCT

Using Polymer 1 and Web component tester... testing in shady dom on chrome. In WCT, trying to stub spToast.display() with stub('sp-toast', { display: ()=> {} }); but I get error with Attempted to wrap undefined property display as function.... what…
dman
  • 10,406
  • 18
  • 102
  • 201
0
votes
1 answer

Reuse Mocha unit tests code for dev or demo

I'm developing webcomponents with Polymer v2 and unit tests with web-component-tester, which uses Mocha. The components developed are charts/graphs and need some configuration to be displayed (data especially), so the suiteSetup adds boilerplate for…
codename44
  • 867
  • 9
  • 19
0
votes
1 answer

How do you specify which browsers Sauce Labs should use when initiating tests from the Polymer CLI?

I have a Polymer v1.7 element only project. I have it set up with Travis CI and Sauce Labs which works great! However, I would like to be able to initiate tests in specific browsers through Sauce Labs without having to tinker with my wct.conf.json…
Ben
  • 5,525
  • 8
  • 42
  • 66
0
votes
0 answers

Why does web-component-tester time out in flight mode?

I've got a basic web-component-tester project which works fine when I'm online. If I switch to flight mode, it seems to fail to connect to Selenium, and instead gives a largely useless error message after about 60s delay: "Error: Unable to connect…
Dave E
  • 612
  • 6
  • 13
0
votes
1 answer

How to test form submits in Polymer 2 elements without the page refreshing

I have a Polymer 2 "search" component that contains a form and a text input. The component handles the form submit on the form element using on-submit="_handleFormSubmit", and the handling function calls event.preventDefault(). This works as…
ndavison
  • 185
  • 7
0
votes
0 answers

Can web component tester and/or selenium run the browser on another machine

I have the following scenario:- I am developing an SPA using Polymer for the client and a bespoke server using nodejs. It talks to an SQL Server Database on another computer entirely The production version will run on a raspberry pi INSIDE a Docker…
akc42
  • 4,893
  • 5
  • 41
  • 60
0
votes
1 answer

Testing Polymer with BrowserStack

How can I test Polymer elements using web-component-tester over BrowserStack? I found this demo but the session times out.
idoshamun
  • 1,125
  • 9
  • 21
0
votes
2 answers

web-component-tester MockInteractions does not send key press event

I could'not simulate a simple press enter in a paper-input using MockInteractions.pressEnter inside a web-component-tester test case. When I press enter with a true keyboard it do the job. Here is my code, does anyone has an idea or a work…
hubjac1
  • 3
  • 2
0
votes
1 answer

How to display the XUnit test output on Jenkins

According to JUnit formatted test output I created an XUnit report xml with https://github.com/garcus/wct-xunit-reporter. What does not work is that Jenkins displays the Test-Results. I tried: different XUnit Test Results (Publish xUnit test result…
pme
  • 14,156
  • 3
  • 52
  • 95
0
votes
1 answer

Web Component Tester - gulp task to run test with each build

I want to put inside gulpfile something like: require('web-component-tester').gulp.init(gulp); gulp.task('default', function() { gulp.watch(['elements/**', 'test/**'], ['test:local']); }); The purpose is to watch test folders or elements folders…
bodley
  • 187
  • 1
  • 4
  • 15
0
votes
0 answers

Eslint not running web-component-tester tests for Polymer element

I'm trying to run tests on gulp for my Polymer elements, using eslint, but it doesn't seem to find out about my included browser.js file, because it returns stuff like "error 'suite' is not defined no-undef". My gulpfile.js : 'use strict'; var gulp…
diabounet
  • 1
  • 2
0
votes
1 answer

How do you test elements that require the light dom to be loaded?

I have an element: