You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+15
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,21 @@ $this->get('/')
114
114
115
115
This will automatically create a screenshot in all provided resolutions and create a diff, if a previous screenshot is available.
116
116
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
+
117
132
### Specify multiple resolutions
118
133
119
134
Creating diffs for multiple resolutions can be very useful - especially if you want to test responsive websites and applications.
0 commit comments