Skip to content

Commit 6b9526a

Browse files
Fix CR comments and pipeline
1 parent 170a3bd commit 6b9526a

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ concurrency:
2020

2121
env:
2222
ANDROID_SDK_VERSION: "28"
23-
ANDROID_SDK_VERSION_FLUTTER: "30"
2423
ANDROID_EMU_NAME: test
2524
ANDROID_EMU_TARGET: default
2625
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
@@ -116,7 +115,7 @@ jobs:
116115
uses: reactivecircus/android-emulator-runner@v2
117116
with:
118117
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 }}
120119
avd-name: ${{ env.ANDROID_EMU_NAME }}
121120
disable-spellchecker: true
122121
disable-animations: true

src/e2eFlutterTest/java/io/appium/java_client/android/BaseFlutterTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void startSession() throws MalformedURLException {
6464
driver = new FlutterAndroidDriver(service.getUrl(), flutterOptions
6565
.setUiAutomator2Options(new UiAutomator2Options()
6666
.setApp(System.getProperty("flutterApp"))
67+
.setAutoGrantPermissions(true)
6768
.eventTimings())
6869
);
6970
} else {

src/e2eFlutterTest/java/io/appium/java_client/android/CommandTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.openqa.selenium.Point;
1212
import org.openqa.selenium.WebElement;
1313

14-
import java.io.File;
1514
import java.io.IOException;
1615

1716
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -126,19 +125,18 @@ void testCameraMocking() throws IOException {
126125
openScreen("Image Picker");
127126

128127
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());
131131

132132
driver.findElement(AppiumBy.flutterKey("capture_image")).click();
133133
driver.findElement(AppiumBy.flutterText("PICK")).click();
134-
assertEquals(driver.findElement(AppiumBy.flutterText("SecondInjectedImage")).getText(), "SecondInjectedImage");
135134
assertTrue(driver.findElement(AppiumBy.flutterText("SecondInjectedImage")).isDisplayed());
136135

137136
driver.activateInjectedImage(successQr);
138137

139138
driver.findElement(AppiumBy.flutterKey("capture_image")).click();
140139
driver.findElement(AppiumBy.flutterText("PICK")).click();
141-
assertEquals(driver.findElement(AppiumBy.flutterText("Success!")).getText(), "Success!");
142140
assertTrue(driver.findElement(AppiumBy.flutterText("Success!")).isDisplayed());
143141
}
144142
}

src/main/java/io/appium/java_client/flutter/SupportsFlutterCameraMocking.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public interface SupportsFlutterCameraMocking extends CanExecuteFlutterScripts {
1515
/**
1616
* Injects a mock image into the Flutter application using the provided file.
1717
*
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
2020
* @throws IOException if an I/O error occurs while reading the image file
2121
*/
2222
default String injectMockImage(File image) throws IOException {
@@ -27,8 +27,8 @@ default String injectMockImage(File image) throws IOException {
2727
/**
2828
* Injects a mock image into the Flutter application using the provided Base64-encoded image string.
2929
*
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
3232
*/
3333
default String injectMockImage(String base64Image) {
3434
return (String) executeFlutterCommand("injectImage", Map.of(

0 commit comments

Comments
 (0)