Many developers use puppeteer to execute automated UI tests. However puppeteer is just a software to control Chromium and it is impossible to provide some assertion methods.

Rize provides a lot of useful assertion methods for testing. Rize is just a library and it use Node.js' assert module so you can use Rize with any testing frameworks you like.

Asserting page information

You may want to assert the URL of current page, so you can use assertUrlIs method:


If you want to check the URL is matched a given regular expression, use assertUrlMatch method:


Also, you can assert the query string. Just use assertQueryStringHas method:


You may want to check the query string value and not just the key:

rize.assertQueryStringHas('key', 'value')

The assertion above means check the value of key in query string. If the value does not equal to the value you gave, test will fail.

Even you can assert the query string misses a key:


Additionally, if you want to assert cookies, you can use assertCookieHas method.

Asserting page content and elements


You can assert page title with assertTitle method or assertTitleContains method.

rize.assertTitle('page title')

If you want to check if the page contains expected text, just use assertSee method.


You also can use assertSeeIn method to assert that expected text is in an element, and you just need to specify the selector of the element.

rize.assertSeeIn('#greeting', 'Hello!')

You can use assertDontSee or assertDontSeeIn method to assert that expected text is not in the page or element.


You can assert the state of an element:


You can check if an element contains a class:

rize.assertClassHas('#greeting', 'pull-right')

Or missing a class:

rize.assertClassMissing('#greeting', 'pull-left')

You can assert the state of a checkbox, a radio button or a dropdown:

rize.assertRadioSelected('input[type=radio]', 'south')
rize.assertRadioNotSelected('input[type=radio]', 'north')

And you can assert the value by using assertValueIs method or assertValueIsNot method.

Full APIs

All the assertion APIs of Rize are listed here. Those methods are prefixed with assert.

Last Updated: 8/23/2018, 2:22:32 AM