-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* replace com.orhanobut:logger with default Logger * add ktlint * add Conditions and NativeWidget classes * add wifi, celluar, dark mode * maestro_cli: fix bug with flavor being required * downgrade freezed * bump versions * bunch of fixes * simplify delay * stop server on start * add install Gradle task * use global 'debug' option * AutomatorServer: create 'printer' and 'catcher' Filters * consider all HTTP 2xx status codes to be successful
- Loading branch information
1 parent
2141ace
commit 3f87ea1
Showing
37 changed files
with
1,275 additions
and
210 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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
AutomatorServer/.idea/inspectionProfiles/profiles_settings.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,62 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'kotlin-android' | ||
id "com.android.application" | ||
id "kotlin-android" | ||
id "org.jlleitschuh.gradle.ktlint" version "10.3.0" | ||
} | ||
|
||
apply plugin: "kotlinx-serialization" | ||
|
||
|
||
android { | ||
compileSdkVersion 32 | ||
|
||
namespace 'pl.leancode.automatorserver' | ||
namespace "pl.leancode.automatorserver" | ||
|
||
defaultConfig { | ||
applicationId "pl.leancode.automatorserver" | ||
minSdkVersion 26 | ||
targetSdkVersion 32 | ||
versionCode 1 | ||
versionName "0.1.2" | ||
versionName "0.1.3" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
jvmTarget = "1.8" | ||
} | ||
|
||
packagingOptions { | ||
exclude 'META-INF/*' | ||
exclude "META-INF/*" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||
implementation 'androidx.core:core-ktx:1.7.0' | ||
implementation 'androidx.appcompat:appcompat:1.4.1' | ||
implementation 'com.google.android.material:material:1.6.0' | ||
implementation "androidx.core:core-ktx:1.8.0" | ||
implementation "androidx.appcompat:appcompat:1.4.2" | ||
implementation "com.google.android.material:material:1.6.1" | ||
|
||
androidTestImplementation 'com.orhanobut:logger:2.2.0' | ||
androidTestImplementation platform("org.http4k:http4k-bom:4.25.14.0") | ||
androidTestImplementation "org.http4k:http4k-core" | ||
androidTestImplementation "org.http4k:http4k-server-netty" | ||
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3" | ||
|
||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
androidTestImplementation 'androidx.test:runner:1.4.0' | ||
androidTestImplementation 'androidx.test:rules:1.4.0' | ||
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' | ||
androidTestImplementation "androidx.test.ext:junit:1.1.3" | ||
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0" | ||
androidTestImplementation "androidx.test:runner:1.4.0" | ||
androidTestImplementation "androidx.test:rules:1.4.0" | ||
androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0" | ||
} |
27 changes: 9 additions & 18 deletions
27
AutomatorServer/app/src/androidTest/java/pl/leancode/automatorserver/AutomatorServer.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,33 +1,24 @@ | ||
package pl.leancode.automatorserver | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import com.orhanobut.logger.AndroidLogAdapter | ||
import com.orhanobut.logger.Logger | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class AutomatorServer { | ||
@Test | ||
fun startServer() { | ||
Logger.addLogAdapter(AndroidLogAdapter()) | ||
Logger.i("Starting server") | ||
|
||
if (serverInstrumentation == null) { | ||
serverInstrumentation = ServerInstrumentation.instance | ||
Logger.i("Starting server") | ||
try { | ||
serverInstrumentation!!.startServer() | ||
Logger.i("Server started") | ||
while (!serverInstrumentation!!.isStopped) { | ||
} | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
Logger.w("Exception thrown: ", e) | ||
val serverInstrumentation = ServerInstrumentation.instance | ||
try { | ||
serverInstrumentation.start() | ||
Logger.i("Server started") | ||
while (serverInstrumentation.running) { | ||
} | ||
} catch (e: Exception) { | ||
e.printStackTrace() | ||
Logger.e("Exception thrown: ", e) | ||
} | ||
} | ||
|
||
companion object { | ||
private var serverInstrumentation: ServerInstrumentation? = null | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
AutomatorServer/app/src/androidTest/java/pl/leancode/automatorserver/Logger.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package pl.leancode.automatorserver | ||
|
||
import android.util.Log | ||
|
||
object Logger { | ||
private const val TAG = "Maestro" | ||
|
||
fun e(msg: String) { | ||
Log.e(TAG, msg) | ||
} | ||
|
||
fun e(msg: String, tr: Throwable?) { | ||
Log.e(TAG, msg, tr) | ||
} | ||
|
||
fun i(msg: String) { | ||
Log.i(TAG, msg) | ||
} | ||
|
||
fun d(msg: String) { | ||
Log.d(TAG, msg) | ||
} | ||
} |
Oops, something went wrong.