-
Notifications
You must be signed in to change notification settings - Fork 327
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
Add PHPUnit data provider set name to output filenames #1084
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
Can we make the PR not change the names of screenshots for tests that use no data set? |
@taylorotwell I've pushed a test to prove the filenames are unchanged if there's no data set. |
); | ||
$browsers = collect([$browser]); | ||
|
||
$this->storeConsoleLogsFor($browsers); | ||
} | ||
|
||
public static function testData() | ||
public static function data() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the test
prefix off of this because PHPUnit is running the method as a test.
If there's a failure in a Dusk test case that uses PHPUnit data providers, then only a screenshot of the last data set that failed will be available in the
screenshots
directory. This is because without the data set in the filename, each new screenshot overwrites the previous one.This PR adds the data set, where applicable, to the filenames of screenshots and console output:
With no data provider:
With unnamed data set (
0
,1
):With named data set (
foo
,bar
):I've retained the existing 140 character filename limit by trimming it off the left hand side of the filename, so namespaces are truncated.