Skip to content

Completed Playwright and Cucumber take home - #266

Open
romanedorrel wants to merge 1 commit into
automationExamples:mainfrom
romanedorrel:feat/rd-cucumber-take-home
Open

Completed Playwright and Cucumber take home#266
romanedorrel wants to merge 1 commit into
automationExamples:mainfrom
romanedorrel:feat/rd-cucumber-take-home

Conversation

@romanedorrel

Copy link
Copy Markdown

Playwright Cucumber Exercise

Description

Completed the Playwright/Cucumber take-home exercise by resolving the existing failing test, implementing the missing test scenarios, and adding additional test coverage for the login and purchase flows.

Playwright was updated to a compatible version and the required browser binaries were reinstalled.

Additions

  • Added validation for the locked-out user login error message:
    • Epic sadface: Sorry, this user has been locked out.
  • Added product sorting tests for:
    • Price (low to high)
    • Price (high to low)
  • Added validation that all six products are correctly ordered after sorting.
  • Completed the purchase workflow:
    • Add backpack to cart
    • Open cart
    • Select checkout
    • Enter checkout information
    • Continue checkout
    • Finish purchase
    • Validate Thank you for your order!
  • Added cart badge validation to confirm the expected number of items is displayed.
  • Added successful login validation to confirm the user is redirected to the products page.

Updated

  • Updated Playwright and its Chromium browser dependency to resolve compatibility issues with the existing project setup.
  • Corrected the existing login page title test from the incorrect expected value to:
    • Swag Labs
  • Added and updated Page Object Model methods for login, product sorting, cart, checkout, and purchase validation.

Initial Compatibility Issue

The repository initially used an older Playwright version with Chromium 1091. Although the Chromium executable was confirmed to be an arm64 binary, Chromium crashed during startup on the current macOS/Apple Silicon environment with a SEGV_ACCERR signal.

The failure occurred before any test scenario could execute, resulting in:

Target page, context or browser has been closed

To resolve the issue, Playwright was updated and its browser dependencies were reinstalled. The updated installation allowed the browser to launch successfully.

How to Test

Install project dependencies:

npm install

Install the Playwright browser dependencies if needed:

npx playwright install

Run the complete Cucumber test suite:

npm run test

Result

All implemented scenarios now execute successfully.

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.

1 participant