Skip to content
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

[Bug]: Cannot run non bdd tests using the same fixtures #276

Open
viktor-silakov opened this issue Jan 29, 2025 · 3 comments
Open

[Bug]: Cannot run non bdd tests using the same fixtures #276

viktor-silakov opened this issue Jan 29, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@viktor-silakov
Copy link

viktor-silakov commented Jan 29, 2025

Given

A project with a mixture of BDD and non-BDD tests.

When

Running non-BDD tests that utilize fixtures based on playwright-bdd:

import { test as base } from 'playwright-bdd';
...
...
export const test = base.extend<...>({
...
});

Then

The following error occurs when a test uses these fixtures:

Error: BDD config not found for testDir: ...

Expected Result

BDD and non-BDD tests should be able to run independently without interference.

Reproduction Demo URL

None provided.

Environment

Node - v22.4.0
Yarn - 3.2.4
playwright-bdd - 8.1.0

Priority Level

Critical

@viktor-silakov viktor-silakov added the bug Something isn't working label Jan 29, 2025
@vitalets
Copy link
Owner

When some tests are not BDD, you can setup their fixtures based on Playwright's test, e.g.:

import { test as base } from '@playwright/test';
...
// for non-BDD tests
export const test = base.extend<...>({
...
});

Does this approach work for your setup?
And could you describe more the use-case, when you need to run both bdd and non-bdd tests together?

@viktor-silakov
Copy link
Author

When some tests are not BDD, you can setup their fixtures based on Playwright's test, e.g.:

No, I can't, we use both the scripting approach and BDD like with sharing the same fixtures (e.g.: PO, and some other objects for electron testing)

And could you describe more the use-case, when you need to run both bdd and non-bdd tests together?

There are two kinds of test solutions e2e tests for full-stack QA and some DEVs that use mix of test that use low level approaches and HL together, this is very important for us.

BTW: I have downgraded to 7.5.0 all works well.

@vitalets
Copy link
Owner

vitalets commented Feb 4, 2025

Ok! Could you create a minimal demo based on playwright-bdd-example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants