-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from ytai/ModernizeScreenshots
Modernize screenshots
- Loading branch information
Showing
17 changed files
with
69 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
applications/HelloIOIO/src/androidTest/java/ioio/examples/hello/HelloIOIOSmokeTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
package ioio.examples.hello | ||
|
||
import android.Manifest | ||
import androidx.test.core.graphics.writeToTestStorage | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import androidx.test.espresso.matcher.ViewMatchers.withId | ||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.espresso.screenshot.captureToBitmap | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.rule.GrantPermissionRule | ||
import com.moka.utils.Screenshot | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.rules.TestName | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class HelloIOIOSmokeTest { | ||
|
||
@get:Rule | ||
var activityScenarioRule = ActivityScenarioRule(MainActivity::class.java) | ||
val activityScenarioRule = activityScenarioRule<MainActivity>() | ||
|
||
@get:Rule | ||
val grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant( | ||
Manifest.permission.WRITE_EXTERNAL_STORAGE, | ||
Manifest.permission.READ_EXTERNAL_STORAGE) | ||
var nameRule = TestName() | ||
|
||
@Test | ||
fun smokeTestSimplyStart() { | ||
onView(withId(R.id.button)).check(matches(isDisplayed())) | ||
Screenshot.takeScreenshot("smoke") | ||
onView(ViewMatchers.isRoot()) | ||
.captureToBitmap() | ||
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 13 additions & 7 deletions
20
applications/HolidayIOIO/src/androidTest/java/ioio/examples/holiday/HolidayIOIOSmokeTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
package ioio.examples.holiday | ||
|
||
import android.Manifest | ||
import androidx.test.core.graphics.writeToTestStorage | ||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.assertion.ViewAssertions | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.espresso.screenshot.captureToBitmap | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.rule.GrantPermissionRule | ||
import com.moka.utils.Screenshot | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.rules.TestName | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class HolidayIOIOSmokeTest { | ||
|
||
@get:Rule | ||
var activityScenarioRule = ActivityScenarioRule(HolidayIOIOActivity::class.java) | ||
val activityScenarioRule = activityScenarioRule<HolidayIOIOActivity>() | ||
|
||
var nameRule = TestName() | ||
|
||
|
||
@get:Rule | ||
val grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant( | ||
Manifest.permission.WRITE_EXTERNAL_STORAGE, | ||
Manifest.permission.CAMERA, | ||
Manifest.permission.READ_EXTERNAL_STORAGE) | ||
Manifest.permission.CAMERA | ||
) | ||
|
||
@Test | ||
fun smokeTestSimplyStart() { | ||
Espresso.onView(ViewMatchers.withId(R.id.frequencySeekBar)).check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
Screenshot.takeScreenshot("smoke") | ||
Espresso.onView(ViewMatchers.isRoot()) | ||
.captureToBitmap() | ||
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}") | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.