Skip to content

07 task expressions#170

Open
sisenbrothers-tech wants to merge 2 commits intovividus-framework:mainfrom
sisenbrothers-tech:07_task_Expressions
Open

07 task expressions#170
sisenbrothers-tech wants to merge 2 commits intovividus-framework:mainfrom
sisenbrothers-tech:07_task_Expressions

Conversation

@sisenbrothers-tech
Copy link
Copy Markdown

@sisenbrothers-tech sisenbrothers-tech commented Mar 9, 2026

test

Summary by CodeRabbit

  • Documentation

    • Updated guides with detailed expression-driven workflow instructions and training scenarios.
  • New Features

    • Added comprehensive training workflow including login, shopping cart operations, checkout process, and order completion verification.
    • Introduced dynamic data generation and message validation capabilities.
  • Chores

    • Updated environment and suite configurations.

@sisenbrothers-tech sisenbrothers-tech requested review from a team and GrimA9e as code owners March 9, 2026 11:49
@sisenbrothers-tech sisenbrothers-tech requested review from ikalinin1, valfirst and vkepin and removed request for a team March 9, 2026 11:49
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

📝 Walkthrough

Walkthrough

The changes introduce a new training task (Task_7.story) implementing a complete BDD test scenario using VIVIDUS expressions, along with supporting configuration updates, test data file, and README documentation revision to guide users through expression-driven testing workflows.

Changes

Cohort / File(s) Summary
Configuration & Properties
src/main/resources/properties/configuration.properties, src/main/resources/properties/suite/suite.properties, src/main/resources/properties/suite/training/suite.properties
Updated environment reference to saucedemo_Slava; added composite steps path configuration; introduced new training suite configuration pointing to story/training directory.
Test Data & Story
src/main/resources/data/message.txt, src/main/resources/story/training/Task_7.story
Added expected message resource file; created new training task story with multiple BDD scenarios including navigation, login, item checkout flow, and order completion using VIVIDUS expressions for data generation and resource loading.
Documentation
README.md
Refocused project documentation from generic test execution to detailed "How To Use Expressions" workflow with explicit scenario instructions, data generation requirements, and artifact handling steps.
Support Files
src/main/resources/steps/ui_common.steps
Added new composite steps placeholder file.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '07 task expressions' directly corresponds to the PR's main objective of adding Task 7 with expression-driven test scenarios, as evidenced by the new Task_7.story file and related configuration changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Line 41: Update the ambiguous sentence "Zip the second Allure report that
contains the comparison result…" in README.md to clarify which report is meant:
either remove "second" to read "the Allure report containing the comparison
result", or explicitly identify it (e.g., "the Allure report for Task X" or "the
second report generated after comparison") so trainees know which report to zip
and upload; change the phrase in the single line that currently contains "Zip
the second Allure report that contains the comparison result" accordingly.
- Line 35: Update the phrasing to use filesystem terminology: change
"message.txt file located in the /data package" to "message.txt file located in
the /data folder (or directory) of your test project" so the instruction for
using the #{loadResource()} VIVIDUS expression to initialize a variable is
consistent with other references; specifically edit the sentence that mentions
#{loadResource()}, message.txt, and /data to replace "package" with "folder" or
"directory".
- Line 25: Replace the typo "test fields" with "text fields" in the README
string "Populate the test fields on the /checkout-step-one.html page" so the
instruction correctly refers to form input fields; update the sentence that
currently reads "Populate the test fields on the /checkout-step-one.html page
using three different VIVIDUS expressions…" to "Populate the text fields…"
ensuring the wording change appears wherever that exact phrase ("Populate the
test fields on the /checkout-step-one.html page") exists.

In `@src/main/resources/properties/configuration.properties`:
- Line 13: configuration.environments currently contains a hardcoded
user-specific value ("saucedemo_Slava"); change it to a clear placeholder like
"saucedemo_YourSurname" (or the generic "saucedemo" if you prefer) so trainees
know to replace it, and if this file is intended as an example also update the
README to state that the property in configuration.properties must be
personalized; locate and edit the configuration.environments entry to implement
the placeholder and align README instructions accordingly.

In `@src/main/resources/story/training/Task_7.story`:
- Around line 33-34: The comparison is over-complicated by using eval on a
resource that likely contains plain text; change the initialization so that
expectedMessage is set to '#{loadResource(data/message.txt)}' and then assert
thankYouMessage equals '#{expectedMessage}' (remove the
'#{eval(expectedMessage)}' usage) unless you intentionally need runtime
expression evaluation inside the file—if so, keep '#{eval(expectedMessage)}'.
- Around line 16-17: The Examples table defines an unused column itemName;
either remove the itemName column/its header and corresponding value ("Sauce
Labs Backpack") from the Examples row, or update the scenario steps in
Task_7.story to consume it (e.g., add a step that uses <itemName> for
verification or logging such as "Then I should see the product name <itemName>
on the item page" or "And log the selected item <itemName>"); locate the
Examples table in Task_7.story and apply one of these changes so every column in
the table is referenced by a step.
- Around line 14-20: The Examples table for the "Scenario Outline: Add item to
the shopping cart" is placed before the scenario steps; move the entire
Examples: block (the header and the pipe-delimited rows for
itemName/itemPageId/addToCartButtonId) so it appears immediately after the
scenario steps (the three "When I click on the element located by id ..."
lines), ensuring the Examples: follows the steps as required by VIVIDUS/Gherkin
syntax.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 66f0a052-ad99-45a3-aaaa-5312831829c3

📥 Commits

Reviewing files that changed from the base of the PR and between 6ba759f and 8adcb0d.

📒 Files selected for processing (8)
  • README.md
  • src/main/resources/data/message.txt
  • src/main/resources/properties/configuration.properties
  • src/main/resources/properties/environment/saucedemo_Slava/environment.properties
  • src/main/resources/properties/suite/suite.properties
  • src/main/resources/properties/suite/training/suite.properties
  • src/main/resources/steps/ui_common.steps
  • src/main/resources/story/training/Task_7.story

Comment thread README.md

- a. Navigate to the shopping cart and start the checkout process. <br />

- b. Populate the test fields on the /checkout-step-one.html page using three different VIVIDUS expressions to generate the following data: a random name or surname, a random string of uppercase and lowercase letters, and a random postal code in the format ABC-12345. <br />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo: "test fields" should likely be "text fields".

The instruction mentions "Populate the test fields on the /checkout-step-one.html page" but should probably read "text fields" since it refers to form input fields.

📝 Proposed fix
-       - b. Populate the test fields on the /checkout-step-one.html page using three different VIVIDUS expressions to generate the following data: a random name or surname, a random string of uppercase and lowercase letters, and a random postal code in the format ABC-12345. <br />
+       - b. Populate the text fields on the /checkout-step-one.html page using three different VIVIDUS expressions to generate the following data: a random name or surname, a random string of uppercase and lowercase letters, and a random postal code in the format ABC-12345. <br />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- b. Populate the test fields on the /checkout-step-one.html page using three different VIVIDUS expressions to generate the following data: a random name or surname, a random string of uppercase and lowercase letters, and a random postal code in the format ABC-12345. <br />
- b. Populate the text fields on the /checkout-step-one.html page using three different VIVIDUS expressions to generate the following data: a random name or surname, a random string of uppercase and lowercase letters, and a random postal code in the format ABC-12345. <br />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 25, Replace the typo "test fields" with "text fields" in
the README string "Populate the test fields on the /checkout-step-one.html page"
so the instruction correctly refers to form input fields; update the sentence
that currently reads "Populate the test fields on the /checkout-step-one.html
page using three different VIVIDUS expressions…" to "Populate the text fields…"
ensuring the wording change appears wherever that exact phrase ("Populate the
test fields on the /checkout-step-one.html page") exists.

Comment thread README.md

- b. After clicking the Finish button on the /checkout-complete.html page, save the text of the "Thank you" message to a variable. <br />

- c. Use the #{loadResource()} VIVIDUS expression to initialize another variable that holds the contents of the message.txt file located in the /data package of your test project. <br />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Minor terminology inconsistency: "package" vs "folder/directory".

The instruction refers to the "message.txt file located in the /data package" but uses "folder" terminology elsewhere in the documentation (line 7 uses "package" for Java packages, line 9 doesn't specify). For clarity and consistency with file system terminology, consider using "data folder" or "data directory" instead of "data package" when referring to the file system location.

📝 Suggested refinement
-       - c. Use the #{loadResource()} VIVIDUS expression to initialize another variable that holds the contents of the message.txt file located in the /data package of your test project. <br />
+       - c. Use the #{loadResource()} VIVIDUS expression to initialize another variable that holds the contents of the message.txt file located in the /data folder of your test project. <br />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- c. Use the #{loadResource()} VIVIDUS expression to initialize another variable that holds the contents of the message.txt file located in the /data package of your test project. <br />
- c. Use the #{loadResource()} VIVIDUS expression to initialize another variable that holds the contents of the message.txt file located in the /data folder of your test project. <br />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 35, Update the phrasing to use filesystem terminology:
change "message.txt file located in the /data package" to "message.txt file
located in the /data folder (or directory) of your test project" so the
instruction for using the #{loadResource()} VIVIDUS expression to initialize a
variable is consistent with other references; specifically edit the sentence
that mentions #{loadResource()}, message.txt, and /data to replace "package"
with "folder" or "directory".

Comment thread README.md

1. Run the resulting story on your local machine using the configuration set in the suite.training file. If needed, you can adjust the execution scope by modifying the `overriding.properties` file. <br />

1. Zip the second Allure report that contains the comparison result, and then upload the zipped file to the designated practical task page in the course. Your mentor will review it once you submit all the tasks.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Ambiguous reference: "second Allure report".

The instruction mentions "Zip the second Allure report that contains the comparison result" but doesn't clarify what the "first" report was or why this is specifically the "second" one. This could confuse trainees who are following the instructions sequentially.

Consider clarifying with one of these approaches:

  • Remove "second" and just say "the Allure report"
  • Explain what makes this the "second" report (e.g., "second in the series of tasks")
  • Reference it by content: "the Allure report containing Task 7 results"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 41, Update the ambiguous sentence "Zip the second Allure
report that contains the comparison result…" in README.md to clarify which
report is meant: either remove "second" to read "the Allure report containing
the comparison result", or explicitly identify it (e.g., "the Allure report for
Task X" or "the second report generated after comparison") so trainees know
which report to zip and upload; change the phrase in the single line that
currently contains "Zip the second Allure report that contains the comparison
result" accordingly.

# pick up environment related properties from 'saucedemo' environment folder:

configuration.environments=saucedemo
configuration.environments=saucedemo_Slava
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistency: Hardcoded user-specific environment contradicts README instructions.

The environment name is hardcoded to saucedemo_Slava, but line 7 of the README instructs users to rename the environment package to saucedemo_{yourSurname} and update this configuration file accordingly. This creates a conflict where the configuration file already contains a specific user's surname instead of a generic template or the user's own surname.

Consider one of the following approaches:

  • Leave the environment as saucedemo (generic) so each trainee can personalize it as instructed
  • Update the README to clarify that this is an example implementation
  • Use a placeholder like saucedemo_YourSurname that makes it obvious users need to change it
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/properties/configuration.properties` at line 13,
configuration.environments currently contains a hardcoded user-specific value
("saucedemo_Slava"); change it to a clear placeholder like
"saucedemo_YourSurname" (or the generic "saucedemo" if you prefer) so trainees
know to replace it, and if this file is intended as an example also update the
README to state that the property in configuration.properties must be
personalized; locate and edit the configuration.environments entry to implement
the placeholder and align README instructions accordingly.

Comment on lines +14 to +20
Scenario Outline: Add item to the shopping cart
Examples:
| itemName | itemPageId | addToCartButtonId |
| Sauce Labs Backpack | item_4_title_link | add-to-cart-sauce-labs-backpack |
When I click on the element located by id '<itemPageId>'
And I click on the element located by id '<addToCartButtonId>'
And I click on the element located by id 'shopping_cart_container'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

VIVIDUS BDD Scenario Outline Examples placement syntax

💡 Result:

In VIVIDUS (JBehave/Gherkin stories), an Examples: table is placed directly under the last step of the Scenario Outline: (i.e., it belongs to that outline). The table is pipe-delimited, and the placeholder names used in steps match the table headers. [1]

Scenario Outline: Verify something with <data>
Given I do something with <data>
Then I get <result>

Examples:
|data |result|
|foo  |ok    |
|bar  |fail  |

VIVIDUS also supports putting meta per Examples row by adding a Meta: column in the Examples table (useful for filtering which rows execute). [2]

Scenario Outline: My scenario
...

Examples:
|Meta:            |data |
|@environment dev |foo  |
|@environment qa  |bar  |

(An “Examples table” in VIVIDUS is the standard header row + value rows structure shown above.) [3]

Sources: [1] JBehave “Story Syntax” (Gherkin Scenario Outline + Examples placement) (jbehave.org), [2] VIVIDUS “Tests Configuration” (Examples row meta / filtering) (docs.vividus.dev), [3] VIVIDUS Glossary “ExamplesTable” (docs.vividus.dev)

Citations:


Scenario Outline Examples must be placed after the scenario steps.

In VIVIDUS (based on Gherkin/JBehave), the Examples: table should appear directly after the scenario steps, not before. The current structure has Examples on lines 15-17 before the steps on lines 18-20, which violates the syntax specification.

🔧 Move Examples after steps
 Scenario Outline: Add item to the shopping cart
-Examples:
-| itemName               | itemPageId           | addToCartButtonId                 |
-| Sauce Labs Backpack    | item_4_title_link    | add-to-cart-sauce-labs-backpack   |
 When I click on the element located by id '<itemPageId>'
 And I click on the element located by id '<addToCartButtonId>'
 And I click on the element located by id 'shopping_cart_container'
+Examples:
+| itemName               | itemPageId           | addToCartButtonId                 |
+| Sauce Labs Backpack    | item_4_title_link    | add-to-cart-sauce-labs-backpack   |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Scenario Outline: Add item to the shopping cart
Examples:
| itemName | itemPageId | addToCartButtonId |
| Sauce Labs Backpack | item_4_title_link | add-to-cart-sauce-labs-backpack |
When I click on the element located by id '<itemPageId>'
And I click on the element located by id '<addToCartButtonId>'
And I click on the element located by id 'shopping_cart_container'
Scenario Outline: Add item to the shopping cart
When I click on the element located by id '<itemPageId>'
And I click on the element located by id '<addToCartButtonId>'
And I click on the element located by id 'shopping_cart_container'
Examples:
| itemName | itemPageId | addToCartButtonId |
| Sauce Labs Backpack | item_4_title_link | add-to-cart-sauce-labs-backpack |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/training/Task_7.story` around lines 14 - 20, The
Examples table for the "Scenario Outline: Add item to the shopping cart" is
placed before the scenario steps; move the entire Examples: block (the header
and the pipe-delimited rows for itemName/itemPageId/addToCartButtonId) so it
appears immediately after the scenario steps (the three "When I click on the
element located by id ..." lines), ensuring the Examples: follows the steps as
required by VIVIDUS/Gherkin syntax.

Comment on lines +16 to +17
| itemName | itemPageId | addToCartButtonId |
| Sauce Labs Backpack | item_4_title_link | add-to-cart-sauce-labs-backpack |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Unused column itemName in Examples table.

The itemName column is defined in the Examples table but is never referenced in the scenario steps using <itemName>. Consider removing it if not needed, or adding a step that uses it (e.g., for verification or logging purposes).

♻️ Option 1: Remove unused column
 Examples:
-| itemName               | itemPageId           | addToCartButtonId                 |
-| Sauce Labs Backpack    | item_4_title_link    | add-to-cart-sauce-labs-backpack   |
+| itemPageId           | addToCartButtonId                 |
+| item_4_title_link    | add-to-cart-sauce-labs-backpack   |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| itemName | itemPageId | addToCartButtonId |
| Sauce Labs Backpack | item_4_title_link | add-to-cart-sauce-labs-backpack |
| itemPageId | addToCartButtonId |
| item_4_title_link | add-to-cart-sauce-labs-backpack |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/training/Task_7.story` around lines 16 - 17, The
Examples table defines an unused column itemName; either remove the itemName
column/its header and corresponding value ("Sauce Labs Backpack") from the
Examples row, or update the scenario steps in Task_7.story to consume it (e.g.,
add a step that uses <itemName> for verification or logging such as "Then I
should see the product name <itemName> on the item page" or "And log the
selected item <itemName>"); locate the Examples table in Task_7.story and apply
one of these changes so every column in the table is referenced by a step.

Comment on lines +33 to +34
And I initialize the variable 'expectedMessage' with the value '#{loadResource(data/message.txt)}'
Then the variable 'thankYouMessage' is equal to '#{eval(expectedMessage)}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider simplifying the expected message comparison.

If data/message.txt contains only plain text ("Thank you for your order!"), the #{eval(expectedMessage)} wrapper may be unnecessary. The eval expression is typically used when the loaded resource itself contains VIVIDUS expressions that need evaluation.

If the file contains no expressions, you could simplify the assertion:

-Then the variable 'thankYouMessage' is equal to '#{eval(expectedMessage)}'
+Then the variable 'thankYouMessage' is equal to '${expectedMessage}'

However, if the intent is to support dynamic expressions in the message file in the future, the current approach provides flexibility.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
And I initialize the variable 'expectedMessage' with the value '#{loadResource(data/message.txt)}'
Then the variable 'thankYouMessage' is equal to '#{eval(expectedMessage)}'
And I initialize the variable 'expectedMessage' with the value '#{loadResource(data/message.txt)}'
Then the variable 'thankYouMessage' is equal to '${expectedMessage}'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/training/Task_7.story` around lines 33 - 34, The
comparison is over-complicated by using eval on a resource that likely contains
plain text; change the initialization so that expectedMessage is set to
'#{loadResource(data/message.txt)}' and then assert thankYouMessage equals
'#{expectedMessage}' (remove the '#{eval(expectedMessage)}' usage) unless you
intentionally need runtime expression evaluation inside the file—if so, keep
'#{eval(expectedMessage)}'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants