diff --git a/.github/workflows/android-emulator.yml b/.github/workflows/android-emulator.yml
new file mode 100644
index 00000000..7b67c50d
--- /dev/null
+++ b/.github/workflows/android-emulator.yml
@@ -0,0 +1,38 @@
+name: Android CI
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+jobs:
+ Build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+ - name: Build with Gradle
+ run: ./gradlew build
+ Espresso:
+ runs-on: macOS-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+ - name: Android Emulator test
+ uses: ReactiveCircus/android-emulator-runner@v2.8.0
+ with:
+ api-level: 28
+ disable-animations: true
+ arch: x86_64
+ profile: Nexus 6
+ script: ./gradlew cAT
+ - uses: actions/upload-artifact@v1
+ if: failure()
+ with:
+ name: Espresso-test-report
+ path: sample/build/reports/androidTests/connected/
diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml
new file mode 100644
index 00000000..f552c8dc
--- /dev/null
+++ b/.github/workflows/gradle-wrapper-validation.yml
@@ -0,0 +1,10 @@
+name: "Validate Gradle Wrapper"
+on: [push]
+
+jobs:
+ validation:
+ name: "Validation"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: gradle/wrapper-validation-action@v1
diff --git a/anychart/build.gradle b/anychart/build.gradle
index a571c2e8..76547b57 100644
--- a/anychart/build.gradle
+++ b/anychart/build.gradle
@@ -10,7 +10,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
-
+ multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
@@ -28,6 +28,7 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'com.android.support:multidex:1.0.3'
testImplementation 'junit:junit:4.12'
}
diff --git a/anychart/src/androidTest/java/com/anychart/anychart/ExampleInstrumentedTest.java b/anychart/src/androidTest/java/com/anychart/anychart/ExampleInstrumentedTest.java
deleted file mode 100644
index b02093ff..00000000
--- a/anychart/src/androidTest/java/com/anychart/anychart/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.anychart.anychart;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import static org.junit.Assert.*;
-
-/**
- * Instrumentation test, which will execute on an Android device.
- *
- * @see Testing documentation
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
- @Test
- public void useAppContext() throws Exception {
- // Context of the app under test.
- Context appContext = InstrumentationRegistry.getTargetContext();
-
- assertEquals("com.anychart.anychart.test", appContext.getPackageName());
- }
-}
diff --git a/anychart/src/test/java/com/anychart/anychart/ExampleUnitTest.java b/anychart/src/test/java/com/anychart/anychart/ExampleUnitTest.java
deleted file mode 100644
index 18ab070e..00000000
--- a/anychart/src/test/java/com/anychart/anychart/ExampleUnitTest.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.anychart.anychart;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see Testing documentation
- */
-public class ExampleUnitTest {
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
-}
\ No newline at end of file
diff --git a/sample/build.gradle b/sample/build.gradle
index 366d9158..da5d188f 100644
--- a/sample/build.gradle
+++ b/sample/build.gradle
@@ -33,6 +33,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":anychart")
+ implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
diff --git a/sample/src/androidTest/java/com/anychart/sample/MainActivityTest.java b/sample/src/androidTest/java/com/anychart/sample/MainActivityTest.java
index 4edde849..922eff2f 100644
--- a/sample/src/androidTest/java/com/anychart/sample/MainActivityTest.java
+++ b/sample/src/androidTest/java/com/anychart/sample/MainActivityTest.java
@@ -7,6 +7,7 @@
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -29,6 +30,12 @@ public class MainActivityTest {
public ActivityTestRule activityRule = new ActivityTestRule<>(
MainActivity.class, false, true);
+
+ @After
+ public void onEndTest() {
+ pressBack();
+ }
+
@Test
public void pieChartTest() {
onView(withId(R.id.recycler_view))
@@ -41,8 +48,6 @@ public void pieChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1s")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1t")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -61,8 +66,6 @@ public void columnChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_16")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_17")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -75,8 +78,6 @@ public void lineChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_20")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1m")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -88,8 +89,6 @@ public void areaChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_23")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_24")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -120,8 +119,6 @@ public void barChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_3q")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_3r")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -137,8 +134,6 @@ public void vennDiagramTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_a")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_x")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -173,8 +168,6 @@ public void heatMapChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_rect_1i")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_rect_1j")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -187,8 +180,6 @@ public void tagCloudTest() {
onWebView().withElement(findElement(Locator.ID, "ac_simple-text_s")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_simple-text_2a")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -212,8 +203,6 @@ public void waterfallChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1s")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1t")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -237,8 +226,6 @@ public void treeMapChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_rect_12")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_rect_13")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -253,8 +240,6 @@ public void circularGaugeTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_e")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_f")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -264,8 +249,6 @@ public void thermometerTest() {
onWebView().withElement(findElement(Locator.ID, "container")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -275,8 +258,6 @@ public void linearColorScaleTest() {
onWebView().withElement(findElement(Locator.ID, "container")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -287,8 +268,6 @@ public void windSpeedTest() {
onWebView().withElement(findElement(Locator.ID, "container")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1l")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -299,8 +278,6 @@ public void windDirectionTest() {
onWebView().withElement(findElement(Locator.ID, "container")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_y")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -312,8 +289,6 @@ public void scatterChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_13")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_6a")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -326,8 +301,6 @@ public void resourceChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_7")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_9")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -340,8 +313,6 @@ public void radarChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_2k")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_22")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -354,8 +325,6 @@ public void polarChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_2a")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_2d")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -376,8 +345,6 @@ public void rangeChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_31")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_30")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -404,8 +371,6 @@ public void verticalChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1l")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1m")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -420,8 +385,6 @@ public void funnelChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_k")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_l")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -447,8 +410,6 @@ public void pertChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1h")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1a")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -460,8 +421,6 @@ public void combinedChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1u")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1x")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -478,8 +437,6 @@ public void bubbleChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_circle_2r")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_circle_3u")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -491,8 +448,6 @@ public void paretoChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_2k")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_2l")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -506,8 +461,6 @@ public void pyramidChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_r")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_i")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -526,8 +479,6 @@ public void boxChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1p")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1t")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -540,8 +491,6 @@ public void mosaicChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1o")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1p")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -557,8 +506,6 @@ public void mekkoChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_1b")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_1a")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -580,8 +527,6 @@ public void bar3DChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_3n")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_4b")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -602,8 +547,6 @@ public void column3DChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_2w")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_6r")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -615,8 +558,6 @@ public void area3DChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_2j")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_23")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -628,8 +569,6 @@ public void hiloChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_2b")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_3b")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -639,8 +578,6 @@ public void ohlcChartTest() {
onWebView().withElement(findElement(Locator.ID, "container")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -659,8 +596,6 @@ public void quadrantChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_d")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_f")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -677,8 +612,6 @@ public void sunburstChartTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_5")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_5")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -700,8 +633,6 @@ public void bubbleMapTest() {
onWebView().withElement(findElement(Locator.ID, "ac_circle_11")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_circle_x")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -717,8 +648,6 @@ public void choroplethMapTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_10")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_s")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -735,8 +664,6 @@ public void pointMapTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_25")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_26")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
@Test
@@ -751,8 +678,6 @@ public void connectorMapTest() {
onWebView().withElement(findElement(Locator.ID, "ac_path_7l")).perform(webClick());
onWebView().withElement(findElement(Locator.ID, "ac_path_7m")).perform(webClick());
onView(withId(R.id.web_view)).check(matches(isEnabled()));
-
- pressBack();
}
}
diff --git a/sample/src/test/java/com/anychart/sample/ExampleUnitTest.java b/sample/src/test/java/com/anychart/sample/ExampleUnitTest.java
deleted file mode 100644
index 9c974d6c..00000000
--- a/sample/src/test/java/com/anychart/sample/ExampleUnitTest.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.anychart.sample;
-
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see Testing documentation
- */
-public class ExampleUnitTest {
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
-}
\ No newline at end of file