Skip to content
← All tools

Gherkin to Playwright

Test scenarios in plain language (for POs and QA) become automated Playwright tests (for developers).

Runs in your browser

What is this?

An acceptance test describes, in plain language, how the system should behave for the people who use it. The most common format is called Gherkin: a Feature, its Scenarios and the steps of each one, with Given (the situation), When (the action) and Then (the expected result). This tool turns that text into a Playwright test, which opens a real browser and repeats the script on its own after every change to the system.

For whoever describes (PO, QA)

Write scenarios the way you would test by hand, using the phrases in the cheat sheet so that as much as possible becomes code without help. The acceptance script stops being repeated by hand at every release and becomes documentation that runs.

For whoever automates (developer)

Get a test that compiles: the structure always comes out exact and known phrases come already implemented. Unknown ones become pending steps that fail with a clear message until you implement what they do.

Unit, integration or acceptance: what is the difference?
TypeWho writes itWhat it checks
CompilationNobody: it is automaticWhether the code is valid (types, names). It does not say whether the math is right.
UnitDeveloperOne function in isolation, no browser. E.g. the check digit of a tax ID.
IntegrationDeveloperSeveral real parts together. E.g. the API writing to the database.
Acceptance (end-to-end)PO, QA or developerThe whole system, the way a person uses it. This is what this tool generates.

The types coexist: each one catches errors the others cannot see. Many small tests at the base, few large ones at the top.

Phrases that become code

What is in quotes is your value. The first word (Given, When, Then, And) may vary.

PhraseWhat it does
Given I open the page "/path"opens the address
Given the browser prefers the language "pt"simulates a browser in another language
When I click the link "Text"clicks the link with that name
When I click the button "Text"clicks the button with that name
When I click on "Text"clicks anything with that text
When I fill in "Label" with "value"types into the field by its visible label
When I select "Option" in "Label"picks from a list
When I check "Option"ticks a checkbox (uncheck: unticks)
When I press "Enter"presses a key
Then I see the heading "Text"checks a visible heading
Then I see the text "Text"checks a visible text, exact
Then I should not see the text "Text"checks the text is not on the page
Then I am on the page "/path"checks the address
Then the page title is "Text"checks the tab title
Then the field "Label" contains "value"checks a field's value
Then the button "Text" is disabledor enabled

Generated code

By using the tools, you agree to the terms of use.