If you are using oxygen.conf.js, assert module must be added.
modules: ['web', 'log', 'assert']
Asserts that the string value contains a substring.
Parameters:
Name | Type | Description |
|
| Actual value. |
|
| Verbatim string to be contained. |
|
|
|
var user = web.getText('id=username') // returns admin​assert.contain(user, 'admin', 'error message')
assert.contain(web.getText('id=username'),'admin','error message')
Asserts that two values are equal.
Parameters:
Name | Type | Description |
|
| Actual value. |
|
| Expected value. Either a verbatim string or a regex string prefixed with |
|
|
|
var usernameInput = web.isExists('//input[@id="username"]')​assert.equal(usernameInput, true, 'error message')
assert.equal(web.isExists('//input[@id="username"]'),true,'error message')
Fails test with the given message.
Parameters:
Name | Type | Description |
|
|
|
assert.fail('error message')
assert.fail('Error message: '+ web.getText('//p[@id="error-message"]'))
Asserts that two values are not equal.
Parameters:
Name | Type | Description |
|
| Actual value. |
|
| Expected value. Either a verbatim string or a regex string prefixed with |
|
|
|
var loader = web.isVisible('//input[@id="loader "]')​assert.notEqual(loader, true, 'error message')
assert.notEqual(web.isVisible('//input[@id="loader "]'),true,'error message')
Passes the test with the given message.
Parameters:
Name | Type | Description |
|
|
|
assert.pass('Passed')