1.0.69 • Published 8 years ago

zombied-chai v1.0.69

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

npm version Build Status Code Climate Issue Count devDependency Status

Zombied Chai

Join the chat at https://gitter.im/tarciosaraiva/zombied-chai

A plugin for Chai that wraps ZombieJS assertions, but with a better DSL.

If you are using should or expect in Chai, instead of writing

browser.assert.status(200)

you can write

browser.should.have.status(200)
expect(browser).to.have.status(200)

How to use it

On your specHelper.js make sure you load zombied-chai like below:

'use strict'

var chai = require('chai')
var zombiedChai = require('zombied-chai')

chai.should()
chai.use(zombiedChai)

Assertions

Not all assertions are implemented yet but you already can do some basic things:

Zombie assertionbrowser.assertZombied-Chai assertionbrowser.should.be/have
.success.successful
.status(200).status(200)
.element('#selector').element('#selector')
.className('#selector', 'foo').element('#selector').withClass('foo')
.hasNoClass('#selector', 'foo').element('#selector').withoutClass('foo')
.attribute('#selector', 'foo', 'bar').element('#selector').withAttribute('foo', 'bar')
.attribute('#selector', 'data-foo', 'bar').element('#selector').withData('foo', 'bar')
.hasFocus('#selector').element('#selector').focused
.link('#selector', 'link text').link('#selector', 'link text')
.link('#selector', 'link text', 'url').link('#selector', 'link text').withHref('#href')
.url('url|obj|regex').url().withHost('host')
.url('url|obj|regex').url().withPath('/path')
.url('url|obj|regex').url().withQuery('a', 'b')

You can chain all this:

.url().withHost('host').withPath('/').withQuery('a', 'b')

Check the tests for all assertions. More assertions will come in time.

1.0.69

8 years ago

1.0.68

8 years ago

1.0.66

8 years ago

1.0.65

8 years ago

1.0.64

8 years ago

1.0.63

8 years ago

1.0.54

8 years ago

1.0.51

8 years ago

1.0.50

8 years ago

1.0.48

8 years ago

1.0.47

8 years ago

1.0.46

8 years ago

1.0.44

8 years ago

1.0.38

8 years ago

1.0.37

8 years ago

1.0.36

8 years ago