Skip to content

Commit 0fa0d7d

Browse files
Merge pull request #38 from aquality-automation/breaking/migrate-to-java-11 +semver: breaking
[Breaking] Migrate to Java 11
2 parents a9f0b31 + d628a33 commit 0fa0d7d

File tree

8 files changed

+52
-18
lines changed

8 files changed

+52
-18
lines changed

.github/workflows/release-maven-central.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Step 2 - Set up Maven Central Repository
1919
uses: actions/setup-java@v3
2020
with:
21-
java-version: "8"
21+
java-version: "11"
2222
distribution: "adopt"
2323
server-id: ossrh
2424
server-username: MVN_CENTRAL_USERNAME

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ Most of performed methods are logged using LOG4J, so you can easily see a histor
1515

1616
We use interfaces where is possible, so you can implement your own version of target interface with no need to rewrite other classes.
1717

18+
> ### Breaking news!
19+
> Starting from v5.0.0 onwards, this package requires Java 11 or higher, as Selenium and Appium have stopped support of Java 8.
20+
> The last version available for Java 8 is [v4.1.1](https://github.com/aquality-automation/aquality-appium-mobile-java/releases/tag/v4.1.1)
21+
22+
1823
### Quick start
1924

2025
To start the project using aquality.appium.mobile framework, you can [download our template BDD project by this link.](https://github.com/aquality-automation/aquality-appium-mobile-java-template)
@@ -26,7 +31,7 @@ Alternatively, you can follow the steps below:
2631
<dependency>
2732
<groupId>com.github.aquality-automation</groupId>
2833
<artifactId>aquality-appium-mobile</artifactId>
29-
<version>3.0.x</version>
34+
<version>5.0.x</version>
3035
</dependency>
3136
```
3237

azure-pipelines.yml

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
publishJUnitResults: true
2828
testResultsFiles: '**/surefire-reports/TEST-*.xml'
2929
javaHomeOption: 'JDKVersion'
30+
jdkVersionOption: '11'
3031
mavenVersionOption: 'Default'
3132
mavenAuthenticateFeed: false
3233
effectivePomSkip: false
@@ -120,6 +121,7 @@ jobs:
120121
publishJUnitResults: true
121122
testResultsFiles: '**/surefire-reports/TEST-*.xml'
122123
javaHomeOption: 'JDKVersion'
124+
jdkVersionOption: '11'
123125
mavenVersionOption: 'Default'
124126
mavenAuthenticateFeed: false
125127
effectivePomSkip: false

pom.xml

+28-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<properties>
1717
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19-
<revision>4.0.0-SNAPSHOT</revision>
19+
<revision>5.0.0-SNAPSHOT</revision>
2020
</properties>
2121

2222
<distributionManagement>
@@ -73,14 +73,14 @@
7373
<groupId>org.apache.maven.plugins</groupId>
7474
<artifactId>maven-compiler-plugin</artifactId>
7575
<configuration>
76-
<source>8</source>
77-
<target>8</target>
76+
<source>11</source>
77+
<target>11</target>
7878
</configuration>
7979
</plugin>
8080
<plugin>
8181
<groupId>org.jacoco</groupId>
8282
<artifactId>jacoco-maven-plugin</artifactId>
83-
<version>0.8.4</version>
83+
<version>0.8.11</version>
8484
<executions>
8585
<execution>
8686
<id>pre-unit-test</id>
@@ -125,6 +125,7 @@
125125
<plugin>
126126
<groupId>org.apache.maven.plugins</groupId>
127127
<artifactId>maven-source-plugin</artifactId>
128+
<version>3.3.0</version>
128129
<executions>
129130
<execution>
130131
<id>attach-sources</id>
@@ -137,6 +138,10 @@
137138
<plugin>
138139
<groupId>org.apache.maven.plugins</groupId>
139140
<artifactId>maven-javadoc-plugin</artifactId>
141+
<version>3.6.3</version>
142+
<configuration>
143+
<source>11</source>
144+
</configuration>
140145
<executions>
141146
<execution>
142147
<id>attach-javadocs</id>
@@ -149,7 +154,7 @@
149154
<plugin>
150155
<groupId>org.apache.maven.plugins</groupId>
151156
<artifactId>maven-gpg-plugin</artifactId>
152-
<version>1.6</version>
157+
<version>3.1.0</version>
153158
<executions>
154159
<execution>
155160
<id>sign-artifacts</id>
@@ -169,7 +174,7 @@
169174
<plugin>
170175
<groupId>org.sonatype.plugins</groupId>
171176
<artifactId>nexus-staging-maven-plugin</artifactId>
172-
<version>1.6.8</version>
177+
<version>1.6.13</version>
173178
<extensions>true</extensions>
174179
<configuration>
175180
<serverId>ossrh</serverId>
@@ -184,19 +189,33 @@
184189
<dependency>
185190
<groupId>com.github.aquality-automation</groupId>
186191
<artifactId>aquality-selenium-core</artifactId>
187-
<version>3.1.1</version>
192+
<version>4.0.0</version>
188193
</dependency>
189194

190195
<dependency>
191196
<groupId>io.appium</groupId>
192197
<artifactId>java-client</artifactId>
193-
<version>8.6.0</version>
198+
<version>9.1.0</version>
194199
</dependency>
195200

196201
<dependency>
197202
<groupId>org.testng</groupId>
198203
<artifactId>testng</artifactId>
199-
<version>7.5.1</version>
204+
<version>7.9.0</version>
205+
<scope>test</scope>
206+
</dependency>
207+
208+
<dependency>
209+
<groupId>org.apache.commons</groupId>
210+
<artifactId>commons-lang3</artifactId>
211+
<version>3.14.0</version>
212+
<scope>test</scope>
213+
</dependency>
214+
215+
<dependency>
216+
<groupId>commons-io</groupId>
217+
<artifactId>commons-io</artifactId>
218+
<version>2.15.1</version>
200219
<scope>test</scope>
201220
</dependency>
202221

src/test/java/samples/android/nativeapp/AndroidBasicInteractionsTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void openCheckBoxesScreen() {
3535

3636
private void openViewControlsScreen() {
3737
ViewControlsScreen screen = ApplicationActivity.VIEW_CONTROLS.open();
38-
Assert.assertTrue(screen.state().isDisplayed(), String.format("%s screen should be opened", screen.getName()));
38+
Assert.assertTrue(screen.state().waitForDisplayed(), String.format("%s screen should be opened", screen.getName()));
3939
}
4040

4141
@Override
@@ -57,7 +57,7 @@ public void tearDown() {
5757
@Test
5858
public void testSendKeys() {
5959
InvokeSearchScreen searchScreen = ApplicationActivity.SEARCH.open();
60-
Assert.assertTrue(searchScreen.state().isDisplayed(), String.format("%s should be opened", searchScreen.getName()));
60+
Assert.assertTrue(searchScreen.state().waitForDisplayed(), String.format("%s should be opened", searchScreen.getName()));
6161
String query = "Hello world!";
6262
searchScreen.submitSearch(query);
6363
Assert.assertEquals(searchScreen.getSearchResult(), query, "Search result don't match to entered query");
@@ -67,7 +67,7 @@ public void testSendKeys() {
6767
public void testSaveAndCompareScreenDump()
6868
{
6969
InvokeSearchScreen searchScreen = ApplicationActivity.SEARCH.open();
70-
Assert.assertTrue(searchScreen.state().isDisplayed(), String.format("%s should be opened", searchScreen.getName()));
70+
Assert.assertTrue(searchScreen.state().waitForDisplayed(), String.format("%s should be opened", searchScreen.getName()));
7171
final String customDumpName = String.format("my dump of %s", searchScreen.getName());
7272
searchScreen.dump().save(customDumpName);
7373
Assert.assertEquals(searchScreen.dump().compare(customDumpName), 0, "Current screen should have no visual difference comparing to just saved dump");
@@ -114,7 +114,7 @@ public void testVerticalSwipeToElement() {
114114
@Test
115115
public void testHorizontalSwipeToElement() {
116116
ViewTabsScrollableScreen viewTabsScrollableScreen = ApplicationActivity.VIEW_TABS_SCROLLABLE.open();
117-
Assert.assertTrue(viewTabsScrollableScreen.state().isDisplayed(),
117+
Assert.assertTrue(viewTabsScrollableScreen.state().waitForDisplayed(),
118118
String.format("%s screen should be opened", viewTabsScrollableScreen.getName()));
119119
viewTabsScrollableScreen.swipeTabWithLongPress(4, 1);
120120
viewTabsScrollableScreen.selectTab(7);

src/test/java/samples/android/nativeapp/apidemos/screens/AndroidScreen.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import io.appium.java_client.android.AndroidDriver;
77
import org.openqa.selenium.By;
88

9+
import java.util.HashMap;
10+
import java.util.Map;
11+
912
public abstract class AndroidScreen extends Screen {
1013

1114
protected AndroidScreen(By locator, String name) {
@@ -17,6 +20,9 @@ protected void startActivity(Activity activity) {
1720
activity.getAppActivity(),
1821
activity.getAppPackage());
1922
AndroidDriver driver = (AndroidDriver) AqualityServices.getApplication().getDriver();
20-
driver.startActivity(activity);
23+
Map<String, Object> params = new HashMap<>();
24+
params.put("intent", activity.getAppPackage() + "/" + activity.getAppActivity());
25+
params.put("package", activity.getAppPackage());
26+
driver.executeScript("mobile: startActivity", params);
2127
}
2228
}

src/test/java/samples/android/web/AndroidWebTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ void setUp() {
1616

1717
@AfterClass
1818
void tearDown() {
19-
AqualityServices.getApplication().quit();
19+
if (AqualityServices.isApplicationStarted()) {
20+
AqualityServices.getApplication().quit();
21+
}
2022
System.clearProperty("profile");
2123
}
2224
}

src/test/resources/settings.androidwebsession.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"pollingInterval": 300
3838
},
3939
"logger": {
40-
"language": "ru"
40+
"language": "en"
4141
},
4242
"elementCache": {
4343
"isEnabled": false

0 commit comments

Comments
 (0)