API Docs for: 0.0.2
Show:

Dalek.Internal.Assertions Class

Defined in: index.js:43
Module: Assertions

Assertions check if the assumptions you made about a website are correct. For example they might check if the title of a page or the content text of an element is as expected, or if your mobile website version only displays a certain amount of elements.

Constructor

Dalek.Internal.Assertions

()

Defined in index.js:43

Methods

_addToActionQueue

(
  • opts
  • driverMethod
  • A
)
private chainable

Defined in index.js:1441

Adds a method to the queue of actions/assertions to execute

Parameters:

  • opts Object

    Options of the action to invoke

  • driverMethod String

    Name of the method to call on the driver

  • A Function

    callback function that will be executed when the action has been executed

_contain

(
  • a
  • b
)
Bool private

Defined in index.js:1694

Assert a given value matches a RegEx

Parameters:

  • a Mixed

    Value to test

  • b String

    Value to compare

Returns:

Bool:

test result

_contain

(
  • a
  • b
)
Bool private

Defined in index.js:1634

Assert if a given value contain another value

Parameters:

  • a Bool

    Value to test

  • b Bool

    Value to compare

Returns:

Bool:

test result

_generateCallbackAssertion

(
  • key
  • type
)
Function private

Defined in index.js:1396

Generates a callback that will be fired when the action has been completed. The callback itself will then validate the answer and will also emit an event that the action has been successfully executed.

Parameters:

  • key String

    Unique key of the action

  • type String

    Type of the action (usually the actions name)

Returns:

Function:

The generated callback function

_testBetween

(
  • a
  • b
)
Bool private

Defined in index.js:1560

Assert if a given value matches a range

Parameters:

  • a Array

    Range to test

  • b Bool

    Value to compare

Returns:

Bool:

test result

_testFalsy

(
  • a
)
Bool private

Defined in index.js:1681

Assert if a given value is boolean 'false'

Parameters:

  • a Bool

    Value to test

Returns:

Bool:

true if value is false, false if value is true

_testGreaterThan

(
  • a
  • b
)
Bool private

Defined in index.js:1580

Assert if a given value is greater than the value to compare

Parameters:

  • a Bool

    Value to test

  • b Bool

    Value to compare

Returns:

Bool:

test result

_testGreaterThanEqual

(
  • a
  • b
)
Bool private

Defined in index.js:1600

Assert if a given value is greater or equal than the value to compare

Parameters:

  • a Bool

    Value to test

  • b Bool

    Value to compare

Returns:

Bool:

test result

_testLowerThan

(
  • a
  • b
)
Bool private

Defined in index.js:1614

Assert if a given value is lower than the value to compare

Parameters:

  • a Bool

    Value to test

  • b Bool

    Value to compare

Returns:

Bool:

test result

_testLowerThanEqual

(
  • a
  • b
)
Bool private

Defined in index.js:1654

Assert if a given value is lower or equal than the value to compare

Parameters:

  • a Bool

    Value to test

  • b Bool

    Value to compare

Returns:

Bool:

test result

_testShallowEquals

(
  • a
  • b
)
Bool private

Defined in index.js:1520

Assert if a given value shallow equals a second given value

Parameters:

  • a Mixed

    Value to test

  • b Mixed

    Value to test

Returns:

Bool:

false if values donʼt match, true if they match

_testShallowUnequals

(
  • a
  • b
)
Bool private

Defined in index.js:1540

Assert if a given value shallow does not equal a second given value

Parameters:

  • a Mixed

    Value to test

  • b Mixed

    Value to test

Returns:

Bool:

true if values donʼt match, false if they match

_testTruthy

(
  • a
)
Bool private

Defined in index.js:1668

Assert if a given value is boolean 'true'

Parameters:

  • a Bool

    Value to test

Returns:

Bool:

false if value is false, true if value is true

attr

(
  • selector
  • attribute
  • expected
  • message
)
chainable

Defined in index.js:1215

Asserts that an elements attribute is as expected.

<form>
  <button class="jumpButton" type="submit">Fire</button>
</form>
 test
   .open('http://dalekjs.com/guineapig/')
   .assert.attr('.jumpButton', 'type', 'submit')
   .done();
<div id="dataDiv" data-spot="cat"></div>
 test
   .open('http://dalekjs.com/guineapig/')
   .assert.attr('#dataDiv').is('data-spot', 'cat', 'We found Dataʼs cat!')
   .done();
 test
   .open('http://dalekjs.com/guineapig/')
   .assert.attr('#dataDiv').is.not('data-spot', 'doc', 'Spot is not a dog!')
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • attribute String

    The attribute to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter

between

(
  • expected
  • message
)
chainable

Defined in index.js:1302

Between helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

chain

() chainable

Defined in index.js:61

It can be really cumbersome to always write assert, assert & assert all over the place when your doing multiple assertions. To avoid this, open an assertion context in your test which allows you to write (n) assertions without having to write 'assert' before each.

So, instead of writing this:

test.open('http://doctorwhotv.co.uk/')
    .assert.text('#nav').is('Navigation')
    .assert.visible('#nav')
    .assert.attr('#nav', 'data-nav', 'true')
    .done();

you can write this:

test.open('http://doctorwhotv.co.uk/')
    .assert.chain()
      .text('#nav').is('Navigation')
      .visible('#nav')
      .attr('#nav', 'data-nav', 'true')
    .end()
    .done();

to make it even more concise, you can combine this with the query method:

test.open('http://doctorwhotv.co.uk/')
    .assert.chain()
      .query('#nav')
          .text().is('Navigation')
          .visible()
          .attr('data-nav', 'true')
        .end()
    .end()
    .done();

Always make sure, you terminate it with the end method!

contain

(
  • expected
  • message
)
chainable

Defined in index.js:1367

Contain helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

css

(
  • selector
  • property
  • expected
  • message
)
chainable

Defined in index.js:410

Checks the computed style.

<div id="superColoredElement">Rose</div>
#superColoredElement {
  background-color: rgba(255, 0, 0, 1);
  color: rgba(0, 128, 0, 1);
}
 test
   .open('http://unicorns.rainbows.io')
   .assert.css('#superColoredElement', 'background-color', 'rgba(255, 0, 0, 1)')
   .assert.css('#superColoredElement', 'color', 'rgba(0, 128, 0, 1)')
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • property String

    CSS property to check

  • expected String

    Expected test result

  • message String

    Message for the test reporter

dialogDoesntHaveText

(
  • expected
  • message
)
chainable

Defined in index.js:948

Asserts that given text does not exist in the current alert/prompt/confirm dialog.

<a href="#" id="alert_confirm" onclick="confirm('Confirm me!')">I make confirm</a>
 test
   .open('http://skaaro.com/index.html')
   .click('#alert_confirm')
   .assert.dialogDoesntHaveText('I am an alert')
   .accept()
   .done();

NOTE: Does not work in Firefox & PhantomJS

Parameters:

  • expected String

    Expected test result

  • message String

    Message for the test reporter

dialogText

(
  • expected
  • message
)
chainable

Defined in index.js:1033

Asserts that given alertText does exist in the provided alert/confirm or prompt dialog.

<a href="#" id="alert" onclick="alert('I am an alert')">I make alerts!</a>
 test
   .open('http://skaaro.com/index.html')
   .click('#alert_confirm')
   .assert.dialogText('I am an alert')
   .accept()
   .done();

of course, text works also with the assertion helpers is() and not()

 test
   .open('http://dalekjs.com/guineapig/')
   .assert.dialogText().is('I am an alert', 'Exterminate!')
   .done();
 test
   .open('http://dalekjs.com/guineapig/')
   .assert.dialogText().is.not('I am an prompt', 'Exterminate!')
   .done();

NOTE: Does not work in Firefox & PhantomJS

Parameters:

  • expected String

    Expected testresult

  • message String

    Message for the test reporter

disabled

(
  • selector
  • message
)
chainable

Defined in index.js:683

Determine if an element is currently disabled.

<input disabled id="onearth" type="text" size="50" name="onearth" placeholder="State your name, rank and intention!"></input>
test
  .open('http://doctor.thedoctor.com/doctor')
  .assert.disabled('#onearth', 'Is disabled!')
  .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

doesntExist

(
  • selector
  • message
)
chainable

Defined in index.js:796

Asserts that an element matching the provided selector expression doesnʼt exists within the remote DOM environment.

<body>
  <p id="so-lonely">Last of the time lords</p>
</body>
test
  .open('http://doctor.thedoctor.com/doctor')
  .assert.doesntExist('#the-master', 'The master element has not been seen')
  .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

doesntHaveText

(
  • selector
  • expected
  • message
)
chainable

Defined in index.js:911

Asserts that given text does not exist in the provided selector.

<body>
  <h1>This is a CasperJS sandbox</h1>
</body>
 test
   .open('http://dalekjs.com/guineapig/')
   .assert.doesntHaveText('h1', 'This page is a Dalek sandbox', 'It´s a sandbox!')
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter

doesntHaveTitle

(
  • expected
  • message
)
chainable

Defined in index.js:1121

Asserts that given title does not match the given expectations.

  test.open('http://doctorwhotv.co.uk/')
    .assert.doesntHaveTitle('Dalek Emperor TV', 'Not your Daleks TV')
    .done();

Parameters:

  • expected String

    Expected test result

  • message String

    Message for the test reporter

doesntHaveUrl

(
  • expected
  • message
)
chainable

Defined in index.js:1192

Asserts that the pages URL does not match the expectation.

  test.open('http://doctorwhotv.co.uk/')
    .assert.doesntHaveUrl('http://doctorwhotv.co.uk/', 'URL is not expected')
    .done();

Parameters:

  • expected String

    Expected test result

  • message String

    Message for the test reporter

enabled

(
  • selector
  • message
)
chainable

Defined in index.js:649

Determine if an element is currently enabled.

<input id="onmars" type="text" size="50" name="onmars" placeholder="State your name, rank and intention!"></input>
test
  .open('http://doctor.thedoctor.com/doctor')
  .assert.enabled('#onmars', 'Is enabled!')
  .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

end

() chainable

Defined in index.js:116

Terminates an assertion chain or a query

test.open('http://doctorwhotv.co.uk/')
    .assert.chain()
      .query('#nav')
          .text().is('Navigation')
          .visible()
          .attr('data-nav', 'true')
        .end()
    .end()
    .done();

exists

(
  • selector
  • message
)
chainable

Defined in index.js:760

Asserts that an element matching the provided selector expression exists in remote DOM environment.

<body>
  <p id="so-lonely">Last of the timelords</p>
</body>
test
  .open('http://doctor.thedoctor.com/doctor')
  .assert.exists('#so-lonely', 'The loneliest element in the universe exists')
  .done()

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

generateTestHelper

(
  • name
  • assertionFn
  • negate
)
private

Defined in index.js:1464

Generates a function that can be used

Parameters:

  • name Object
  • assertionFn Object
  • negate Object

Returns:

gt

(
  • expected
  • message
)
chainable

Defined in index.js:1315

Gt helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

gte

(
  • expected
  • message
)
chainable

Defined in index.js:1328

Gte helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

height

(
  • selector
  • expected
  • message
)
chainable

Defined in index.js:501

Checks the actual height of an element.

  <div id="fixed-dimensions" style="height: 100px"></div>
 test
   .open('http://localhost:5000/index.html')
   // all true, all pixel
   .assert.height('#fixed-dimensions', 100)
   .assert.height('#fixed-dimensions').is(100)
   .assert.height('#fixed-dimensions').is.not(100)
   .assert.height('#fixed-dimensions').is.gt(90)
   .assert.height('#fixed-dimensions').is.gte(97)
   .assert.height('#fixed-dimensions').is.lt(120)
   .assert.height('#fixed-dimensions').is.lte(110)
   .assert.height('#fixed-dimensions').is.between([90, 110])
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter

httpStatus

(
  • status
  • message
)
chainable

Defined in index.js:743

Asserts that current HTTP status code is the same as the one passed as argument. TODO: Needs some work to be implement (maybe JavaScript, Webdriver ha no method for this)

Parameters:

  • status Integer

    HTTP status code

  • message String

    Message for the test reporter

is

(
  • expected
  • message
)
chainable

Defined in index.js:1276

Is helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

lt

(
  • expected
  • message
)
chainable

Defined in index.js:1341

Lt helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

lte

(
  • expected
  • message
)
chainable

Defined in index.js:1354

Lte helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

match

(
  • expected
  • message
)
chainable

Defined in index.js:1380

Match helper

Parameters:

  • expected String

    Regex to match on

  • message String

    Test message

not

(
  • expected
  • message
)
chainable

Defined in index.js:1289

Not helper

Parameters:

  • expected Mixed

    Value to check

  • message String

    Test message

notSelected

(
  • selector
  • message
)
chainable

Defined in index.js:597

Determine if an

<input type="checkbox" id="unchecked_checkbox" name="unchecked_checkbox"/>
<input type="checkbox" id="checked_checkbox" name="checked_checkbox" checked="checked"/>
<select id="select_elm" name="select_elm">
  <option value="9">Eccleston</option>
  <option selected value="10">Tennant</option>
  <option value="11">Smith</option>
</select>

Checking radio and checkboxes:

 test
   .open('http://selectables.org')
   .assert.notSelected('#unchecked_checkbox')
   .done();

Checking option elements:

 test
   .open('http://selectables.org')
   .assert.notSelected('#select_elm option:last-child')
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

notVisible

(
  • selector
  • message
)
chainable

Defined in index.js:833

Asserts that the element matching the provided selector expression is not visible.

<body>
  <h1 style="display: none">Me? So hidden …</h1>
  <h2>Me? So in viewport...</h2>
</body>
 test
   .open('http://allyourviewportsbelongto.us')
   .assert.notVisible('h1', 'Element is not visible')
   .done();

NOTE: Buggy on all browsers

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

numberOfElements

(
  • selector
  • expected
  • message
)
chainable

Defined in index.js:164

Asserts that a given element appears n times on the page.

Given this portion of HTML, you would like to assure that all of these elements are ending up in your rendered markup on your page.

<section id="blog-overview">
  <article class="teaser"></article>
  <article class="teaser"></article>
  <article class="teaser"></article>
  <article class="teaser"></article>
</section>

The simple solution is to check if all these elements are present

test.assert.numberOfElements('#blog-overview .teaser', 4, '4 blog teasers are present')

The alternate syntax for this is:

test.assert.numberOfElements('#blog-overview .teaser')
    .is(4, '4 blog teasers are present')

If you are not sure how many elements will exactly end up in your markup, you could use the between assertion handler

test.assert.numberOfElements('#blog-overview .teaser')
    .is.between([2, 6], 'Between 2 and 6 blog teasers are present')

If you dealing with the situation that you have a minimum of elements, you expect, you can use this helper:

test.assert.numberOfElements('#blog-overview .teaser')
    .is.gt(2, 'At least 3 blog teasers are present')

If you want to know if its 'greater than equal', use this one

test.assert.numberOfElements('#blog-overview .teaser')
    .is.gte(2, 'At least 2 blog teasers are present')

as well as their 'lower than' and 'lower than equal' equivalents.

test.assert.numberOfElements('#blog-overview .teaser')
    .is.lt(5, 'Less than 5 blog teasers are present')
test.assert.numberOfElements('#blog-overview .teaser')
    .is.lte(5, 'Less than, or 5 blog teasers are present')

And if you just want to know, if a certain amount of teasers isnʼt present, you can still use the not() assertion helper

test.assert.numberOfElements('#blog-overview .teaser')
    .is.not(5, 'There are more or less than 5 teasers present')

Parameters:

  • selector String

    Selector that matches the elements to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter

numberOfVisibleElements

(
  • selector
  • expected
  • message
)
chainable

Defined in index.js:253

Asserts that a given element is visible n times in the current viewport.

Given this portion of HTML, you would like to assure that all of these elements are ending up in your rendered markup on your page.

 <section id="blog-overview">
   <article class="teaser"></article>
   <article class="teaser"></article>
   <article class="teaser"></article>
   <article class="teaser"></article>
 </section>

The simple solution is to check if all these elements are visible

 test.assert.numberOfVisibleElements('#blog-overview .teaser', 4, '4 blog teasers are visible')

The alternate syntax for this is:

 test.assert.numberOfVisibleElements('#blog-overview .teaser')
     .is(4, '4 blog teasers are visible')

If you are not sure how many elements will exactly be shown in the current viewport, you could use the between assertion handler

 test.assert.numberOfVisibleElements('#blog-overview .teaser')
     .is.between(2, 6, 'Between 2 and 6 blog teasers are visible')

If you dealing with the situation that you have a minimum of elements, you expect, use this helper:

 test.assert.numberOfVisibleElements('#blog-overview .teaser')
     .is.gt(2, 'At least 3 blog teasers are visible')

If you want to know if its 'greater than equal', you can use this one

 test.assert.numberOfVisibleElements('#blog-overview .teaser')
     .is.gte(2, 'At least 2 blog teasers are visible')

as well as their 'lower than' and 'lower than equal' equivalents.

 test.assert.numberOfVisibleElements('#blog-overview .teaser')
     .is.lt(5, 'Less than 5 blog teasers are visible')
 test.assert.numberOfVisibleElements('#blog-overview .teaser')
     .is.lte(5, 'Less than, or 5 blog teasers are visible')

And if you just want to know, if a certain amount of teasers isnʼt visible, you can still use the ':not(): assertion helper

 test.assert.numberOfVisibleElements('#blog-overview .teaser')
     .is.not(5, 'There are more or less than 5 teasers visible')

NOTE: Buggy on all browsers

Parameters:

  • selector String

    Selector that matches the elements to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter

resourceExists

(
  • url
  • message
)
chainable

Defined in index.js:148

Asserts that a given resource does exist in the environment.

Parameters:

  • url String

    URL of the resource to check

  • message String

    Message for the test reporter

selected

(
  • selector
  • message
)
chainable

Defined in index.js:546

Determine if an

<input type="checkbox" id="unchecked_checkbox" name="unchecked_checkbox"/>
<input type="checkbox" id="checked_checkbox" name="checked_checkbox" checked="checked"/>
<select id="select_elm" name="select_elm">
  <option value="9">Eccleston</option>
  <option selected value="10">Tennant</option>
  <option value="11">Smith</option>
</select>

Checking radio and checkboxes:

 test
   .open('http://selectables.org')
   .assert.selected('#checked_checkbox')
   .done();

Checking option elements:

 test
   .open('http://selectables.org')
   .assert.selected('#select_elm option:nth-child(2)')
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

text

(
  • selector
  • expected
  • message
)
chainable

Defined in index.js:980

Asserts that given text does exist in the provided selector.

<body>
  <h1>This is a Dalek sandbox</h1>
</body>
 test
   .open('http://dalekjs.com/guineapig/')
   .assert.text('h1', 'This page is a Dalek sandbox', 'Exterminate!')
   .done();

of course, text works also with the assertion helpers is() and not()

 test
   .open('http://dalekjs.com/guineapig/')
   .assert.text('h1').is('This page is a Dalek sandbox', 'Exterminate!')
   .done();
 test
   .open('http://dalekjs.com/guineapig/')
   .assert.text('h1').is.not('This page is a CasperJS sandbox', 'Exterminate!')
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter

title

(
  • expected
  • message
)
chainable

Defined in index.js:1082

Asserts that the page title is as expected.

  test.open('http://doctorwhotv.co.uk/')
    .assert.title('Doctor Who TV', 'Not your Daleks TV')
    .done();

Yep, using assertion helpers is also possible:

  test.open('http://doctorwhotv.co.uk/')
    .assert.title().is('Doctor Who TV', 'Not your Daleks TV')
    .done();

and the not() helper is available too:

  test.open('http://doctorwhotv.co.uk/')
    .assert.title().is.not('Dalek Emperor TV', 'Not your Daleks TV')
    .done();

Parameters:

  • expected String

    Expected test result

  • message String

    Message for the test reporter

url

(
  • expected
  • message
)
chainable

Defined in index.js:1144

Asserts that the pages url is as expected.

  test.open('http://doctorwhotv.co.uk/')
    .assert.url('http://doctorwhotv.co.uk/', 'URL is as expected')
    .done();

You can also check if the protocol changed, nice to see when you open GitHub with 'http' instead of 'https'

  test.open('http://github.com')
    .assert.url('https://github.com/', 'Changed prototcols')
    .done();

Yep, using assertion helpers is also possible:

  test.open('http://github.com')
    .assert.url().is('http://doctorwhotv.co.uk/', 'URL is as expected')
    .done();

and the not() helper is available too:

  test.open('http://doctorwhotv.co.uk/')
    .assert.url().is.not('http://doctorwhotv.co.uk/', 'URL is as expected')
    .done();

Parameters:

  • expected String

    Expected test result

  • message String

    Message for the test reporter

val

(
  • selector
  • expected
  • message
)
chainable

Defined in index.js:346

Asserts that a given form field has the provided value.

Given this portion of HTML, we would like to get the information which option element is currently selected.

<form name="fav-doctor" id="fav-doctor">
  <select id="the-doctors">
    <option value="9">Eccleston</option>
    <option selected value="10">Tennant</option>
    <option value="11">Smith</option>
  </select>
</form>
test
  .assert.val('#the-doctors', 10, 'David is the favourite')
  // lets change the favourite by selection the last option
 .click('#the-doctors option:last')
 .assert.val('#the-doctors', 11, 'Matt is now my favourite, bow ties are cool')

This assertion is capable of getting the values from every form element that holds a value attribute

Getting texts out of normal input fields is pretty straight forward

<label for="fav-enemy">Tell my your favourity Who enemy:</label>
<input id="fav-enemy" name="fav-enemy" type="text" value="Daleks" />
test
  .assert.val('#fav-enemy', 'Daleks', 'Daleks are so cute')
  // lets change the favourite by typing smth. new
 .type('#fav-enemy', 'Cyberman')
 .assert.val('#fav-enemy', 'Cyberman', 'Cyberman are so cyber')

Parameters:

  • selector String

    Selector that matches the elements to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter

visible

(
  • selector
  • message
)
chainable

Defined in index.js:873

Asserts that the element matching the provided selector expression is visible.

<body>
  <h1>Me? So in viewport …</h1>
</body>
 test
   .open('http://allyourviewportsbelongto.us')
   .assert.visible('h1', 'Element is visible')
   .done();

NOTE: Buggy on all browsers

Parameters:

  • selector String

    Selector that matches the elements to test

  • message String

    Message for the test reporter

width

(
  • selector
  • expected
  • message
)
chainable

Defined in index.js:456

Checks the actual width of an element.

  <div id="fixed-dimensions" style="width: 100px"></div>
 test
   .open('http://localhost:5000/index.html')
   // all true, all pixel
   .assert.width('#fixed-dimensions', 100)
   .assert.width('#fixed-dimensions').is(100)
   .assert.width('#fixed-dimensions').is.not(100)
   .assert.width('#fixed-dimensions').is.gt(90)
   .assert.width('#fixed-dimensions').is.gte(97)
   .assert.width('#fixed-dimensions').is.lt(120)
   .assert.width('#fixed-dimensions').is.lte(110)
   .assert.width('#fixed-dimensions').is.between([90, 110])
   .done();

Parameters:

  • selector String

    Selector that matches the elements to test

  • expected String

    Expected test result

  • message String

    Message for the test reporter