Skip to content

Commit 2fc9306

Browse files
committed
Updated features and the screen recording
1 parent 615d605 commit 2fc9306

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ release</a>.
1414
Features
1515
-----
1616

17-
- View previously-recorded golden snapshots for the current test file opened in the editor
18-
- View failure diffs for the current test file
17+
- View previously-recorded golden snapshots for the currently opened test class
18+
- View golden snapshots of the current focussed test method
19+
- View failure diffs for the current test class or method
20+
- Record and Verify snapshots for individual tests or for entire test class
1921
- Zoom options for Actual Size and Fit to Window
2022
- Fully supported for test files written in Java or Kotlin

preview/screenshare.gif

6.7 MB
Loading

src/main/kotlin/com/getyourguide/paparazzi/service/MainService.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,24 +241,21 @@ class MainServiceImpl(private val project: Project) : MainService, PersistentSta
241241
onlyShowFailures = false
242242
isAutoLoadMethodEnabled = false
243243
isAutoLoadFileEnabled = false
244-
previouslyLoaded = PreviouslyLoaded()
245-
cache.get()?.clear() // May be instead of clearing, consider removing only the snapshots that are modified
246-
val file = psiClass.containingFile?.virtualFile
247-
if (psiMethod != null) {
248-
load(file, psiMethod.name)
249-
} else {
250-
load(file)
251-
}
244+
loadSnapshots(psiClass, psiMethod)
252245
}
253246

254247
override fun loadAfterSnapshotsVerified(psiClass: PsiClass, psiMethod: PsiMethod?) {
255248
onlyShowFailures = true
256249
isAutoLoadMethodEnabled = false
257250
isAutoLoadFileEnabled = false
251+
loadSnapshots(psiClass, psiMethod)
252+
}
253+
254+
private fun loadSnapshots(psiClass: PsiClass, psiMethod: PsiMethod?) {
258255
previouslyLoaded = PreviouslyLoaded()
259256
cache.get()?.clear() // May be instead of clearing, consider removing only the snapshots that are modified
260257
ReadAction.nonBlocking(Callable {
261-
// Temporary workaround. We need stall sometime for the Failure virtualFile to be created.
258+
// Temporary workaround. We need stall sometime for the virtualFile to be created.
262259
// If we run load() before that, then we will show "Nothing to show"
263260
// TODO Try to listen to the file creation instead of sleeping
264261
Thread.sleep(1000)

src/main/resources/META-INF/plugin.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<p>Features</p>
1111
<ul>
1212
<li>View previously-recorded golden snapshots for the current test file opened in the editor</li>
13-
<li>View failure diffs for the current test file</li>
13+
<li>View golden snapshots of the current focussed test method</li>
14+
<li>View failure diffs for the current test class or method</li>
15+
<li>Record and Verify snapshots for individual tests or for entire test class</li>
1416
<li>Zoom options for Actual Size and Fit to Window</li>
1517
<li>Fully supported for test files written in Java or Kotlin</li>
1618
</ul>

0 commit comments

Comments
 (0)