lint says Undefined step: Given I am on the checkout page, but the method is right there
Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.
bash
sdods lint -p demo-shop
text
Undefined step: Given I am on the checkout page
The class has it:
ts
@Given('I am on the checkout page')
async open() {
await this.goto('checkout');
}
Spelling matches character for character, I diffed it. The file is pages/CheckoutPage.ts. What else is there to check?
Two causes, and the file location rules out the first one for you.
The file is not under pages/**/*.ts or steps/**/*.ts. Yours is, so skip it.
The class is not registered as a fixture. @Fixture<typeof test>('checkoutPage') names a fixture in steps/fixtures.ts, and if that name is not in the extend call — or is spelled checkoutPageObject, which is what bit me — the decorated methods have nothing to attach to and generation reports them as missing.
Separately, and I would fix this before the other thing: that step probably should not exist. The shared library already ships I navigate to the "checkout" page, which resolves the route name from sdods.project.yaml and does the same navigation. Check before you write:
bash
sdods steps list -p demo-shop --grep checkout
Keep the page object for the parts of checkout that are actually yours.
For context on where the message comes from: sdods lint runs generation with missing steps set to fail, then parses the block it prints. So the finding is reported against the feature file and line that used the step, not against the page object — which is why the location in the output looks unhelpful when the real problem is in steps/fixtures.ts.