Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix test environment for android

ammarahm-ed692469e23b08
diff --git a/apps/mobile/.detoxrc.json b/apps/mobile/.detoxrc.json
index b471d8f19..089cf53cb 100644
--- a/apps/mobile/.detoxrc.json
+++ b/apps/mobile/.detoxrc.json
@@ -16,7 +16,7 @@
"build": "cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.attached",
"device":{
- "avdName":"LMG710ULM3d3678f0"
+ "adbName":"LMG710ULM3d3678f0"
}
},
"android.emu.release": {
diff --git a/apps/mobile/e2e/config.json b/apps/mobile/e2e/config.json
index 3b46bde78..ee9e70105 100644
--- a/apps/mobile/e2e/config.json
+++ b/apps/mobile/e2e/config.json
@@ -2,9 +2,8 @@
"testEnvironment": "./environment",
"testRunner": "jest-circus/runner",
"testTimeout": 120000,
- "testRegex": "notes.e2e.js",
+ "testRegex": "\\index.e2e\\.js$",
"reporters": ["detox/runners/jest/streamlineReporter"],
"verbose": true
-
}
diff --git a/apps/mobile/e2e/environment.js b/apps/mobile/e2e/environment.js
index ad46bec5f..fdb44f8c0 100644
--- a/apps/mobile/e2e/environment.js
+++ b/apps/mobile/e2e/environment.js
@@ -5,8 +5,8 @@ const {
} = require('detox/runners/jest-circus');
class CustomDetoxEnvironment extends DetoxCircusEnvironment {
- constructor(config) {
- super(config);
+ constructor(config, context) {
+ super(config, context);
// Can be safely removed, if you are content with the default value (=300000ms)
this.initTimeout = 300000;
@@ -20,4 +20,4 @@ class CustomDetoxEnvironment extends DetoxCircusEnvironment {
}
}
-module.exports = CustomDetoxEnvironment;
+module.exports = CustomDetoxEnvironment;
\ No newline at end of file
diff --git a/apps/mobile/e2e/tests/index.e2e.js b/apps/mobile/e2e/tests/index.e2e.js
index e69de29bb..aaeb013f7 100644
--- a/apps/mobile/e2e/tests/index.e2e.js
+++ b/apps/mobile/e2e/tests/index.e2e.js
@@ -0,0 +1,9 @@
+const { notesnook } = require("../test.ids");
+const { sleep } = require("./utils.test");
+
+it('App initialization', async () => {
+ device.launchApp();
+ console.log('sleeping after launch');
+ await sleep(5000);
+ await expect(element(by.id(notesnook.ids.default.root))).toBeVisible();
+});
\ No newline at end of file