Skip to content

Commit

Permalink
Updated features and the screen recording
Browse files Browse the repository at this point in the history
  • Loading branch information
thsaravana committed Nov 10, 2022
1 parent 615d605 commit 2fc9306
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ release</a>.
Features
-----

- View previously-recorded golden snapshots for the current test file opened in the editor
- View failure diffs for the current test file
- View previously-recorded golden snapshots for the currently opened test class
- View golden snapshots of the current focussed test method
- View failure diffs for the current test class or method
- Record and Verify snapshots for individual tests or for entire test class
- Zoom options for Actual Size and Fit to Window
- Fully supported for test files written in Java or Kotlin
Binary file modified preview/screenshare.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -241,24 +241,21 @@ class MainServiceImpl(private val project: Project) : MainService, PersistentSta
onlyShowFailures = false
isAutoLoadMethodEnabled = false
isAutoLoadFileEnabled = false
previouslyLoaded = PreviouslyLoaded()
cache.get()?.clear() // May be instead of clearing, consider removing only the snapshots that are modified
val file = psiClass.containingFile?.virtualFile
if (psiMethod != null) {
load(file, psiMethod.name)
} else {
load(file)
}
loadSnapshots(psiClass, psiMethod)
}

override fun loadAfterSnapshotsVerified(psiClass: PsiClass, psiMethod: PsiMethod?) {
onlyShowFailures = true
isAutoLoadMethodEnabled = false
isAutoLoadFileEnabled = false
loadSnapshots(psiClass, psiMethod)
}

private fun loadSnapshots(psiClass: PsiClass, psiMethod: PsiMethod?) {
previouslyLoaded = PreviouslyLoaded()
cache.get()?.clear() // May be instead of clearing, consider removing only the snapshots that are modified
ReadAction.nonBlocking(Callable {
// Temporary workaround. We need stall sometime for the Failure virtualFile to be created.
// Temporary workaround. We need stall sometime for the virtualFile to be created.
// If we run load() before that, then we will show "Nothing to show"
// TODO Try to listen to the file creation instead of sleeping
Thread.sleep(1000)
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<p>Features</p>
<ul>
<li>View previously-recorded golden snapshots for the current test file opened in the editor</li>
<li>View failure diffs for the current test file</li>
<li>View golden snapshots of the current focussed test method</li>
<li>View failure diffs for the current test class or method</li>
<li>Record and Verify snapshots for individual tests or for entire test class</li>
<li>Zoom options for Actual Size and Fit to Window</li>
<li>Fully supported for test files written in Java or Kotlin</li>
</ul>
Expand Down

0 comments on commit 2fc9306

Please sign in to comment.