Expect
ExpectHelper
Section titled “ExpectHelper”This helper allows performing assertions based on Chai.
Examples
Section titled “Examples”Zero-configuration when paired with other helpers like REST, Playwright:
// inside codecept.conf.js{ helpers: { Playwright: {...}, Expect: {}, }}Methods
Section titled “Methods”expectAbove
Section titled “expectAbove”Parameters
Section titled “Parameters”targetDataanyaboveThananycustomErrorMsgany?
expectBelow
Section titled “expectBelow”Parameters
Section titled “Parameters”targetDataanybelowThananycustomErrorMsgany?
expectContain
Section titled “expectContain”Parameters
Section titled “Parameters”actualValueanyexpectedValueToContainanycustomErrorMsgany?
expectDeepEqual
Section titled “expectDeepEqual”Parameters
Section titled “Parameters”actualValueanyexpectedValueanycustomErrorMsgany?
expectDeepEqualExcluding
Section titled “expectDeepEqualExcluding”expects members of two JSON objects are deeply equal excluding some properties
Parameters
Section titled “Parameters”actualValueanyexpectedValueanyfieldsToExcludeanycustomErrorMsgany?
expectDeepIncludeMembers
Section titled “expectDeepIncludeMembers”expects an array to be a superset of another array
Parameters
Section titled “Parameters”supersetanysetanycustomErrorMsgany?
expectDeepMembers
Section titled “expectDeepMembers”expects members of two arrays are deeply equal
Parameters
Section titled “Parameters”actualValueanyexpectedValueanycustomErrorMsgany?
expectEmpty
Section titled “expectEmpty”Parameters
Section titled “Parameters”targetDataanycustomErrorMsgany?
expectEndsWith
Section titled “expectEndsWith”Parameters
Section titled “Parameters”actualValueanyexpectedValueToEndWithanycustomErrorMsgany?
expectEqual
Section titled “expectEqual”Parameters
Section titled “Parameters”actualValueanyexpectedValueanycustomErrorMsgany?
expectEqualIgnoreCase
Section titled “expectEqualIgnoreCase”Parameters
Section titled “Parameters”actualValueanyexpectedValueanycustomErrorMsgany?
expectFalse
Section titled “expectFalse”Parameters
Section titled “Parameters”targetDataanycustomErrorMsgany?
expectHasAProperty
Section titled “expectHasAProperty”Parameters
Section titled “Parameters”targetDataanypropertyNameanycustomErrorMsgany?
expectHasProperty
Section titled “expectHasProperty”Parameters
Section titled “Parameters”targetDataanypropertyNameanycustomErrorMsgany?
expectJsonSchema
Section titled “expectJsonSchema”Parameters
Section titled “Parameters”targetDataanyjsonSchemaanycustomErrorMsgany?
expectJsonSchemaUsingAJV
Section titled “expectJsonSchemaUsingAJV”Parameters
Section titled “Parameters”targetDataanyjsonSchemaanycustomErrorMsgany?ajvOptionsany? Pass AJV options
expectLengthAboveThan
Section titled “expectLengthAboveThan”Parameters
Section titled “Parameters”targetDataanylengthAboveThananycustomErrorMsgany?
expectLengthBelowThan
Section titled “expectLengthBelowThan”Parameters
Section titled “Parameters”targetDataanylengthBelowThananycustomErrorMsgany?
expectLengthOf
Section titled “expectLengthOf”Parameters
Section titled “Parameters”targetDataanylengthanycustomErrorMsgany?
expectMatchesPattern
Section titled “expectMatchesPattern”expects a JSON object matches a provided pattern
Parameters
Section titled “Parameters”actualValueanyexpectedPatternanycustomErrorMsgany?
expectMatchRegex
Section titled “expectMatchRegex”Parameters
Section titled “Parameters”targetDataanyregexanycustomErrorMsgany?
expectNotContain
Section titled “expectNotContain”Parameters
Section titled “Parameters”actualValueanyexpectedValueToNotContainanycustomErrorMsgany?
expectNotDeepEqual
Section titled “expectNotDeepEqual”Parameters
Section titled “Parameters”actualValueanyexpectedValueanycustomErrorMsgany?
expectNotEndsWith
Section titled “expectNotEndsWith”Parameters
Section titled “Parameters”actualValueanyexpectedValueToNotEndWithanycustomErrorMsgany?
expectNotEqual
Section titled “expectNotEqual”Parameters
Section titled “Parameters”actualValueanyexpectedValueanycustomErrorMsgany?
expectNotStartsWith
Section titled “expectNotStartsWith”Parameters
Section titled “Parameters”actualValueanyexpectedValueToNotStartWithanycustomErrorMsgany?
expectStartsWith
Section titled “expectStartsWith”Parameters
Section titled “Parameters”actualValueanyexpectedValueToStartWithanycustomErrorMsgany?
expectToBeA
Section titled “expectToBeA”Parameters
Section titled “Parameters”targetDataanytypeanycustomErrorMsgany?
expectToBeAn
Section titled “expectToBeAn”Parameters
Section titled “Parameters”targetDataanytypeanycustomErrorMsgany?
expectTrue
Section titled “expectTrue”Parameters
Section titled “Parameters”targetDataanycustomErrorMsgany?