codeceptjs
Version:
Supercharged End 2 End Testing Framework for NodeJS
276 lines (174 loc) • 4.57 kB
Markdown
---
permalink: /helpers/ExpectHelper
editLink: false
sidebar: auto
title: ExpectHelper
---
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## ExpectHelper
This helper allows performing assertions based on Chai.
### Examples
Zero-configuration when paired with other helpers like REST, Playwright:
```js
// inside codecept.conf.js
{
helpers: {
Playwright: {...},
ExpectHelper: {},
}
}
```
## Methods
### expectAbove
#### Parameters
- `targetData` **any** 
- `aboveThan` **any** 
- `customErrorMsg` **any?**
### expectBelow
#### Parameters
- `targetData` **any** 
- `belowThan` **any** 
- `customErrorMsg` **any?**
### expectContain
#### Parameters
- `actualValue` **any** 
- `expectedValueToContain` **any** 
- `customErrorMsg` **any?**
### expectDeepEqual
#### Parameters
- `actualValue` **any** 
- `expectedValue` **any** 
- `customErrorMsg` **any?**
### expectDeepEqualExcluding
expects members of two JSON objects are deeply equal excluding some properties
#### Parameters
- `actualValue` **any** 
- `expectedValue` **any** 
- `fieldsToExclude` **any** 
- `customErrorMsg` **any?**
### expectDeepIncludeMembers
expects an array to be a superset of another array
#### Parameters
- `superset` **any** 
- `set` **any** 
- `customErrorMsg` **any?**
### expectDeepMembers
expects members of two arrays are deeply equal
#### Parameters
- `actualValue` **any** 
- `expectedValue` **any** 
- `customErrorMsg` **any?**
### expectEmpty
#### Parameters
- `targetData` **any** 
- `customErrorMsg` **any?**
### expectEndsWith
#### Parameters
- `actualValue` **any** 
- `expectedValueToEndWith` **any** 
- `customErrorMsg` **any?**
### expectEqual
#### Parameters
- `actualValue` **any** 
- `expectedValue` **any** 
- `customErrorMsg` **any?**
### expectEqualIgnoreCase
#### Parameters
- `actualValue` **any** 
- `expectedValue` **any** 
- `customErrorMsg` **any?**
### expectFalse
#### Parameters
- `targetData` **any** 
- `customErrorMsg` **any?**
### expectHasAProperty
#### Parameters
- `targetData` **any** 
- `propertyName` **any** 
- `customErrorMsg` **any?**
### expectHasProperty
#### Parameters
- `targetData` **any** 
- `propertyName` **any** 
- `customErrorMsg` **any?**
### expectJsonSchema
#### Parameters
- `targetData` **any** 
- `jsonSchema` **any** 
- `customErrorMsg` **any?**
### expectJsonSchemaUsingAJV
#### Parameters
- `targetData` **any** 
- `jsonSchema` **any** 
- `customErrorMsg` **any?**
- `ajvOptions` **any?** Pass AJV options
### expectLengthAboveThan
#### Parameters
- `targetData` **any** 
- `lengthAboveThan` **any** 
- `customErrorMsg` **any?**
### expectLengthBelowThan
#### Parameters
- `targetData` **any** 
- `lengthBelowThan` **any** 
- `customErrorMsg` **any?**
### expectLengthOf
#### Parameters
- `targetData` **any** 
- `length` **any** 
- `customErrorMsg` **any?**
### expectMatchesPattern
expects a JSON object matches a provided pattern
#### Parameters
- `actualValue` **any** 
- `expectedPattern` **any** 
- `customErrorMsg` **any?**
### expectMatchRegex
#### Parameters
- `targetData` **any** 
- `regex` **any** 
- `customErrorMsg` **any?**
### expectNotContain
#### Parameters
- `actualValue` **any** 
- `expectedValueToNotContain` **any** 
- `customErrorMsg` **any?**
### expectNotDeepEqual
#### Parameters
- `actualValue` **any** 
- `expectedValue` **any** 
- `customErrorMsg` **any?**
### expectNotEndsWith
#### Parameters
- `actualValue` **any** 
- `expectedValueToNotEndWith` **any** 
- `customErrorMsg` **any?**
### expectNotEqual
#### Parameters
- `actualValue` **any** 
- `expectedValue` **any** 
- `customErrorMsg` **any?**
### expectNotStartsWith
#### Parameters
- `actualValue` **any** 
- `expectedValueToNotStartWith` **any** 
- `customErrorMsg` **any?**
### expectStartsWith
#### Parameters
- `actualValue` **any** 
- `expectedValueToStartWith` **any** 
- `customErrorMsg` **any?**
### expectToBeA
#### Parameters
- `targetData` **any** 
- `type` **any** 
- `customErrorMsg` **any?**
### expectToBeAn
#### Parameters
- `targetData` **any** 
- `type` **any** 
- `customErrorMsg` **any?**
### expectTrue
#### Parameters
- `targetData` **any** 
- `customErrorMsg` **any?**