Skip to content

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

e2e tests: add ids

ammarahm-eda505a2ac4559
diff --git a/apps/mobile/e2e/tests/note.e2e.js b/apps/mobile/e2e/tests/note.e2e.js
index 16c83d7d7..ed4380f15 100644
--- a/apps/mobile/e2e/tests/note.e2e.js
+++ b/apps/mobile/e2e/tests/note.e2e.js
@@ -7,7 +7,10 @@ const {
prepare,
visibleById,
notVisibleById,
- elementById
+ elementById,
+ tapByText,
+ matchSnapshot,
+ elementByText
} = require('./utils');
const { sleep } = require('./utils');
diff --git a/apps/mobile/e2e/tests/utils.js b/apps/mobile/e2e/tests/utils.js
index 057ee4115..8f65ef278 100644
--- a/apps/mobile/e2e/tests/utils.js
+++ b/apps/mobile/e2e/tests/utils.js
@@ -55,9 +55,9 @@ export async function notVisibleByText(text) {
await expect(elementByText(text)).not.toBeVisible();
}
-export async function createNote() {
- let title = 'Test note description that ';
- let body = 'Test note description that is very long and should not fit in text.';
+export async function createNote(_title, _body) {
+ let title = _title || 'Test note description that ';
+ let body = _body || 'Test note description that is very long and should not fit in text.';
await tapById(notesnook.buttons.add);
await elementById(notesnook.editor.id).tap({
diff --git a/apps/mobile/e2e/tests/vault.e2e.js b/apps/mobile/e2e/tests/vault.e2e.js
index a72d35c88..a52855411 100644
--- a/apps/mobile/e2e/tests/vault.e2e.js
+++ b/apps/mobile/e2e/tests/vault.e2e.js
@@ -91,7 +91,7 @@ describe('VAULT', () => {
await visibleById(notesnook.listitem.menu);
});
- it.only('Delete vault with locked notes', async () => {
+ it('Delete vault with locked notes', async () => {
await prepare();
await createNote();
await lockNote();
diff --git a/apps/mobile/src/components/auth/signup.js b/apps/mobile/src/components/auth/signup.js
index 36ff805e0..4ca95f838 100644
--- a/apps/mobile/src/components/auth/signup.js
+++ b/apps/mobile/src/components/auth/signup.js
@@ -168,6 +168,7 @@ export const Signup = ({ changeMode, welcome, trial }) => {
onChangeText={value => {
email.current = value;
}}
+ testID="input.email"
onErrorCheck={e => setError(e)}
returnKeyLabel="Next"
returnKeyType="next"
@@ -187,6 +188,7 @@ export const Signup = ({ changeMode, welcome, trial }) => {
onChangeText={value => {
password.current = value;
}}
+ testID="input.password"
onErrorCheck={e => setError(e)}
returnKeyLabel="Next"
returnKeyType="next"
@@ -206,6 +208,7 @@ export const Signup = ({ changeMode, welcome, trial }) => {
onChangeText={value => {
confirmPassword.current = value;
}}
+ testID="input.confirmPassword"
onErrorCheck={e => setError(e)}
returnKeyLabel="Signup"
returnKeyType="done"
diff --git a/apps/mobile/src/components/header/rightmenus.js b/apps/mobile/src/components/header/rightmenus.js
index 99675cf42..28f8d6752 100644
--- a/apps/mobile/src/components/header/rightmenus.js
+++ b/apps/mobile/src/components/header/rightmenus.js
@@ -22,6 +22,7 @@ export const RightMenus = ({ currentScreen, action, rightButtons }) => {
menu: false
});
}}
+ testID="icon-search"
name="magnify"
color={colors.pri}
customStyle={styles.rightBtn}
diff --git a/apps/mobile/src/components/listitems/headers/sectionheader.js b/apps/mobile/src/components/listitems/headers/sectionheader.js
index 224fd5c78..6cd6b2a49 100644
--- a/apps/mobile/src/components/listitems/headers/sectionheader.js
+++ b/apps/mobile/src/components/listitems/headers/sectionheader.js
@@ -123,6 +123,7 @@ export const SectionHeader = React.memo(
width: 25,
height: 25
}}
+ testID="icon-compact-mode"
tooltipText={
listMode == 'compact' ? 'Switch to normal mode' : 'Switch to compact mode'
}
diff --git a/apps/mobile/src/screens/search/searchbar.js b/apps/mobile/src/screens/search/searchbar.js
index 5554f0b6c..3c2616b50 100644
--- a/apps/mobile/src/screens/search/searchbar.js
+++ b/apps/mobile/src/screens/search/searchbar.js
@@ -109,6 +109,7 @@ export const SearchBar = () => {
<TextInput
ref={inputRef}
+ testID="search-input"
style={{
fontSize: SIZE.md + 1,
fontFamily: 'OpenSans-Regular',
diff --git a/apps/mobile/src/screens/settings/index.js b/apps/mobile/src/screens/settings/index.js
index e025f7f33..fb115de8d 100644
--- a/apps/mobile/src/screens/settings/index.js
+++ b/apps/mobile/src/screens/settings/index.js
@@ -215,6 +215,7 @@ export const Settings = ({ navigation }) => {
screen: 'Settings'
})
}
+ testID="scrollview"
scrollEventThrottle={1}
style={{
paddingHorizontal: 0