-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Tests under subfolders of features folder are not executing for version greater than 4.0.0 #44
Comments
Hi @magarwal19 ! could you provide more details on your directory structure? |
@vitalets |
I've got it. This caused by #40 that simplifies output directory structure utilizing nearest common parent of feature files.
instead of:
Is it something that does not suit your project? I mean could you set outputDir to |
I was not setting up output directory explicitly in playwright config file as i think it by defaults takes .features-gen Problem with new version is that the run command is failing stating no tests are found to run |
@vitalets i tried adding outputDir, but still getting same error |
You are right. I just wanted to double check your settings. So I've tried to reproduce it in Having the same directory structure: And config: const testDir = defineBddConfig({
paths: ['features/**/*.{feature,feature.md}'],
require: ['steps/*.ts'],
importTestFrom: 'steps/fixtures.ts',
}); When run Could you clone |
Hi @vitalets It seems i found the issue.. I am able to replicate it with the repository you have shared.. Can you please try running below command: |
Passing
or more accurately:
|
Hi @vitalets passing .feature file use to work earlier on old version. with new changes if i change my run command to npx bddgen && npx playwright test flow1/homepage.feature then this works... But when we were using old way of giving complete paths "features/flow1...." also .features is ideally created after running our run command so ideally user will not be aware about its path |
I've got the point. Looking deeply on how Playwright handles passed arguments, I found that it converts them into RegExp and applies to absolute file paths.
It builds regexp like this:
And applies it to all files from testDir (that is
When directory structure was the same as in Generally I like that "trick" with passing @magarwal19 thanks for bringing all this ideas :) |
That would really be helpful! |
@magarwal19 while working on this fix I realized a workaround how we can pass const testDir = defineBddConfig({
outputDir: '.features', // <- not .features-gen
paths: ['features/**/*.{feature,feature.md}'],
require: ['steps/*.ts'],
importTestFrom: 'steps/fixtures.ts',
}); Then run command with
Substring |
Concerning For example, the following features structure:
produces the following output dir:
Just adding a new feature file can cause full re-structure of outputDir that will invalidate all saved screenshots. It will be a headache for developers to find out why all screenshot tests are suddenly failed:
output dir:
|
yes agree... |
Fixed in 5.2.0. Introduced new config option Unfortunately this is possibly breaking change for screenshot testing depending on project structure. @magarwal19 could you check on your side with 5.2.0 that everything works correctly? |
Hi @vitalets |
Thank you! |
Hi Team,
On the latest version when we run command "npx bddgen && npx playwright test"
then the .features-gen folder created do not create features folder and the command gets fail stating "Error: No tests found"
while if we downgrade to version 4.0.0, then features folder is created properly and able to execute tests
The text was updated successfully, but these errors were encountered: