i need some help with playwright and cucumber
i set up a gherkin and some tests for it, but i have problems with the expect command.
here are my imports:
import { ICustomWorld } from "../support/custom-world";
import { Given, When, Then } from "@cucumber/cucumber";
import { expect } from "@playwright/test";
and here is a sample of the problem:
Then(
"The Menu Niederlassungsdaten is default",
async function (this: ICustomWorld) {
const { page } = this;
const TitleLabel = await page?.locator('#app > div.container-fluid > div.row.content.justify-content-center > div > div > div > div.col-12.col-md-3.col-lg-2.tabs > div > a.list-group-item.text-center.router-link-exact-active.active');
await expect(TitleLabel).toHaveAttribute("aria-current","page");
}
);
This expect.toHaveAttribute is working perfectly without cucumber. But in the given when then from cucumber is it not working. The error is:
Error: toHaveAttribute must be called during the test
So it seems the expect command is missing this playwright test command. What can i do to get this working in cucumber?