Exam BDD Framework >

Before each example

Given table

product
idnamepricecreated_at
1Model A1.702024-08-24T16:42:28.883
2Model B2.002024-08-24T15:42:28.883
Log File

!Example 1. Surplus rows

Example 1. Surplus rowsExpectedToFail

Wrong expectation

row count (table=product) expected:<1> but was:<2>
Expected:
product
idnamepricecreated_At
1Model A1.702024-08-24T16:42:28.883
but was:
product
idnamepricecreated_at
1Model A1.702024-08-24T16:42:28.883
2Model B2.002024-08-24T15:42:28.883
Log File

!Example 2. Surplus rows: await

Example 2. Surplus rows: awaitExpectedToFail

Wrong expectation

Check didn't complete within 1000ms (poll delay 0ms, interval 1000ms) because:
 row count (table=product) expected:<1> but was:<2>
Expected:
product
idnamepricecreated_At
1Model A1.702024-08-24T16:42:28.883
but was:
product
idnamepricecreated_at
1Model A1.702024-08-24T16:42:28.883
2Model B2.002024-08-24T15:42:28.883
Log File

!Example 3. Missing rows

Example 3. Missing rowsExpectedToFail

Wrong expectation

row count (table=product) expected:<3> but was:<2>
Expected:
product
idnamepricecreated_At
1Model A1.702024-08-24T16:42:28.883
2Model B2.002024-08-24T15:42:28.883
3Model C3.002024-08-24T17:42:28.883
but was:
product
idnamepricecreated_at
1Model A1.702024-08-24T16:42:28.883
2Model B2.002024-08-24T15:42:28.883
Log File

!Example 4. Missing rows: await

Example 4. Missing rows: awaitExpectedToFail

Wrong expectation

Check didn't complete within 1000ms (poll delay 500ms, interval 1000ms) because:
 row count (table=product) expected:<3> but was:<2>
Expected:
product
idnamepricecreated_At
1Model A1.702024-08-24T16:42:28.883
2Model B2.002024-08-24T15:42:28.883
3Model C3.002024-08-24T17:42:28.883
but was:
product
idnamepricecreated_at
1Model A1.702024-08-24T16:42:28.883
2Model B2.002024-08-24T15:42:28.883
Log File

!Example 5. Wrong content

Example 5. Wrong contentExpectedToFail

Wrong expectation

table content mismatch:
"created_at" in row 1: Actual value='2024-08-24 16:42:28.883' is not equal to expected value='${test-unit.matches:within}10s|$|2024-08-24T16:42:49.351'
"created_at" in row 2: Actual value='2024-08-24 15:42:28.883' is not equal to expected value='${test-unit.matches:within}10s|$|2024-08-24T16:42:49.353'
"name" in row 1: Actual value='Model A' is not equal to expected value='${test-unit.any-number}'
"price" in row 1: Actual value='1.70' is not equal to expected value='0'
"price" in row 2: Actual value='2.00' is not equal to expected value='${test-unit.any-string}'
Expected:
product
idnamepricecreated_At
1${test-unit.any-number}Model A01.70${test-unit.matches:within}10s|$|2024-08-24T16:42:49.3512024-08-24T16:42:28.883
2Model B${test-unit.any-string}2.00${test-unit.matches:within}10s|$|2024-08-24T16:42:49.3532024-08-24T15:42:28.883
Log File

!Example 6. Wrong content: await

Example 6. Wrong content: awaitExpectedToFail

Wrong expectation

Check didn't complete within 1000ms (poll delay 0ms, interval 500ms) because:
 table content mismatch:
"created_at" in row 1: Actual value='2024-08-24 16:42:28.883' is not equal to expected value='${test-unit.matches:within}10s|$|2024-08-24T16:42:49.881'
"created_at" in row 2: Actual value='2024-08-24 15:42:28.883' is not equal to expected value='${test-unit.matches:within}10s|$|2024-08-24T16:42:49.882'
"name" in row 1: Actual value='Model A' is not equal to expected value='${test-unit.any-number}'
"price" in row 1: Actual value='1.70' is not equal to expected value='0'
"price" in row 2: Actual value='2.00' is not equal to expected value='${test-unit.any-string}'
Expected:
product
idnamepricecreated_At
1${test-unit.any-number}Model A01.70${test-unit.matches:within}10s|$|2024-08-24T16:42:49.8812024-08-24T16:42:28.883
2Model B${test-unit.any-string}2.00${test-unit.matches:within}10s|$|2024-08-24T16:42:49.8822024-08-24T15:42:28.883