Skip to content

Commit

Permalink
Add benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Feb 9, 2023
1 parent f1e5a1b commit 082e9fa
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.github.takahirom.roborazzi.sample

import androidx.test.core.app.ActivityScenario.launch
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class RuleTestWithoutRoborazziForBenchmark {
@Test
fun captureRoboGifSample() {
// launch
launch(MainActivity::class.java)
// move to next page
onView(withId(R.id.button_first))
.perform(click())
// back
pressBack()
// move to next page
onView(withId(R.id.button_first))
.perform(click())
}
}
9 changes: 9 additions & 0 deletions benchmark-scenario.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# gradle-profiler --benchmark --scenario-file ./benchmark-scenario.txt
testWhenNoCapture {
tasks = [":app:testDebugUnitTest", "--tests", "com.github.takahirom.roborazzi.sample.RuleTestWithOnlyFail.captureRoboGifSample"]
gradle-args = []
}
testWhenNoCaptureWithoutRoborazzi {
tasks = [":app:testDebugUnitTest", "--tests", "com.github.takahirom.roborazzi.sample.RuleTestWithoutRoborazziForBenchmark.captureRoboGifSample"]
gradle-args = []
}

0 comments on commit 082e9fa

Please sign in to comment.