Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit ffdb8ad

Browse files
committed
Add update-screenshot flag to readme
1 parent a84d4b9 commit ffdb8ad

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,21 @@ $this->get('/')
114114

115115
This will automatically create a screenshot in all provided resolutions and create a diff, if a previous screenshot is available.
116116

117+
### Dealing with diffs
118+
119+
When VisualDiff detects differences in the new screenshot compared to the previous successfully created screenshot, the PHPUnit test will fail.
120+
It will tell you which test caused the visual difference as well as giving you the filename of the screenshot diff.
121+
122+
Now you need to handle with this visual diff, just as you would with a code-diff. Review the changes and either approve the visual difference, or revert the UI state back to the successful state.
123+
124+
You can approve the new screenshots by adding a `-d --update-screenshots` flag to the phpunit command.
125+
126+
```bash
127+
> ./vendor/bin/phpunit -d --update-screenshots
128+
129+
OK (1 test, 1 assertion)
130+
```
131+
117132
### Specify multiple resolutions
118133

119134
Creating diffs for multiple resolutions can be very useful - especially if you want to test responsive websites and applications.

0 commit comments

Comments
 (0)