decısıum

Examples

Features against real public sites. Copy one into your project and run it:

decisium run saucedemo.feature

The first run calls Jev and writes saucedemo.cassette.json next to it; after that, --record none replays it with no model calls. How to word each kind of Step is in Writing Steps.

saucedemo.feature

A shop: login, a locked-out user, sorting, the cart and checkout validation. Source

1@url:https://www.saucedemo.com/2Feature: Sauce Demo shop (login, sorting, cart, checkout validation)3  Demo credentials are listed on the login page.45  Scenario: A locked out user cannot log in6    When I try to log in as "locked_out_user" with password "secret_sauce"7    Then the error should say "Sorry, this user has been locked out."89  Scenario: Sorting by price puts the cheapest product first10    When I log in as "standard_user" with password "secret_sauce"11    And I sort the products by "Price (low to high)"12    Then the first product price should be "$7.99"1314  Scenario: The cart counts added products15    When I log in as "standard_user" with password "secret_sauce"16    And I add "Sauce Labs Backpack" to the cart17    And I put "Sauce Labs Bike Light" in the cart18    Then the cart badge should show "2"1920  Scenario: Checkout requires a first name, then completes21    When I log in as "standard_user" with password "secret_sauce"22    And I add "Sauce Labs Backpack" to the cart23    And I open the cart24    And I start the checkout25    And I try to continue without filling in the form26    Then the error should say "First Name is required"27    When I enter "Ada" as first name, "Lovelace" as last name and "10115" as postal code28    And I continue29    Then the item total should be "$29.99"30    When I finish the order31    Then I should see "Thank you for your order!"32

todomvc.feature

List state: a Background, counters, filters and absence checks scoped to the list. Source

1@url:https://demo.playwright.dev/todomvc/2Feature: TodoMVC (list state, counters, filters)34  Background:5    When I add a todo "Buy milk"6    And I add a todo "Write report"7    And I add a todo "Call mom"89  Scenario: Completing a todo updates the counter10    When I mark "Write report" as completed11    Then the counter should say "2 items left"12    And "Write report" should be checked1314  Scenario: Filters show only matching todos15    When I mark "Buy milk" as completed16    And I show only the active todos17    Then "Buy milk" should not appear in the todo list18    And "Call mom" should appear in the todo list1920  Scenario: Clearing completed todos removes them21    When I mark all todos as complete22    And I clear the completed todos23    Then "Buy milk" should not appear in the todo list24    And the todo list should be empty25

the-internet.feature

Classic widgets: checkboxes, dropdowns, and a start URL per scenario. Source

1Feature: The Internet (classic widgets)23  @url:https://the-internet.herokuapp.com/checkboxes4  Scenario: Toggle checkboxes5    When I check checkbox 16    And I uncheck checkbox 27    Then checkbox 1 should be checked8    And checkbox 2 should be unchecked910  @url:https://the-internet.herokuapp.com/dropdown11  Scenario: Pick from a dropdown12    When I select "Option 2" in the dropdown13    Then the dropdown should be "Option 2"1415  @url:https://the-internet.herokuapp.com/dynamic_loading/216  Scenario: Content that loads after a delay17    When I load the example until the greeting is shown18    Then I should see "Hello World!"1920  @url:https://the-internet.herokuapp.com/login21  Scenario: Wrong password is rejected, right one logs in22    When I try to log in as "tomsmith" with password "wrong"23    Then the message should say "Your password is invalid!"24    When I log in as "tomsmith" with password "SuperSecretPassword!"25    Then the message should say "You logged into a secure area!"2627  @url:https://the-internet.herokuapp.com/tables28  Scenario: Sorting a table by a column29    When I sort the first table by last name30    Then the first row of the first table should show "Bach"3132  @url:https://the-internet.herokuapp.com/javascript_alerts33  Scenario: A confirm dialog reports the choice34    When I open the JS confirm and cancel it35    Then the result should say "You clicked: Cancel"36

github.feature

A large live site with no login: tabs, headings and releases. Source

1@url:https://github.com/microsoft/playwright2Feature: GitHub, a real site (public pages, no login)3  Live site: cassettes replay while the recorded controls still match; changed ones heal with `--record new`.45  Scenario: Find the latest release of a repository6    When I open the releases page7    Then the page heading should be "Releases"8    And a release marked "Latest" should be shown910  Scenario: Browse issues and filter by a label11    When I open the Issues tab12    Then the "Issues" tab should be selected13    When I search the issues for "label:bug"14    Then the issue list should show only issues labelled "bug"1516  Scenario: Read a file from the repository17    When I open the "package.json" file18    Then the file content should contain "playwright-internal"19    And the "Raw" button should be shown2021  @url:https://github.com/22  Scenario: Search for a repository and open it23    When I search GitHub for "microsoft/playwright"24    And I open the "microsoft/playwright" repository from the results25    Then the repository name "playwright" should be shown26