Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Bring the README up to date; Polyserve, and some better WCT tips
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian MacLeod committed Apr 21, 2015
1 parent fb7235f commit 1a6eef4
Showing 1 changed file with 33 additions and 15 deletions.
48 changes: 33 additions & 15 deletions README.md
Expand Up @@ -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.

Copy link
@addyosmani

addyosmani Apr 21, 2015

Contributor

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.

```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.

Copy link
@addyosmani

addyosmani Apr 21, 2015

Contributor

Good addition! It could just be me, but I was unable to find the -l and -p short-flags mentioned in the wct README. Might be worth calling them out there too :)

```sh
npm install -g web-component-tester
wct
```
`wct test/some-file.html` will test only the files you specify.

0 comments on commit 1a6eef4

Please sign in to comment.