Skip to content

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

update e2e tests

ammarahm-edbc59e245579c
diff --git a/apps/mobile/e2e/tests/index.e2e.js b/apps/mobile/e2e/tests/index.e2e.js
index 96fc38aac..7ca505fb1 100644
--- a/apps/mobile/e2e/tests/index.e2e.js
+++ b/apps/mobile/e2e/tests/index.e2e.js
@@ -7,7 +7,8 @@ const {
tapById,
elementById,
visibleByText,
- tapByText
+ tapByText,
+ elementByText
} = require('./misc.e2e');
const {sleep} = require('./utils.test');
@@ -32,21 +33,20 @@ describe('Basic tests', () => {
});
it('App should create a note successfully', async () => {
- await sleep(100);
+ let title = 'Test note description that ';
+ let body =
+ 'Test note description that is very long and should not fit in text.';
+
await tapById(notesnook.buttons.add);
- await sleep(200);
await elementById(notesnook.editor.id).tap({
x: 15,
y: 15
});
- await elementById(notesnook.editor.id).typeText('Test note description that is very long and should not fit in text.');
- await sleep(200);
+ await elementById(notesnook.editor.id).typeText(body);
await tapById(notesnook.editor.back);
- await sleep(300);
- await visibleByText('Test note description that ');
+ await expect(elementByText(title).atIndex(0)).toBeVisible();
+
await tapById(notesnook.ids.note.get(1));
await tapById(notesnook.editor.back);
});
-
-
});
diff --git a/apps/mobile/e2e/tests/misc.e2e.js b/apps/mobile/e2e/tests/misc.e2e.js
index 2370c7e31..e7f63226e 100644
--- a/apps/mobile/e2e/tests/misc.e2e.js
+++ b/apps/mobile/e2e/tests/misc.e2e.js
@@ -14,11 +14,11 @@ export async function LaunchApp() {
}
export function elementById(id) {
- return element(by.id(id));
+ return element(by.id(id)).atIndex(0);
}
export function elementByText(text) {
- return element(by.text(text));
+ return element(by.text(text)).atIndex(0)
}
export async function tapById(id) {