Comments (15)
Hi Jacob,
Are there any examples how to create tests for elements that require to have some html (templates/custom components) and that more complex than current examples with iron_a11_*?
I'd like to help and looking for examples.
Thanks
from polymer_elements.
Here is the branch I have going for the iron tests, https://github.com/dart-lang/polymer_elements/tree/iron-tests All iron tests are now in master. I have added a few functions to the common.dart
file under test
. One of them is fixture
, which works basically like the same method you see in the polymer js tests, although it doesn't require the extra wrapper element (just put the id right on the template tag). See https://github.com/dart-lang/polymer_elements/blob/master/test/iron_dropdown_test.dart#L28 and https://github.com/dart-lang/polymer_elements/blob/master/test/iron_dropdown_test.html#L25 for example usage.
I also added jsPromiseToFuture
and wait
which are useful for removing some boilerplate in tests. I can submit the changes I have this morning so those things will be available for you to use as well.
In terms of tests that require you to create an example element, those are usually tests for behaviors, which are blocked on dart-archive/polymer-dart#551. These can all be skipped for now. Other tests which create custom elements you can just keep the js custom element from the original test in most cases.
from polymer_elements.
Ok merged the iron-element tests that I have done into master so you can see a lot more examples there. The main piece missing right now is nice server mocking, so you may need to skip some tests until we have that, you can link #16 as the skip message for any of those.
from polymer_elements.
Working on this one. It'll be ready soon.
from polymer_elements.
great!
from polymer_elements.
Is there a server where tests for PolymerJS elements are running? Some of my tests are failing and I want to check results for original tests.
from polymer_elements.
Actually, do you have any advice how should I run tests before creating pull request?
thanks!
from polymer_elements.
I had the same question regarding the polymerjs tests.
@vsheyanov Some of the polymerjs tests are out of date. For example, it looks like the tests in polymerjs for gold-email-input don't match the current implementation of the element. The js tests check for display: none for the error, but the implementation is using visibility:hidden. You can toss elements into a demo app to help figure out if it's the test or the element that's the problem. You can also look at the issues in the element's repo to see known problems and sometimes if tests are failing.
from polymer_elements.
They do have a CI server, but I have noticed its not integrated into all of the repos. If any tests are failing please mark them as skip
(its a named argument to the test
method), and link a github issue as the message. I have found 4-5 other failing tests already and marked them this way. Once we have something in place for all the elements we can address the failing tests.
You can also check the original github repos and see if there is a more updated test.
from polymer_elements.
@vsheyanov running the js tests standalone is a bit of a pain, you will need to install node/npm and bower. Essentially the process is this:
- Clone the github repo, most live here, except the google-web-components which live here.
- Install node/npm, and then globally install
bower
using npm. - Run
bower update
from the root of the github repo (bower is the package manager used for polymer js elements). - Open up the html file for the test you want to run, and change the html imports/scripts to point into the
bower_components
folder instead of reaching out to the folder next to your repo. Alternatively you can clone the repos for all dependencies into the same top level folder, but I find that to be a bit painful (you will end up cloning a LOT of repos). I don't know why they don't point to thebower_components
folder by default..... but none of them seem to. - Run a server in the root of the repo, and open up the
index.html
file inside of thetest
folder in your browser. This will run the tests.
Doing this should give you a renewed appreciation for dart :)
from polymer_elements.
@vsheyanov To run all the tests on the dart side of things, just do pub run test -pdartium
. If you want to run the compiled to js tests, you can run pub serve test
, and then pub run test -pchrome --pub-serve=8080
. The js tests you will usually have to run a few times, the bootstrapping we do breaks some assumptions in the test package today, so it times out during the dart2js compilation. Just keep running it until you no longer get the timeouts (leave pub serve running!). I would just run the dartium tests though for now.
from polymer_elements.
@ErikGrimes thanks, issue with display:none is one of that I've found out. And wanted to ask if it should be changed to visibility :)
@jakemac53 I took all tests from original repo, so that should be fine.
As usual thanks for the update!
from polymer_elements.
Hi guys, I'm trying to run all tests using pub run test -pdartium
command but it throws timeout most of the time... sometime some of the test run, but half of them would timeout anyway.. and looks like tests are run not sequentially, but simultaneously which doesn't look good...
When I run test for specific file - no problems at all (usually).
When I run tests in chrome - they are executed sequentially as expected... and yes, it on Windows...
from polymer_elements.
I recently submitted some fixes for flaky timeouts relating to the iron-* and google-* tests, so if that's what you were seeing then you can try just rebasing on master and it will probably fix your issues.
from polymer_elements.
closed by #23
from polymer_elements.
Related Issues (20)
- dart2js iron_localStorage HOT 2
- Cannot add dart objects to Firebase-Collection data HOT 7
- iron-localstorage event HOT 2
- google_map_marker.dart doesn't contain call to setPosition
- iron-collapse tests failing due to missed transitionend event HOT 1
- paper-item in paper-menu require two clicks to fire iron-activate in Firefox in rc6 HOT 3
- PolymerElement inside iron-pages does not display HOT 3
- iron-flex-layout not working HOT 2
- polymer 1 rc14 - error when access to a polymer_element attribute HOT 3
- Impossible to use maps, social ... icons HOT 4
- missing iron-scroll-threshold HOT 5
- Paper drop down content shrinks each time you use it HOT 2
- Autocomplete disabled for <paper-input> HOT 2
- PaperMenuButton set method for openAnimationConfig doesn't accept Dart or JS objects. HOT 1
- What about publishing a 0.3.0+1 version
- Noticed *.test files are being included in build HOT 3
- Broken dialog behaviour in 1.0.0-rc.9 HOT 2
- Firebase_auth.dart should allow optional arguments
- New release on Pub? (1.0.0-rc10)
- Unable to upgrade to polymer_elements 1.0.0-rc.9 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polymer_elements.