-
Notifications
You must be signed in to change notification settings - Fork 1
test: playwright cucumber setup #454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dc6d400
e9062b1
6a524f7
5bb625d
4004a8a
d2b564d
6c97779
fd17063
f195111
ae0d8a7
69e5750
65a24df
9c22095
3edd445
dd18155
a7e3b1b
f0a2b5c
4769a96
bbb00de
06a398a
051336b
b3125f6
1968a49
7637a84
01353cc
db2969f
b545fc7
65b48d4
9dafdd1
78bc781
fbf2563
a173f53
4c6c051
6e86b81
24c2b21
f5be6b8
ec1b5c8
323c3c2
cf006f4
a1a481b
90c9445
5ac4344
55722f2
8e14b6d
605803d
636ea8b
0a7a4ab
547c5db
4269040
ae391bd
e40fbc0
68b3831
5c6b7c6
29c040b
fc2f684
dab8db0
a8f81f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| /** @type {Partial<import('@cucumber/cucumber').IConfiguration>} */ | ||
| module.exports = { | ||
| default: { | ||
| paths: ['tests/features/**/*.feature'], | ||
| require: [ | ||
| 'tests/support/**/*.js', | ||
| 'tests/step-definitions/**/*.js', | ||
| ], | ||
| // Use 'pretty' locally for readable step-by-step output. | ||
| // On CI keep the output minimal to avoid noisy logs. | ||
| format: ['progress', 'summary'], | ||
| retry: 2, // Retry failed scenarios twice | ||
| parallel: 2, // Run scenarios in parallel workers | ||
| publishQuiet: true, // Hide the default Cucumber report publishing link (we check on Github actions) | ||
| }, | ||
| }; | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| @address-validation | ||
| Feature: Address validation | ||
|
|
||
| Background: | ||
| Given I am on the local Giftaid page | ||
| And I select the local Giftaid option | ||
| And I enter the local supporter details | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing that stands out to me, having each of these test scenarios now written in a natural language style, is the importance of making sure that the language chosen is clear and unambiguous. From a technical side, I'm guessing each step name can be pretty much any string, so long as it's unique, as in any other test runner. So two questions really on that point:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point @seb-cr, On the first point: I did try removing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the second point: I mostly followed what the Cucumber docs mention around step organisation here: https://cucumber.io/docs/gherkin/step-organization/ So far, I’ve removed duplicate/ambiguous step definitions and moved common ones into shared files. I’ve also only kept steps that are actually used in feature files and added reusable scenario outlines for repeated validation cases. As Giftaid is a fairly small app, I haven't run into many issues yet, apart from the local/staging overlap mentioned above. But, as and when I work on |
||
|
|
||
| Scenario: Empty postcode should show an error message | ||
| When I clear the local postcode field | ||
| And I submit the local Giftaid form | ||
| Then I should see the local postcode error message "Please enter your postcode" | ||
|
|
||
| Scenario Outline: Invalid postcodes should show error messages | ||
| When I enter the local postcode "<postcode>" | ||
| Then I should see the local postcode error message "<message>" | ||
|
|
||
| Examples: | ||
| | postcode | message | | ||
| | 12SE17TP | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. | | ||
| | comic relief | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. | | ||
| | cro 7tp | Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below. | | ||
|
|
||
| Scenario: Entering a postcode without selecting an address should show an error message | ||
| When I enter the local postcode "E1 8QS" | ||
| And I search for the local postcode | ||
| Then I should see the local address dropdown | ||
| When I submit the local Giftaid form | ||
| Then I should see the local address select error message "Please select your address" | ||
|
|
||
| Scenario: Clicking the manual address link should show the address fields | ||
| When I enter the local postcode "E1 8QS" | ||
| Then I should see the local manual address link | ||
| When I click the local manual address link | ||
| Then I should see the local manual address fields | ||
|
|
||
| Scenario: Invalid address fields should show error messages | ||
| When I enter the local postcode "E1 8QS" | ||
| And I click the local manual address link | ||
| And I enter the local invalid address line 1 | ||
| Then I should see the local address line 1 error message | ||
| When I enter the local invalid town | ||
| Then I should see the local town error message | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cucumber provides a type for its configuration. I suggest we make use of it for IntelliSense purposes: