Skip to content

Task 1 - Add Product to Cart#271

Closed
Eugeniya1981 wants to merge 5 commits intovividus-framework:mainfrom
GrimMa9e:branch-my-one
Closed

Task 1 - Add Product to Cart#271
Eugeniya1981 wants to merge 5 commits intovividus-framework:mainfrom
GrimMa9e:branch-my-one

Conversation

@Eugeniya1981
Copy link
Copy Markdown

@Eugeniya1981 Eugeniya1981 commented Apr 24, 2026

Create a test story for the test cases below. Use credentials from "\src\main\resources\overriding.properties".

The scenario is:
Log in
Open details page for Bolt T-Shirt
Verify details page is displayed
Click Add to cart
Verify button changes to Remove
Verify cart badge shows 1
Open cart
Verify Bolt T-Shirt is present in cart

Summary by CodeRabbit

  • Tests

    • Added new test scenarios covering product checkout workflows and user authentication.
    • Updated test automation framework with refined validation and page verification requirements.
  • Chores

    • Updated test platform dependency version.
    • Enhanced test environment configuration with timeout settings and browser profile specifications.

@Eugeniya1981 Eugeniya1981 requested a review from a team as a code owner April 24, 2026 10:56
@Eugeniya1981 Eugeniya1981 requested review from ikalinin1, valfirst and vkepin and removed request for a team April 24, 2026 10:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

📝 Walkthrough

Walkthrough

Updates VIVIDUS web test skill documentation to enforce story-only output with stricter validation rules. Bumps VIVIDUS BOM to 0.6.18-SNAPSHOT. Adds web-sauce configuration profile, environment properties for UI timeouts, and new web app test stories covering login and cart operations while removing legacy test scenario.

Changes

Cohort / File(s) Summary
Skill Documentation
.github/skills/generate-vividus-web-tests/SKILL.md
Eliminates coverage/summary report generation requirements; enforces no-Playwright policy requiring user choice when locators unverified; removes visual-baseline rules and replaces with explicit text assertions; mandates page verification via ${current-page-url} regex matching; requires two-step navigation synchronization; changes output paths to src/main/resources/story/web_app/[TestName].story and mandates gradlew.bat spotlessApply formatting; bans creation of summary/coverage artifacts.
Build Configuration
build.gradle
Updates VIVIDUS BOM dependency from version 0.6.17 to 0.6.18-SNAPSHOT.
Property Configuration
src/main/resources/properties/configuration.properties, src/main/resources/properties/environment/environment.properties, src/main/resources/properties/environment/sauce/environment.properties, src/main/resources/properties/profile/web/headless/chrome/1920x1080/profile.properties
Adds web-sauce configuration set with profile (web/headless/chrome/1920x1080), suite (web_app), and environment (sauce); introduces ISO-8601 duration properties for search element and general UI wait timeouts; defines Sauce environment main page URL and step definition glob path; configures headless Chrome window size (1920×1080) and password manager leak detection preferences.
Composite Steps
src/main/resources/steps/web/login.steps
Introduces login composite step sequence: visits main page, fills username/password fields via locators, submits via login button, verifies react burger menu present exactly once.
Test Stories
src/main/resources/story/web_app/Add Bolt T-Shirt to Cart.story, src/main/resources/story/web_app/Add Product to Cart.story, src/main/resources/story/web_app/Login & Logout.story
Adds three new web app test scenarios: "Add Bolt T-Shirt to Cart" verifies inventory page, adds item, confirms cart badge updates; "Add Product to Cart" performs login, navigates product details, adds to cart, verifies badge and navigates to cart; "Login & Logout" covers login with parameterized credentials and logout with burger menu.
Story Removal
src/main/resources/story/web_app/Web application.story
Removes legacy story defining login flow with text-based username/password field matching and success assertion.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Task 1 - Add Product to Cart' directly matches the main objective of the pull request, which is to create a test story for adding a product to cart following the specified scenario steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/skills/generate-vividus-web-tests/SKILL.md (1)

144-323: 🧹 Nitpick | 🔵 Trivial

Consider running spotlessApply to fix markdown formatting.

Static analysis detected several markdown formatting issues (missing blank lines around fenced code blocks, headings, and tables). As documented in lines 320-323, these can be auto-fixed by running:

gradlew.bat spotlessApply
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/skills/generate-vividus-web-tests/SKILL.md around lines 144 - 323,
The markdown in the "Fix Formatting Violations" / Step 5 sections has missing
blank lines around fenced code blocks, headings and tables; run the formatter by
executing the Gradle task (gradlew.bat spotlessApply) as suggested, re-open and
verify the fenced blocks and headings are separated by blank lines (the sections
referencing the spotlessApply command and code fences), then commit the
resulting SKILL.md changes so the markdown formatting issues are auto-fixed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@build.gradle`:
- Line 9: Replace the snapshot dependency string
"org.vividus:vividus-bom:0.6.18-SNAPSHOT" with the stable release
"org.vividus:vividus-bom:0.6.17" in the implementation platform declaration, or
if the SNAPSHOT is intentional, add an inline comment next to the implementation
platform('org.vividus:vividus-bom:0.6.18-SNAPSHOT') entry explaining why the
pre-release is required for this sample (e.g., to demonstrate an unreleased
feature), so readers know the choice is deliberate.

In `@src/main/resources/story/web_app/Add` Bolt T-Shirt to Cart.story:
- Line 12: The two stories use inconsistent locators for the shopping cart
badge: in Add Product to Cart.story the element name 'shopping_cart_badge' is
used, while Add Bolt T-Shirt to Cart.story uses
cssSelector([data-test="shopping-cart-badge"]); update Add Bolt T-Shirt to
Cart.story to use the same locator strategy as the other story (preferably
replace cssSelector([data-test="shopping-cart-badge"]) with the element name
'shopping_cart_badge') so both stories reference the identical symbol and
locator approach for the shopping cart badge.

In `@src/main/resources/story/web_app/Add` Product to Cart.story:
- Around line 15-16: After the wait-for-element step that uses
id(back-to-products) and the text assertion for "Sauce Labs Bolt T-Shirt", add a
URL verification step to enforce the required navigation check; specifically,
after the When I wait until element located by `id(back-to-products)` appears
and/or after the Then text `Sauce Labs Bolt T-Shirt` exists, insert a step using
Then `<current-page-url>` matches `<regex>` (choose the regex that matches the
product details page URL pattern for this product) so the flow includes both the
element sync and a page-unique URL assertion.
- Line 22: The step "When I wait until element located by `id(remove)` appears"
should be changed to an assertion step because the "remove" element is a
same-page state change after clicking the "add-to-cart" control; replace the
wait with an assertion such as using a Then step that checks visibility/presence
of the element located by id(remove) (refer to the "add-to-cart" click step and
the element id(remove) in the story) so the test verifies state rather than
performing an explicit wait.
- Line 31: After the step that waits for the page element
caseInsensitiveText(Your Cart) to appear, add a URL assertion step to verify
navigation to the cart page; specifically insert a step using the
current-page-url matcher (Then `${current-page-url}` matches `<regex>`)
immediately after the wait step and use a regex that matches your cart route
(eg. /cart or /checkout/cart as appropriate) so the story both syncs on a unique
element and validates the URL.
- Around line 7-30: Remove the eight prohibited step-descriptive comments that
start with "!-- Step" (e.g., "!-- Step 1: Log in", "!-- Step 2: Open details
page for Bolt T-Shirt", etc.) and leave the executable steps intact (the
When/Then lines such as the login step "When I login to web app...", the
waits/clicks using selectors like
`cssSelector([data-test="item-1-title-link"])`, `id(back-to-products)`,
`id(add-to-cart)`, `id(remove)`, and the cart verification `Then an element with
the name 'shopping_cart_badge' and text '1' exists`); do not remove or alter any
allowed `!--` comments that are `[MISSING STEP]`, `[ASSUMPTION]`, or
`[DISCREPANCY]` markers—only delete the "Step X" descriptive comment lines.

---

Outside diff comments:
In @.github/skills/generate-vividus-web-tests/SKILL.md:
- Around line 144-323: The markdown in the "Fix Formatting Violations" / Step 5
sections has missing blank lines around fenced code blocks, headings and tables;
run the formatter by executing the Gradle task (gradlew.bat spotlessApply) as
suggested, re-open and verify the fenced blocks and headings are separated by
blank lines (the sections referencing the spotlessApply command and code
fences), then commit the resulting SKILL.md changes so the markdown formatting
issues are auto-fixed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 01ee930d-ac28-4e52-8ddb-c758ee6dbb12

📥 Commits

Reviewing files that changed from the base of the PR and between d97ac03 and c346261.

📒 Files selected for processing (11)
  • .github/skills/generate-vividus-web-tests/SKILL.md
  • build.gradle
  • src/main/resources/properties/configuration.properties
  • src/main/resources/properties/environment/environment.properties
  • src/main/resources/properties/environment/sauce/environment.properties
  • src/main/resources/properties/profile/web/headless/chrome/1920x1080/profile.properties
  • src/main/resources/steps/web/login.steps
  • src/main/resources/story/web_app/Add Bolt T-Shirt to Cart.story
  • src/main/resources/story/web_app/Add Product to Cart.story
  • src/main/resources/story/web_app/Login & Logout.story
  • src/main/resources/story/web_app/Web application.story
💤 Files with no reviewable changes (1)
  • src/main/resources/story/web_app/Web application.story

Comment thread build.gradle

dependencies {
implementation platform('org.vividus:vividus-bom:0.6.17')
implementation platform('org.vividus:vividus-bom:0.6.18-SNAPSHOT')
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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if VIVIDUS 0.6.18-SNAPSHOT is published and verify available stable versions

echo "Checking Maven Central for VIVIDUS BOM versions..."
curl -s "https://search.maven.org/solrsearch/select?q=g:org.vividus+AND+a:vividus-bom&rows=20&wt=json" | jq -r '.response.docs[] | .v' | head -10

echo -e "\nChecking if 0.6.18-SNAPSHOT might be available in snapshot repository..."
curl -s "https://oss.sonatype.org/content/repositories/snapshots/org/vividus/vividus-bom/" | grep -o '0\.6\.[0-9]*-SNAPSHOT' | sort -u | tail -5

Repository: vividus-framework/vividus-sample-tests

Length of output: 207


🏁 Script executed:

cat -n build.gradle

Repository: vividus-framework/vividus-sample-tests

Length of output: 934


🌐 Web query:

VIVIDUS BOM version 0.6.18 stable release available

💡 Result:

No, there is no stable release of VIVIDUS BOM version 0.6.18 available as of 2026-04-24. The official VIVIDUS GitHub releases page lists the latest stable release as 0.6.17 (2026-03-20). A 0.6.18-SNAPSHOT version exists for various packages (e.g., vividus-util, vividus-plugin-web-app, vividus-to-xray-exporter), published on GitHub Packages around March 23, 2026, indicating ongoing development toward a future stable 0.6.18 release. Official documentation references 0.6.16-SNAPSHOT in examples, and no Maven repository or release notes confirm a stable 0.6.18 BOM.

Citations:


🏁 Script executed:

#!/bin/bash
# Try alternative methods to check VIVIDUS versions
echo "Attempting to fetch Maven metadata directly..."

# Try Maven Central metadata
echo "=== Maven Central Metadata ==="
curl -s "https://repo1.maven.org/maven2/org/vividus/vividus-bom/maven-metadata.xml" | grep -oP '(?<=<version>)[^<]+' | tail -10

echo -e "\n=== Snapshot Repository Metadata ==="
# Try snapshot repository
curl -s "https://oss.sonatype.org/content/repositories/snapshots/org/vividus/vividus-bom/maven-metadata.xml" | grep -oP '(?<=<version>)[^<]+' | tail -10

Repository: vividus-framework/vividus-sample-tests

Length of output: 198


Consider using stable release version 0.6.17 instead of snapshot for sample code.

The dependency currently uses 0.6.18-SNAPSHOT, which is a pre-release version under active development. While the latest stable release 0.6.17 was published recently (March 2026) and is available, sample projects are typically better served by stable versions unless demonstrating unreleased features.

If the snapshot is intentionally chosen to showcase upcoming features, add a comment explaining the reason.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@build.gradle` at line 9, Replace the snapshot dependency string
"org.vividus:vividus-bom:0.6.18-SNAPSHOT" with the stable release
"org.vividus:vividus-bom:0.6.17" in the implementation platform declaration, or
if the SNAPSHOT is intentional, add an inline comment next to the implementation
platform('org.vividus:vividus-bom:0.6.18-SNAPSHOT') entry explaining why the
pre-release is required for this sample (e.g., to demonstrate an unreleased
feature), so readers know the choice is deliberate.

Then `${current-page-url}` matches `.+/inventory-item\.html\?id=1`
When I click on element located by `id(add-to-cart)`
Then number of elements found by `id(remove)` is equal to `1`
When I save text of element located by `cssSelector([data-test="shopping-cart-badge"])` to scenario variable `cartBadgeText`
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

🏁 Script executed:

#!/bin/bash
# Description: Find all references to shopping cart badge across story files

echo "=== Searching for shopping cart badge references in story files ==="
rg -n -C2 "shopping.*cart.*badge" --type-add 'story:*.story' --type story src/main/resources/story/

echo -e "\n=== Checking for element registry definitions ==="
fd -e xml -e properties . src/main/resources/ --exec rg -l "shopping.*cart.*badge" {}

Repository: vividus-framework/vividus-sample-tests

Length of output: 1346


Standardize shopping cart badge locator strategy across stories.

Two story files reference the shopping cart badge element using different locator strategies:

  • Add Product to Cart.story (line 25): Uses element name 'shopping_cart_badge'
  • Add Bolt T-Shirt to Cart.story (line 12): Uses cssSelector([data-test="shopping-cart-badge"])

Inconsistent locators reduce maintainability and can cause issues if locators change. Choose one consistent approach:

  1. Use element names throughout (preferred for maintainability), or
  2. Use the same cssSelector pattern in both stories.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/web_app/Add` Bolt T-Shirt to Cart.story at line 12,
The two stories use inconsistent locators for the shopping cart badge: in Add
Product to Cart.story the element name 'shopping_cart_badge' is used, while Add
Bolt T-Shirt to Cart.story uses cssSelector([data-test="shopping-cart-badge"]);
update Add Bolt T-Shirt to Cart.story to use the same locator strategy as the
other story (preferably replace cssSelector([data-test="shopping-cart-badge"])
with the element name 'shopping_cart_badge') so both stories reference the
identical symbol and locator approach for the shopping cart badge.

Comment on lines +7 to +30
!-- Step 1: Log in
When I login to web app with username `${username}` and password `${password}`

!-- Step 2: Open details page for Bolt T-Shirt
When I wait until element located by `cssSelector([data-test="item-1-title-link"])` appears
When I click on element located by `cssSelector([data-test="item-1-title-link"])`

!-- Step 3: Verify details page is displayed
When I wait until element located by `id(back-to-products)` appears
Then text `Sauce Labs Bolt T-Shirt` exists

!-- Step 4: Click Add to cart
When I click on element located by `id(add-to-cart)`

!-- Step 5: Verify button changes to Remove
When I wait until element located by `id(remove)` appears

!-- Step 6: Verify cart badge shows 1
Then an element with the name 'shopping_cart_badge' and text '1' exists

!-- Step 7: Open cart
When I click on element located by `cssSelector([data-test="shopping-cart-link"])`

!-- Step 8: Verify Bolt T-Shirt is present in cart
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 | 🟠 Major

Remove step-by-step descriptive comments.

The story contains eight sequential comments (!-- Step 1:, !-- Step 2:, etc.) that describe what each step does. These violate the project's coding guidelines. As per coding guidelines: "Do NOT add !-- comments before each step describing what it does (e.g., !-- Step 1: Log in). Only use !-- comments for [MISSING STEP], [ASSUMPTION], or [DISCREPANCY] markers."

🧹 Proposed fix to remove prohibited comments
 Scenario: Add Bolt T-Shirt to cart and verify it appears in cart
 
-!-- Step 1: Log in
 When I login to web app with username `${username}` and password `${password}`
 
-!-- Step 2: Open details page for Bolt T-Shirt
 When I wait until element located by `cssSelector([data-test="item-1-title-link"])` appears
 When I click on element located by `cssSelector([data-test="item-1-title-link"])`
 
-!-- Step 3: Verify details page is displayed
 When I wait until element located by `id(back-to-products)` appears
 Then text `Sauce Labs Bolt T-Shirt` exists
 
-!-- Step 4: Click Add to cart
 When I click on element located by `id(add-to-cart)`
 
-!-- Step 5: Verify button changes to Remove
 When I wait until element located by `id(remove)` appears
 
-!-- Step 6: Verify cart badge shows 1
 Then an element with the name 'shopping_cart_badge' and text '1' exists
 
-!-- Step 7: Open cart
 When I click on element located by `cssSelector([data-test="shopping-cart-link"])`
 
-!-- Step 8: Verify Bolt T-Shirt is present in cart
 When I wait until element located by `caseInsensitiveText(Your Cart)` appears
 Then text `Sauce Labs Bolt T-Shirt` exists
📝 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
!-- Step 1: Log in
When I login to web app with username `${username}` and password `${password}`
!-- Step 2: Open details page for Bolt T-Shirt
When I wait until element located by `cssSelector([data-test="item-1-title-link"])` appears
When I click on element located by `cssSelector([data-test="item-1-title-link"])`
!-- Step 3: Verify details page is displayed
When I wait until element located by `id(back-to-products)` appears
Then text `Sauce Labs Bolt T-Shirt` exists
!-- Step 4: Click Add to cart
When I click on element located by `id(add-to-cart)`
!-- Step 5: Verify button changes to Remove
When I wait until element located by `id(remove)` appears
!-- Step 6: Verify cart badge shows 1
Then an element with the name 'shopping_cart_badge' and text '1' exists
!-- Step 7: Open cart
When I click on element located by `cssSelector([data-test="shopping-cart-link"])`
!-- Step 8: Verify Bolt T-Shirt is present in cart
Scenario: Add Bolt T-Shirt to cart and verify it appears in cart
When I login to web app with username `${username}` and password `${password}`
When I wait until element located by `cssSelector([data-test="item-1-title-link"])` appears
When I click on element located by `cssSelector([data-test="item-1-title-link"])`
When I wait until element located by `id(back-to-products)` appears
Then text `Sauce Labs Bolt T-Shirt` exists
When I click on element located by `id(add-to-cart)`
When I wait until element located by `id(remove)` appears
Then an element with the name 'shopping_cart_badge' and text '1' exists
When I click on element located by `cssSelector([data-test="shopping-cart-link"])`
When I wait until element located by `caseInsensitiveText(Your Cart)` appears
Then text `Sauce Labs Bolt T-Shirt` exists
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/web_app/Add` Product to Cart.story around lines 7 -
30, Remove the eight prohibited step-descriptive comments that start with "!--
Step" (e.g., "!-- Step 1: Log in", "!-- Step 2: Open details page for Bolt
T-Shirt", etc.) and leave the executable steps intact (the When/Then lines such
as the login step "When I login to web app...", the waits/clicks using selectors
like `cssSelector([data-test="item-1-title-link"])`, `id(back-to-products)`,
`id(add-to-cart)`, `id(remove)`, and the cart verification `Then an element with
the name 'shopping_cart_badge' and text '1' exists`); do not remove or alter any
allowed `!--` comments that are `[MISSING STEP]`, `[ASSUMPTION]`, or
`[DISCREPANCY]` markers—only delete the "Step X" descriptive comment lines.

Comment on lines +15 to +16
When I wait until element located by `id(back-to-products)` appears
Then text `Sauce Labs Bolt T-Shirt` exists
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 | 🟠 Major

Add mandatory URL verification after navigation.

After navigating to the product details page, the code waits for an element but does not verify the URL. As per coding guidelines: "After navigating to a new page, synchronize using When I wait until element located by \` appearsfollowed by a URL check withThen `${current-page-url}` matches ```."

🔗 Proposed fix to add URL verification
 When I wait until element located by `id(back-to-products)` appears
+Then `${current-page-url}` matches `.+/inventory-item\.html\?id=1`
 Then text `Sauce Labs Bolt T-Shirt` exists
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/web_app/Add` Product to Cart.story around lines 15 -
16, After the wait-for-element step that uses id(back-to-products) and the text
assertion for "Sauce Labs Bolt T-Shirt", add a URL verification step to enforce
the required navigation check; specifically, after the When I wait until element
located by `id(back-to-products)` appears and/or after the Then text `Sauce Labs
Bolt T-Shirt` exists, insert a step using Then `<current-page-url>` matches
`<regex>` (choose the regex that matches the product details page URL pattern
for this product) so the flow includes both the element sync and a page-unique
URL assertion.

When I click on element located by `id(add-to-cart)`

!-- Step 5: Verify button changes to Remove
When I wait until element located by `id(remove)` appears
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 | 🟠 Major

Replace wait with assertion for same-page verification.

After clicking the "add-to-cart" button, the code waits for the "remove" element to appear. Since this is a state change on the same page (not a navigation), a Then assertion should be used instead of When I wait. As per coding guidelines: "wait used as verification on an already-loaded page (use assertion instead)".

✅ Proposed fix to use assertion instead of wait
 When I click on element located by `id(add-to-cart)`
 
-When I wait until element located by `id(remove)` appears
+Then number of elements found by `id(remove)` is equal to `1`
 
 Then an element with the name 'shopping_cart_badge' and text '1' exists
📝 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
When I wait until element located by `id(remove)` appears
Then number of elements found by `id(remove)` is equal to `1`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/web_app/Add` Product to Cart.story at line 22, The
step "When I wait until element located by `id(remove)` appears" should be
changed to an assertion step because the "remove" element is a same-page state
change after clicking the "add-to-cart" control; replace the wait with an
assertion such as using a Then step that checks visibility/presence of the
element located by id(remove) (refer to the "add-to-cart" click step and the
element id(remove) in the story) so the test verifies state rather than
performing an explicit wait.

When I click on element located by `cssSelector([data-test="shopping-cart-link"])`

!-- Step 8: Verify Bolt T-Shirt is present in cart
When I wait until element located by `caseInsensitiveText(Your Cart)` appears
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 | 🟠 Major

Add mandatory URL verification after navigation to cart.

After clicking the shopping cart link, the code waits for a page element but does not verify the URL. As per coding guidelines: "After navigating to a new page, synchronize using When I wait until element located by \` appearsfollowed by a URL check withThen `${current-page-url}` matches ```."

🔗 Proposed fix to add URL verification
 When I wait until element located by `caseInsensitiveText(Your Cart)` appears
+Then `${current-page-url}` matches `.+/cart\.html`
 Then text `Sauce Labs Bolt T-Shirt` exists
📝 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
When I wait until element located by `caseInsensitiveText(Your Cart)` appears
When I wait until element located by `caseInsensitiveText(Your Cart)` appears
Then `${current-page-url}` matches `.+/cart\.html`
Then text `Sauce Labs Bolt T-Shirt` exists
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/story/web_app/Add` Product to Cart.story at line 31, After
the step that waits for the page element caseInsensitiveText(Your Cart) to
appear, add a URL assertion step to verify navigation to the cart page;
specifically insert a step using the current-page-url matcher (Then
`${current-page-url}` matches `<regex>`) immediately after the wait step and use
a regex that matches your cart route (eg. /cart or /checkout/cart as
appropriate) so the story both syncs on a unique element and validates the URL.

@Eugeniya1981
Copy link
Copy Markdown
Author

a mistake

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