This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring the README up to date; Polyserve, and some better WCT tips
- Loading branch information
Ian MacLeod
committed
Apr 21, 2015
1 parent
fb7235f
commit 1a6eef4
Showing
1 changed file
with
33 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,31 +2,49 @@ | |
|
||
An element providing a starting point for your own reusable Polymer elements. | ||
|
||
|
||
## Getting Started | ||
|
||
We've put together a [guide to seed-element](http://www.polymer-project.org/docs/start/reusableelements.html) to help get you rolling. | ||
|
||
## Testing Your Element | ||
|
||
Add the logic specific to your new element and verify its functionality. Good unit tests are essential to your verification plan but a good way to quickly sanity test your component is to access your demo.html file via a local web server. There are several ways to do this but one easy method is to run a simple web server that ships with Python, using the commands: | ||
## Playing With Your Element | ||
|
||
If you wish to work on your element in isolation, we recommend that you use | ||
[Polyserve](https://github.com/PolymerLabs/polyserve) to keep your element's | ||
bower dependencies in line. You can install it via: | ||
|
||
npm install -g polyserve | ||
|
||
```sh | ||
python -m SimpleHTTPServer | ||
``` | ||
And you can run it via: | ||
|
||
Or other method using NodeJS: | ||
polyserve | ||
|
||
This comment has been minimized.
Sorry, something went wrong. |
||
```sh | ||
http-server ./ | ||
``` | ||
Once running, you can view your element's files under | ||
`http://localhost:8080/components/seed-element/`, where `seed-element` is the | ||
name of the directory containing it. | ||
|
||
|
||
## Testing Your Element | ||
|
||
This starts a web server on port 8000, so you can test your new element by navigating a browser to `localhost:8000/test/index.html`. | ||
Simply navigate to the `/test` directory of your element to run its tests. If | ||
you are using Polyserve: `http://localhost:8080/components/seed-element/test/` | ||
|
||
### web-component-tester | ||
|
||
The tests are also compatible with [web-component-tester](https://github.com/Polymer/web-component-tester). You can run them on multiple local browsers via: | ||
The tests are compatible with [web-component-tester](https://github.com/Polymer/web-component-tester). | ||
Install it via: | ||
|
||
npm install -g web-component-tester | ||
|
||
Then, you can run your tests on _all_ of your local browsers via: | ||
|
||
wct | ||
|
||
#### WCT Tips | ||
|
||
`wct -l chrome` will only run tests in chrome. | ||
|
||
`wct -p` will keep the browsers alive after test runs (refresh to re-run). | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
addyosmani
Contributor
|
||
```sh | ||
npm install -g web-component-tester | ||
wct | ||
``` | ||
`wct test/some-file.html` will test only the files you specify. |
I love polyserve. A little on the fence about us dropping the fallback note for SimpleHTTPServer, but we can add that advice back if we find folks run into issues at all.