-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: patrol integrate with android,ios,macos
- Loading branch information
Showing
24 changed files
with
1,108 additions
and
15 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
33 changes: 33 additions & 0 deletions
33
android/app/src/androidTest/java/com/example/tunefun_front/MainActivityTest.java
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,33 @@ | ||
package com.example.tunefun_front; // replace "com.example.myapp" with your app's package | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
import pl.leancode.patrol.PatrolJUnitRunner; | ||
|
||
@RunWith(Parameterized.class) | ||
public class MainActivityTest { | ||
@Parameters(name = "{0}") | ||
public static Object[] testCases() { | ||
PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation(); | ||
// replace "MainActivity.class" with "io.flutter.embedding.android.FlutterActivity.class" | ||
// if your AndroidManifest is using: android:name="io.flutter.embedding.android.FlutterActivity" | ||
instrumentation.setUp(MainActivity.class); | ||
instrumentation.waitForPatrolAppService(); | ||
return instrumentation.listDartTests(); | ||
} | ||
|
||
public MainActivityTest(String dartTestName) { | ||
this.dartTestName = dartTestName; | ||
} | ||
|
||
private final String dartTestName; | ||
|
||
@Test | ||
public void runDartTest() { | ||
PatrolJUnitRunner instrumentation = (PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation(); | ||
instrumentation.runDartTest(dartTestName); | ||
} | ||
} |
File renamed without changes.
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,30 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
import 'package:patrol/patrol.dart'; | ||
|
||
void main() { | ||
patrolTest( | ||
'counter state is the same after going to home and switching apps', | ||
($) async { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
// Replace later with your app's main widget | ||
await $.pumpWidgetAndSettle( | ||
MaterialApp( | ||
home: Scaffold( | ||
appBar: AppBar(title: const Text('app')), | ||
backgroundColor: Colors.blue, | ||
), | ||
), | ||
); | ||
|
||
expect($('app'), findsOneWidget); | ||
if (!Platform.isMacOS) { | ||
await $.native.pressHome(); | ||
} | ||
}, | ||
); | ||
} |
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
Oops, something went wrong.