GithubHelp home page GithubHelp logo

matthewmueller / component-test Goto Github PK

View Code? Open in Web Editor NEW
98.0 7.0 10.0 50 KB

Minimal configuration component test runner supporting browser testing, phantomjs, and saucelabs.

JavaScript 95.44% Makefile 0.53% HTML 4.03%

component-test's Introduction

component-test

Minimal configuration component test runner supporting browser testing, phantomjs, and saucelabs.

Installation

npm install -g component-test

API

Browser

In browser testing

component test browser

browser

Phantom

Test using phantomjs.

component test phantom

phantom

Saucelabs

Test using saucelabs.

component test sauce -b "iphone 6.0 Mac OS 10.8, firefox 5 Windows XP"

saucelabs

Travis

First download the travis gem:

gem install travis

Encrypt your credentials:

travis encrypt SAUCE=username:accessKey -r component/domify

Then add the browsers you want to test. Here's what the component/domify .travis.yml looks like:

language: node_js
node_js:
  - '0.10'
env:
  global:
    - secure: PT7QR0DCGcZ+JjH4kpsaGHPYyjdbKbm44Wj9nsHA/QgIG/FRBCvsAU1OyaWHF8KCP6p0TEfhgeW+vUlZfxlbpDa4eSR8kjqkcNTR1CWKqYfjjQzBFzibrmLE+gKOnIRxFhdwUjzatRc1A2B+jX/03HoIgsUhnG83xiinz21dBJI=
  matrix:
    - BROWSER="iphone 6.1 Mac 10.8"
    - BROWSER="ipad 5.1 Mac 10.8"
    - BROWSER="firefox 6 Mac 10.6"d

And here's the result:

travis

TODO

  • Offer higher-level API over saucelabs in separate repo (like zuul)
  • Use Travis API for encryption (eg. mimic behavior of travis encrypt)
  • Provide API for adding browsers to .travis.yml

License

(The MIT License)

Copyright (c) 2013 Matthew Mueller <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

component-test's People

Contributors

jameslnewell avatar jb55 avatar jonathanong avatar matthewmueller avatar robertmaldon avatar swatinem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

component-test's Issues

code coverage?

thoughts on implementing code coverage reporting using yields/coverage?

cli api could resemble:

$ component test {browser,phantom} --coverage

investigate saucelabs test inconsistencies

Seems to be related to browser.eval in mocha-cloud.

Some of the errors:

{"message":"Error response status: 13. ","status":13,"cause":{"status":13,"message":"Job 635533192a704820afdeba73c33be9d4 has already finished, and can't receive further commands. It may have experienced an error. You can learn more at https://saucelabs.com/jobs/635533192a704820afdeba73c33be9d4","value":{"message":"Job 635533192a704820afdeba73c33be9d4 has already finished, and can't receive further commands. It may have experienced an error. You can learn more at https://saucelabs.com/jobs/63553...

and...

{"message":"Not JSON response","data":"ERROR Job 8af03cddfe86472e8c679e6f6ab9fb4f is not in progress. It may have recently finished, or experienced an error. You can learn more at https://saucelabs.com/jobs/8af03cddfe86472e8c679e6f6ab9fb4f"}

options for mocha

Not sure if i'm missing something here but is there currently a way to pass options (timeout, reporter etc) to mocha? Would be cool if it were the exact same interface as mocha itself:

  component test phantom \
    --reporter spec \
    --timeout 10000 \
    --bail

I tried to use mocha.opts but this didn't work either.

integrate yields/gravy

way better implementation. will need some additional support (with the fixes i made for saucelabs)

use suite.title for page title

this is really just my ocd, but when using component test browser, i don't want the page title to always be "domify tests"

build before testing

I was confused as how this worked as I didn't do a component build yet.

The save bet would be to mention in the README that you should add add the command to your Makefile or issue make && component test browser.

More magic, this could internally run component install && component build or make, but that's likely to break e.g. one might depend on multiple steps in their makefile and others might have a makefile that doesn't even component build.

Feature Request: Support Folders for Test Scripts

I've got a component with it's functionality distributed throughout lib. As such, my test directory has the same tree defined, where each test file matches 1-1 with lib.

Currently, the glob pattern is test/*.js, which of course doesn't traverse all my test files. Could we either change the glob pattern to be test/**/*.js? (or at least allow some way to configure that glob pattern externally?)

FYI: I set free component-test name

Hi @matthewmueller,

Thanks for cool library!

Historically I borrowed component-test name in npm, and I've just renamed it to component-testem, because it makes more sense in case, what my library did. Feel free to rename yours, if you prefer ;)

All the best,
Aleksey

P.S.
npm site is cached previous version of the page https://npmjs.org/package/component-test, but you can make sure that it's free from terminal.

$ npm info component-test
npm ERR! 404 'component-test' is not in the npm registry.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.