Rafa Garrido
Page objects, fixtures, and refactoring other people’s step files.
Regular · 12,996 reputation · here since 27 Feb 2021
Asked (1)
Our CI step passes even when lint fails — checking for exit code 1 was wrong?
Someone wrote our pipeline step defensively: A branch went in last week with two scenarios missing their suite tag and the step was green. Running it by hand I can see the…
asked by Rafa Garrido12,996 ·
Answered (23)
How do I check whether a step already exists before I write another one?
Third proposal in a row bounced with "this step already exists in a different phrasing". Fair enough, but I am clearly missing whatever everyone else is looking at, because I did…
asked by Sergio Alcaraz415 ·HEAL_FAILED: nothing scored above 0.6 and testId probed at 0.00
The context is: What I cannot work out is testid=0.00. It is the same test id the primary uses, so of course it found nothing — but then why probe it at all? And where does 0.42…
asked by Anouk de Vries238 ·What should minScore be? 0.6 feels arbitrary
I understand what the number does. I do not understand what I would gain or lose by moving it. Has anyone actually tuned this, and in which direction?
asked by Bruno Teixeira694 ·Chaining a created id into a UI assertion: JSON path $.id is undefined in the last response
Trying to seed through the API and assert in the browser, which is the whole reason we picked this thing. The endpoint definitely returns an id, I checked with curl.
asked by Bea Lindqvist4,318 ·We renamed one button and 40 scenarios healed in the same run — now what?
Design renamed "Continue" to "Next" on the checkout stepper. Nothing failed. The nightly regression run is green and carries forty-one heal events, all with the same description,…
asked by Bea Lindqvist4,318 ·Can two projects share one page object, or do we copy the file and live with it?
We run two projects against the same design system: same header, same login form, same data grid, different products around them. The login page object is now duplicated in…
asked by Nikhil Sane487 ·Running one scenario without waiting for the whole feature file
I am fixing one scenario in a feature that has eleven of them. Running the feature each time costs me two minutes per attempt, most of which is scenarios I am not touching. What…
asked by Nikhil Sane487 ·Inherited 900 Cypress specs: what maps to what, and what happens to custom commands?
I have inherited a Cypress suite. Roughly 900 specs, data-cy attributes throughout, about 60 custom commands in cypress/support/commands.js, and a cypress/fixtures folder nobody…
asked by Ade Oyinlola419 ·First UI run: five scenarios fail on the sign-in page, but the API layer was green
Working through the workshop on my own checkout of the sample app. The API layer passed straight away. Then the browser: Five failures, and as far as I can tell they are all the…
asked by Yusuf Demir201 ·How deep should page objects nest? We are four levels in and it hurts
Our hierarchy is BasePage to AuthenticatedPage to DashboardPage to ReportsPage, and there is talk of a fifth level for the two report variants. Nobody can say where a locator…
asked by Renata Kohl608 ·Suite went from six minutes to nineteen after we enabled healing
Same suite, same machine, same worker count. Before healing it was about six minutes, now it is nineteen and change. Nothing failed either way, which is why I assumed healing was…
asked by Renata Kohl608 ·How do you assert on a row in a table without writing a CSS chain?
Orders table, and the scenario I want reads: What I have in the page object is this, which works until someone sorts the table or the row moves to page two: Is there a…
asked by Sunita Kale982 ·Added one mask selector in the env file and the other three disappeared
Project file masks three elements for screenshots. Staging has a clock widget that also needs masking, so I added it to envs/staging.yaml: Now the three from the project file are…
asked by Nadia Belkacem8,611 ·A header widget appears on six pages — one page object per page, or something else?
Our header carries the cart badge, the account menu and a search box, and it is on six pages. Right now the cart badge locator is copy-pasted into six page objects, which was…
asked by Nadia Belkacem8,611 ·Why does healing never kick in for expectHidden()?
Every positive assertion in our page object heals fine. This one never does: assert is in heal.actions, the context has a role, a name and a test id. The step fails with an…
asked by Gio Castellano521 ·Unknown route "checkuot" for project demo-shop — where does that list come from?
New page object, first run, immediate failure: The call is await this.goto('checkuot'). I do not remember declaring routes anywhere, so where is that list of four coming from and…
asked by Gio Castellano521 ·I do not want healing to rescue a broken locator — I want the test to fail
Possibly an unpopular opinion, but: if a developer renames a button and my test still passes, my test did not test anything. Yesterday a whole feature shipped with the wrong…
asked by Vikram Rajagopal1,240 ·Installer cannot reach anything behind our corporate proxy
Everything on this laptop goes through an outbound proxy. Browsers work, our internal tools work, the installer does not — it gets partway and then hangs until it gives up on the…
asked by Elsa Nyman333 ·When should a step go in the shared library instead of my project's steps folder?
Reviewing a colleague's proposal and we disagreed twice in one file, so I would like a rule rather than a preference. They wrote When I add the extended warranty to the basket as…
asked by Karine Moreau655 ·Environment "qa" is not in envs.available [local, staging] — I created envs/qa.yaml already
Wrote projects/demo-shop/envs/qa.yaml by copying staging.yaml and changing the URLs. Then: The file is right there. Why does it also need declaring?
asked by Tobi Schrader97 ·Healing does nothing — I just get the normal Playwright timeout
We turned healing on for our checkout page object and the button still fails exactly the way it did before. No heal event, nothing in the log, just the Playwright timeout. The…
asked by Annika Solheim14,002 ·No data file for "data/{env}/users.csv" in env "staging" when the common file exists
Declared like this: There is no data/staging/ directory, which is fine, that was the plan — every environment was supposed to fall back to the common file. And there is a common…
asked by Annika Solheim14,002 ·lint says Undefined step: Given I am on the checkout page, but the method is right there
The class has it: Spelling matches character for character, I diffed it. The file is pages/CheckoutPage.ts. What else is there to check?
asked by Hsu Wei-lin15,230 ·