{"_id":"satisfy","_rev":"5-74139c441f14dc8bb3c693910ffba30c","name":"satisfy","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"satisfy","version":"0.1.0","main":"./lib/satisfy","dependencies":{"ms":"*","soda":"0.2.5","webkit-server":"0.1.0","debug":"0.1.0"},"devDependencies":{"mocha":"*","expect.js":"*"},"_npmUser":{"name":"rauchg","email":"rauchg@gmail.com"},"_id":"satisfy@0.1.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"ad98fcff3172d7d7275fbaca19509d70d0ffca36","tarball":"https://registry.npmjs.org/satisfy/-/satisfy-0.1.0.tgz","integrity":"sha512-hIs+voQXLWrPXJ6roJOQbpaiedrhWLWhQBloqGcsCc0rEcGWryhBULZhgeLsk4m7SzlTGAe3cb1LHuq4A18YiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6UmbhWb0tJpFcHSyud+yVTpw5IJGGm13uTlTxB5XYSAiBJP9UAObtuWxF0EA56Y39aYltiIULpndyz5dVtH9FNlw=="}]},"maintainers":[{"name":"rauchg","email":"rauchg@gmail.com"}]}},"readme":"\n# satisfy.js\n\nSatisfy is a minimalistic browser testing utility designed to work with any\ntest framework, oriented only around **CSS selectors**, designed for **speed**\nboth of _test writing_ and _test execution_.\n\nFor **development**, run the tests in a headless WebKit browser.\nFor **deployments**, run them in the cloud in all browsers with Selenium.\n\nIt's the [expect.js](http://github.com/learnboost/expect.js) of browser\n/ acceptance testing.\n\n## How to use\n\n```js\nsatisfy('localhost')\n  .click('li#home a')\n  .expect('h1:contains(Home)')\n  .click('li#test a')\n  .expect('h1:contains(Test)')\n```\n\n### Mocha\n\nWith the [mocha](http://github.com/visionmedia/mocha) test framework:\n\n```js\nvar satisfy = require('satisfy');\n\ndescribe('learnboost homepage', function () {\n  it('should work', function (done) {\n    satisfy('http://learnboost.com')\n      .expect('a:contains(For Schools)')\n      .run(done)\n  });\n});\n```\n\nThen run it:\n\n```\n$ mocha -t 0 test.js\n```\n\n## Features\n\n- Fast. The default adaptor is the fastest available.\n- Test-framework agnostic, but best with the wonderful [mocha](http://github.com/visionmedia/mocha)\n- No APIs to learn. Only based on CSS selectors.\n- Extended CSS selectors thanks to [Sizzle](http://api.jquery.com/category/selectors/) like `:contains` for text matching.\n- Adaptor based\n  - webkit-server (headless webkit)\n  - soda (selenium)\n\n## Examples\n\n### Following a link\n\n```js\nsatisfy('localhost')\n  .click('li#home a')\n  .expect('h1:contains(Home)')\n```\n\n### Filling a form\n\n```js\nsatisfy('localhost')\n  .click('#add-classroom')\n  .expect('#add-classroom-dialog', 7000) // override expect timeout\n  .fill('input[name=classroom-name]', 'My classroom')\n  .fill({ 'textarea': 'Something' })\n  .click('#add-classroom input[type=submit]')\n  .expect('body:not(#add-classroom)')\n```\n\n## Options\n\nYou can pass options to specific satisfy instances:\n\n```js\nsatisfy('http://host.com:port/path', { options })\n```\n\n* `adaptor` _String_ \n  - `webkit-server` or `soda` (selenium/sauce labs).\n  - Defaults to `webkit-server`\n* `timeout` _Number_\n  - Timeout after which we considered the test failed if a CSS selector expectation\n    is not met.\n  - Strings like `'2m'` or `'10s'` are supported.\n  - Defaults to `10000`\n* `webkit-server` _Object_\n  - Hash of options for the webkit-server adaptor.\n  - Options\n  * `poll` _Number|String_\n    - How often we poll the DOM for a certain selector match.\n    - Only applies for the `webkit-server` mode.\n    - Strings like `'2m'` or `'10s'` are supported.\n    - Defaults to `50`\n* `soda` _Object_\n  - Hash of options for the soda adaptor.\n  - Options\n    - `sauce` _Boolean_\n      - Whether to use sauce labs.\n      - Defaults to `false`\n    - `host` _String_\n      - Selenium host.\n      - Defaults to `localhost`\n    - `port` _Number_\n      - Selenium port\n      - Defaults to `4444`\n    - `browser` _String_\n      - Browser to test on.\n      - Defaults to `firefox`.\n* `autorun` _Boolean_\n  - If `run` is not called, it calls it automatically for you\n  - Defaults to `true`\n\n### Global options\n\nIf you wanted to pass options to all instances, you can implement that in\nuserland easily by defining your own helper method:\n\n```js\nfunction mytest (url) {\n  return satisfy(url, { default options });\n}\n```\n","maintainers":[{"name":"rauchg","email":"rauchg@gmail.com"}],"time":{"modified":"2022-06-26T16:10:06.889Z","created":"2012-01-09T18:56:08.699Z","0.1.0":"2012-01-09T18:56:09.954Z"}}