BddWhen class

Inheritance

Constructors

BddWhen(BddFramework bdd, String text)

Properties

bdd BddFramework
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
finalinherited
variation → _Variation
finalinherited

Methods

and(String text) BddWhen
This keyword is used to extend a 'Given', 'When', or 'Then' step. It allows you to add multiple conditions or actions in the same step without having to repeat the 'Given', 'When', or 'Then' keyword. For example, "And I should see a confirmation message" could follow a 'Then' step to further specify the expected outcomes.
but(String text) BddWhen
This keyword is used similarly to "And," but it is typically used for negative conditions or to express a contrast with the previous step. It's a way to extend a "Given," "When," or "Then" step with an additional condition that contrasts with what was previously stated. For example, after a "Then" step, you might have "But I should not be logged out." This helps in creating more comprehensive scenarios by covering both what should happen and what should not happen under certain conditions.
code(CodeRun? code) → _WhenCode
keyword(BddConfig config) String
override
keywordPrefix(BddConfig config) String
override
keywordSuffix(BddConfig config) String
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
note(String text) BddWhen
Often used informally in comments within a Gherkin document to provide additional information, clarifications, or explanations about the scenario or steps. Comments in Gherkin are usually marked with a hashtag (#) and are ignored when the tests are executed. A "Note" can be useful for giving context or explaining the rationale behind a certain test scenario, making it easier for others to understand the purpose and scope of the test.
prefix(BddConfig config) String
override
run(CodeRun? code) → void
Should be used to actually provide the code that runs the BDD.
spaces(BddConfig config) String
override
suffix(BddConfig config) String
override
table(String tableName, row row1, [row? row2, row? row3, row? row4]) BddWhenTable
A table must have a name and rows. The name is necessary if you want to read the values from it later (if not, just pass an empty string). Example: ctx.table('notifications').row(0).val('read') as bool.
then(String text) BddThen
This keyword is used to describe the expected outcome or result after the 'When' step is executed. It's used to assert that a certain outcome should occur, which helps to validate whether the system behaves as expected. An example is, "Then I should be redirected to the dashboard".
toString([BddConfig config = BddConfig._default]) String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited