-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for robo-directives & robo-script options #709
Changes from all commits
30f3aa1
401b93b
2946bcc
55d682f
50fdd82
ccd535d
4733194
5ff256a
dc59bd6
142c0fb
1b42db5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
package com.example.test_app | ||
|
||
import android.content.DialogInterface | ||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.widget.Button | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AlertDialog | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
} | ||
|
||
fun foo() { | ||
println("foo!") | ||
findViewById<Button>(R.id.button1).setOnClickListener { | ||
Toast.makeText(this, "toast", Toast.LENGTH_SHORT).show() | ||
} | ||
|
||
findViewById<Button>(R.id.button2).setOnClickListener { | ||
AlertDialog.Builder(this) | ||
.setTitle("Alert Dialog") | ||
.setPositiveButton("OK") { dialog: DialogInterface, _: Int -> dialog.dismiss() } | ||
.show() | ||
} | ||
|
||
findViewById<Button>(R.id.button3).setOnClickListener { | ||
throw Exception() | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".MainActivity"> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:gravity="center" | ||
android:orientation="vertical" | ||
tools:context=".MainActivity"> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"/> | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
<Button | ||
android:id="@+id/button1" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="toast" /> | ||
|
||
<Button | ||
android:id="@+id/button2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="alert" /> | ||
|
||
<Button | ||
android:id="@+id/button3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="exception" /> | ||
|
||
</LinearLayout> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ gcloud: | |
## (default: a timestamp with a random suffix). | ||
# results-dir: tmp | ||
|
||
## Enable video recording during the test. Enabled by default, use --no-record-video to disable. | ||
## Enable video recording during the test. Disabled by default. Use --record-video to enable. | ||
# record-video: true | ||
|
||
## The max time this test execution can run before it is cancelled (default: 15m). | ||
|
@@ -57,7 +57,7 @@ gcloud: | |
test: ../test_app/apks/app-debug-androidTest.apk | ||
|
||
## Automatically log into the test device using a preconfigured Google account before beginning the test. | ||
## Enabled by default, use --no-auto-google-login to disable. | ||
## Disabled by default. Use --auto-google-login to enable. | ||
# auto-google-login: true | ||
|
||
## Whether each test runs in its own Instrumentation instance with the Android Test Orchestrator | ||
|
@@ -86,7 +86,7 @@ gcloud: | |
# - /sdcard/dir2/file2.jpg: gs://bucket/file.jpg | ||
|
||
## Monitor and record performance metrics: CPU, memory, network usage, and FPS (game-loop only). | ||
## Enabled by default, use --no-performance-metrics to disable. | ||
## Disabled by default. Use --performance-metrics to enable. | ||
# performance-metrics: true | ||
|
||
## Specifies the number of shards into which you want to evenly distribute test cases. | ||
|
@@ -111,6 +111,21 @@ gcloud: | |
# test-targets: | ||
# - class com.example.app.ExampleUiTest#testPasses | ||
|
||
## A map of robo_directives that you can use to customize the behavior of Robo test. | ||
## The type specifies the action type of the directive, which may take on values click, text or ignore. | ||
## If no type is provided, text will be used by default. | ||
## Each key should be the Android resource name of a target UI element and each value should be the text input for that element. | ||
## Values are only permitted for text type elements, so no value should be specified for click and ignore type elements. | ||
# robo-directives: | ||
# "text:input_resource_name": message | ||
# "click:button_resource_name": "" | ||
|
||
## The path to a Robo Script JSON file. | ||
## The path may be in the local filesystem or in Google Cloud Storage using gs:// notation. | ||
## You can guide the Robo test to perform specific actions by recording a Robo Script in Android Studio and then specifying this argument. | ||
## Learn more at https://firebase.google.com/docs/test-lab/robo-ux-test#scripting. | ||
# robo-script: path_to_robo_script | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice work! Remember to update readme.md as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated bunch of config options in |
||
|
||
## A list of DIMENSION=VALUE pairs which specify a target device to test against. | ||
## This flag may be repeated to specify multiple devices. | ||
## The four device dimensions are: model, version, locale, and orientation. | ||
|
@@ -130,7 +145,7 @@ flank: | |
# max-test-shards: 1 | ||
|
||
## shard time - the amount of time tests within a shard should take | ||
## when set to > 0, the shard count is dynamically set based on time up to the maxmimum limit defined by max-test-shards | ||
## when set to > 0, the shard count is dynamically set based on time up to the maximum limit defined by max-test-shards | ||
## 2 minutes (120) is recommended. | ||
## default: -1 (unlimited) | ||
# shard-time: -1 | ||
|
@@ -164,19 +179,25 @@ flank: | |
## Local folder to store the test result. Folder is DELETED before each run to ensure only artifacts from the new run are saved. | ||
# local-result-dir: flank | ||
|
||
## Downloaded files preserves the original path of file. Required when file names are not unique. | ||
## Keeps the full path of downloaded files. Required when file names are not unique. | ||
## Default: false | ||
# keep-file-path: false | ||
|
||
## Include additional app/test apk pairs in the run. If app is omitted, then the top level app is used for that pair. | ||
## Include additional app/test apk pairs in the run. Apks are unique by just filename and not by path! | ||
## If app is omitted, then the top level app is used for that pair. | ||
# additional-app-test-apks: | ||
# - app: ../test_app/apks/app-debug.apk | ||
# test: ../test_app/apks/app-debug-androidTest.apk | ||
# - test: ../test_app/apks/app-debug-androidTest.apk | ||
# test: ../test_app/apks/app1-debug-androidTest.apk | ||
# - test: ../test_app/apks/app2-debug-androidTest.apk | ||
|
||
## The max time this test run can execute before it is cancelled (default: unlimited). | ||
# run-timeout: 60m | ||
|
||
## Terminate with exit code 0 when there are failed tests. | ||
## Useful for Fladle and other gradle plugins that don't expect the process to have a non-zero exit code. | ||
## The JUnit XML is used to determine failure. (default: false) | ||
# ignore-failed-tests: true | ||
|
||
## Flank provides two ways for parsing junit xml results. | ||
## New way uses google api instead of merging xml files, but can generate slightly different output format. | ||
## This flag allows fallback for legacy xml junit results parsing | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍