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

[5.0] Allow saving screenshots in a subdirectory #662

Merged
merged 2 commits into from
Aug 1, 2019
Merged

[5.0] Allow saving screenshots in a subdirectory #662

merged 2 commits into from
Aug 1, 2019

Conversation

SjorsO
Copy link
Contributor

@SjorsO SjorsO commented Aug 1, 2019

I have opened a similar PR in the php-webdriver repo, but since that is taking a long time to get merged I've decided to PR it straight into Dusk.


This PR adds the ability to save screenshots in subdirectories. Currently, the directory you give to the $browser->screenshot() method has to exist, else it will throw an exception. With this PR you can save the screenshot to a directory that does not exist, the directory will be created automatically.

I take screenshots of many pages and flows within my application. Without saving screenshots in subdirectories, I get a long list of screenshots with long names:

  • user-activation-single-company-step-1.png
  • user-activation-single-company-step-2.png
  • user-activation-multiple-companies-step-1.png
  • user-activation-multiple-companies-step-2.png
  • (and many more)

With this PR you can I can create a structure like this, which is easier to navigate:

  • user-activation/single-company/step-1.png
  • user-activation/single-company/step-2.png
  • user-activation/multiple-companies/step-1.png
  • user-activation/multiple-companies/step-2.png
  • (and many more)

@driesvints driesvints changed the title Allow saving screenshots in a subdirectory [5.0] Allow saving screenshots in a subdirectory Aug 1, 2019
src/Browser.php Outdated Show resolved Hide resolved
@taylorotwell taylorotwell merged commit f0d03fb into laravel:5.0 Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants