File tree Expand file tree Collapse file tree 4 files changed +9
-11
lines changed
e2eFlutterTest/java/io/appium/java_client/android
main/java/io/appium/java_client/flutter Expand file tree Collapse file tree 4 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ concurrency:
20
20
21
21
env :
22
22
ANDROID_SDK_VERSION : " 28"
23
- ANDROID_SDK_VERSION_FLUTTER : " 30"
24
23
ANDROID_EMU_NAME : test
25
24
ANDROID_EMU_TARGET : default
26
25
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
@@ -116,7 +115,7 @@ jobs:
116
115
uses : reactivecircus/android-emulator-runner@v2
117
116
with :
118
117
script : ./gradlew e2eFlutterTest -Pplatform="android" -Pselenium.version=$latest_snapshot -PisCI -PflutterApp=${{ env.FLUTTER_ANDROID_APP }}
119
- api-level : ${{ env.ANDROID_SDK_VERSION_FLUTTER }}
118
+ api-level : ${{ env.ANDROID_SDK_VERSION }}
120
119
avd-name : ${{ env.ANDROID_EMU_NAME }}
121
120
disable-spellchecker : true
122
121
disable-animations : true
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ void startSession() throws MalformedURLException {
64
64
driver = new FlutterAndroidDriver (service .getUrl (), flutterOptions
65
65
.setUiAutomator2Options (new UiAutomator2Options ()
66
66
.setApp (System .getProperty ("flutterApp" ))
67
+ .setAutoGrantPermissions (true )
67
68
.eventTimings ())
68
69
);
69
70
} else {
Original file line number Diff line number Diff line change 11
11
import org .openqa .selenium .Point ;
12
12
import org .openqa .selenium .WebElement ;
13
13
14
- import java .io .File ;
15
14
import java .io .IOException ;
16
15
17
16
import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -126,19 +125,18 @@ void testCameraMocking() throws IOException {
126
125
openScreen ("Image Picker" );
127
126
128
127
final String successQr = driver .injectMockImage (
129
- new File (String .valueOf (TestUtils .resourcePathToAbsolutePath ("success_qr.png" ))));
130
- driver .injectMockImage (new File (String .valueOf (TestUtils .resourcePathToAbsolutePath ("second_qr.png" ))));
128
+ TestUtils .resourcePathToAbsolutePath ("success_qr.png" ).toFile ());
129
+ driver .injectMockImage (
130
+ TestUtils .resourcePathToAbsolutePath ("second_qr.png" ).toFile ());
131
131
132
132
driver .findElement (AppiumBy .flutterKey ("capture_image" )).click ();
133
133
driver .findElement (AppiumBy .flutterText ("PICK" )).click ();
134
- assertEquals (driver .findElement (AppiumBy .flutterText ("SecondInjectedImage" )).getText (), "SecondInjectedImage" );
135
134
assertTrue (driver .findElement (AppiumBy .flutterText ("SecondInjectedImage" )).isDisplayed ());
136
135
137
136
driver .activateInjectedImage (successQr );
138
137
139
138
driver .findElement (AppiumBy .flutterKey ("capture_image" )).click ();
140
139
driver .findElement (AppiumBy .flutterText ("PICK" )).click ();
141
- assertEquals (driver .findElement (AppiumBy .flutterText ("Success!" )).getText (), "Success!" );
142
140
assertTrue (driver .findElement (AppiumBy .flutterText ("Success!" )).isDisplayed ());
143
141
}
144
142
}
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ public interface SupportsFlutterCameraMocking extends CanExecuteFlutterScripts {
15
15
/**
16
16
* Injects a mock image into the Flutter application using the provided file.
17
17
*
18
- * @param image the image file to be mocked
19
- * @return an {@code Integer } representing the result of the injection operation
18
+ * @param image the image file to be mocked (must be in PNG format)
19
+ * @return an {@code String } representing a unique id of the injected image
20
20
* @throws IOException if an I/O error occurs while reading the image file
21
21
*/
22
22
default String injectMockImage (File image ) throws IOException {
@@ -27,8 +27,8 @@ default String injectMockImage(File image) throws IOException {
27
27
/**
28
28
* Injects a mock image into the Flutter application using the provided Base64-encoded image string.
29
29
*
30
- * @param base64Image the Base64-encoded string representation of the image
31
- * @return an {@code Integer } representing the result of the injection operation
30
+ * @param base64Image the Base64-encoded string representation of the image (must be in PNG format)
31
+ * @return an {@code String } representing the result of the injection operation
32
32
*/
33
33
default String injectMockImage (String base64Image ) {
34
34
return (String ) executeFlutterCommand ("injectImage" , Map .of (
You can’t perform that action at this time.
0 commit comments