Skip to content

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

added some test ids

ammarahm-edb9dcb6715f7b
diff --git a/apps/mobile/e2e/firstTest.e2e.js b/apps/mobile/e2e/firstTest.e2e.js
index ac7564883..4d1bf69e3 100644
--- a/apps/mobile/e2e/firstTest.e2e.js
+++ b/apps/mobile/e2e/firstTest.e2e.js
@@ -1,12 +1,57 @@
-const {sleep} = require('./utils');
+const sleep = (duration) =>
+ new Promise((resolve) => setTimeout(() => resolve(), duration));
-it('Check if app is loaded', async () => {
+let menu;
+
+it('CHECK APP LOADED', async () => {
await expect(element(by.id('mobile_main_view'))).toBeVisible();
});
-it('Check if editor can be opened', async () => {
- await expect(element(by.id('container_bottom_btn_text'))).toBeVisible();
- await element(by.id('container_bottom_btn')).tap();
+it('CHECK MENU NAVIGATION', async () => {
+ menu = element(by.id('left_menu_button'));
+ menu.tap();
+ await sleep(200);
+ element(by.id('Notebooks')).tap();
+ menu.tap();
+ await sleep(200);
+ element(by.id('Favorites')).tap();
+ menu.tap();
+ await sleep(200);
+ element(by.id('Trash')).tap();
+ menu.tap();
+ await sleep(200);
+ element(by.text('Tags')).tap();
+ menu.tap();
+ await sleep(200);
+ element(by.id('Settings')).tap();
+ menu.tap();
+ await sleep(200);
+
+});
+
+it('CHECK NIGHT MODE SWITCHING', async () => {
+ element(by.id('night_mode')).tap();
await sleep(2000);
- await expect(element(by.id('editor'))).toBeVisible();
+ element(by.id('night_mode')).tap();
+
+});
+
+
+
+
+
+
+
+/* it('Check if editor can be opened and edited', async () => {
+ await expect(element(by.id('container_bottom_btn'))).toBeVisible();
+ await sleep(200);
+ await element(by.id('container_bottom_btn')).tap();
+ await sleep(1000);
+
+ const editor = element(by.id('editor'));
+ await expect(editor).toBeVisible();
+ await editor.tap();
+ await sleep(200);
+ await editor.typeText('hello world, this an automated note creation');
});
+ */
\ No newline at end of file
diff --git a/apps/mobile/src/components/ActionIcon/index.js b/apps/mobile/src/components/ActionIcon/index.js
index 2df366ba1..e052693f9 100644
--- a/apps/mobile/src/components/ActionIcon/index.js
+++ b/apps/mobile/src/components/ActionIcon/index.js
@@ -13,12 +13,14 @@ export const ActionIcon = ({
iconStyle = {},
left = 10,
right = 10,
+ testID,
}) => {
const [state, dispatch] = useTracked();
const {colors} = state;
return (
<PressableButton
+ testID={testID}
onPress={onPress}
hitSlop={{top: 30, left: left, right: right, bottom: 30}}
color="transparent"
diff --git a/apps/mobile/src/components/Menu/MenuListItem.js b/apps/mobile/src/components/Menu/MenuListItem.js
index f0acac351..2a4385aa6 100644
--- a/apps/mobile/src/components/Menu/MenuListItem.js
+++ b/apps/mobile/src/components/Menu/MenuListItem.js
@@ -9,7 +9,7 @@ import { eClearSearch } from '../../services/events';
import NavigationService from '../../services/NavigationService';
import { PressableButton } from '../PressableButton';
-export const MenuListItem = ({item, index, noTextMode, ignore}) => {
+export const MenuListItem = ({item, index, noTextMode, ignore,testID}) => {
const [state, dispatch] = useTracked();
const {currentScreen, colors} = state;
@@ -32,6 +32,7 @@ export const MenuListItem = ({item, index, noTextMode, ignore}) => {
return (
<PressableButton
+ testID={testID}
key={item.name + index}
onPress={_onPress}
color={
diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js
index 570326082..78352741e 100644
--- a/apps/mobile/src/components/Menu/index.js
+++ b/apps/mobile/src/components/Menu/index.js
@@ -162,6 +162,7 @@ export const Menu = ({
showsVerticalScrollIndicator={false}>
{listItems.map((item, index) => (
<MenuListItem
+ testID={item.name}
key={item.name}
item={item}
index={index}
@@ -171,6 +172,7 @@ export const Menu = ({
<MenuListItem
key="Tags"
+ testID="Tags"
noTextMode={noTextMode}
index={10}
item={{
@@ -201,6 +203,7 @@ export const Menu = ({
}}>
{listItems2.map((item, index) => (
<MenuListItem
+ testID={item.name == "Night mode" ? "night_mode" : item.name}
key={item.name}
item={item}
index={index}
diff --git a/apps/mobile/src/components/PressableButton/index.js b/apps/mobile/src/components/PressableButton/index.js
index 792ea8e05..67edeefcf 100644
--- a/apps/mobile/src/components/PressableButton/index.js
+++ b/apps/mobile/src/components/PressableButton/index.js
@@ -1,7 +1,7 @@
-import React, {useState} from 'react';
-import {Platform, Pressable} from 'react-native';
-import {br, opacity} from '../../common/common';
-import {RGB_Linear_Shade, hexToRGBA} from '../../utils/utils';
+import React from 'react';
+import {Pressable} from 'react-native';
+import {br} from '../../common/common';
+import {hexToRGBA, RGB_Linear_Shade} from '../../utils/utils';
export const PressableButton = ({
color,
@@ -15,7 +15,7 @@ export const PressableButton = ({
opacity = 1,
onLongPress,
hitSlop,
- testID
+ testID,
}) => {
return (
<Pressable
diff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.js
index b44686906..8a8d24356 100644
--- a/apps/mobile/src/components/header/index.js
+++ b/apps/mobile/src/components/header/index.js
@@ -60,6 +60,7 @@ export const Header = ({showSearch, root}) => {
<View style={styles.leftBtnContainer}>
{!DDS.isTab ? (
<ActionIcon
+ testID="left_menu_button"
customStyle={styles.leftBtn}
onPress={onLeftButtonPress}
name={headerState.canGoBack ? 'arrow-left' : 'menu'}
diff --git a/apps/mobile/src/views/Editor/func.js b/apps/mobile/src/views/Editor/func.js
index d89cc01fa..a39111fb0 100644
--- a/apps/mobile/src/views/Editor/func.js
+++ b/apps/mobile/src/views/Editor/func.js
@@ -72,7 +72,6 @@ export function checkNote() {
export async function loadNote(item) {
editing.currentlyEditing = true;
- console.log('called');
updateEvent({type: ACTIONS.NOTES});
if (item && item.type === 'new') {
await clearEditor();