mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
mobile: refactor e2e tests
Uses a builder pattern for writing tests to reduce code and simplify writing tests
This commit is contained in:
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { authenticator } from "otplib";
|
||||
import { Tests } from "./utils";
|
||||
import { TestBuilder } from "./utils";
|
||||
|
||||
import dotenv from "dotenv";
|
||||
import path from "path";
|
||||
@@ -34,20 +34,6 @@ const USER = {
|
||||
}
|
||||
};
|
||||
|
||||
async function login() {
|
||||
await Tests.fromText("Login to encrypt and sync notes").tap();
|
||||
await Tests.fromId("input.email").element.typeText(USER.login.email!);
|
||||
await Tests.fromText("Continue").tap();
|
||||
await Tests.sleep(3000);
|
||||
await Tests.fromId("input.totp").element.typeText(
|
||||
authenticator.generate(USER.login.totpSecret!)
|
||||
);
|
||||
await Tests.fromText("Next").tap();
|
||||
await Tests.sleep(3000);
|
||||
await Tests.fromId("input.password").element.typeText(USER.login.password!);
|
||||
await Tests.fromId("input.password").element.tapReturnKey();
|
||||
}
|
||||
|
||||
// async function deleteAccount() {
|
||||
// await tapByText("Account Settings");
|
||||
// await sleep(2000);
|
||||
@@ -67,11 +53,27 @@ async function login() {
|
||||
// await elementById("input.confirmPassword").tapReturnKey();
|
||||
// }
|
||||
|
||||
async function login() {
|
||||
await TestBuilder.create()
|
||||
.waitAndTapByText("Login to encrypt and sync notes")
|
||||
.typeTextById("input.email", USER.login.email!)
|
||||
.tapReturnKeyById("input.email")
|
||||
.wait(3000)
|
||||
.typeTextById("input.totp", authenticator.generate(USER.login.totpSecret!))
|
||||
.waitAndTapByText("Next")
|
||||
.wait(3000)
|
||||
.typeTextById("input.password", USER.login.password!)
|
||||
.tapReturnKeyById("input.password")
|
||||
.run();
|
||||
}
|
||||
|
||||
describe("AUTH", () => {
|
||||
it("Login", async () => {
|
||||
await Tests.prepare();
|
||||
await login();
|
||||
await Tests.sleep(10000);
|
||||
await Tests.fromText("Login to encrypt and sync notes").isNotVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.addStep(login)
|
||||
.wait(3000)
|
||||
.isNotVisibleByText("Notesnook Plans")
|
||||
.run();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/*
|
||||
This file is part of the Notesnook project (https://notesnook.com/)
|
||||
|
||||
Copyright (C) 2023 Streetwriters (Private) Limited
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { notesnook } from "../test.ids";
|
||||
import { TestBuilder } from "./utils";
|
||||
|
||||
|
||||
@@ -18,266 +18,209 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { notesnook } from "../test.ids";
|
||||
import { Tests } from "./utils";
|
||||
import { TestBuilder } from "./utils";
|
||||
|
||||
describe("NOTEBOOKS", () => {
|
||||
it("Create a notebook with title only", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
await Tests.createNotebook("Notebook 1", false);
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", false)
|
||||
.wait(500)
|
||||
.isVisibleByText("Notebook 1")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Create a notebook title & description", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
await Tests.createNotebook("Notebook 1", true);
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
it("Create a notebook with title & description", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", true)
|
||||
.wait(500)
|
||||
.isVisibleByText("Notebook 1")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Add a sub notebook to a notebook", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
await Tests.createNotebook("Notebook 1", true);
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Notebook 1").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Add notebook").waitAndTap();
|
||||
await Tests.createNotebook("Sub notebook", true);
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId("expand-notebook-0").waitAndTap();
|
||||
await Tests.fromText("Sub notebook").isVisible();
|
||||
await Tests.fromText("Sub notebook").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Move to trash").waitAndTap();
|
||||
await Tests.fromText("Delete").waitAndTap();
|
||||
await Tests.fromText("Sub notebook").isNotVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", true)
|
||||
.wait(500)
|
||||
.longPressByText("Notebook 1")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Add notebook")
|
||||
.createNotebook("Sub notebook", true)
|
||||
.wait(500)
|
||||
.waitAndTapById("expand-notebook-0")
|
||||
.isVisibleByText("Sub notebook")
|
||||
.longPressByText("Sub notebook")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Move to trash")
|
||||
.waitAndTapByText("Delete")
|
||||
.isNotVisibleByText("Sub notebook")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Edit notebook", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
await Tests.createNotebook("Notebook 1", true);
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Notebook 1").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Edit notebook").waitAndTap();
|
||||
await Tests.fromId(
|
||||
notesnook.ids.dialogs.notebook.inputs.title
|
||||
).element.typeText(" (edited)");
|
||||
await Tests.fromText("Save").waitAndTap();
|
||||
await Tests.fromText("Notebook 1 (edited)").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", true)
|
||||
.wait(500)
|
||||
.longPressByText("Notebook 1")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Edit notebook")
|
||||
.typeTextById(notesnook.ids.dialogs.notebook.inputs.title, " (edited)")
|
||||
.waitAndTapByText("Save")
|
||||
.isVisibleByText("Notebook 1 (edited)")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Edit a sub notebook", async () => {
|
||||
await Tests.prepare();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
await Tests.createNotebook("Notebook 1", true);
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromText("Notebook 1").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Add notebook").waitAndTap();
|
||||
|
||||
await Tests.createNotebook("Sub notebook", true);
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromId("expand-notebook-0").waitAndTap();
|
||||
await Tests.fromText("Sub notebook").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Edit notebook").waitAndTap();
|
||||
await Tests.fromId(
|
||||
notesnook.ids.dialogs.notebook.inputs.title
|
||||
).element.typeText(" (edited)");
|
||||
await Tests.fromText("Save").waitAndTap();
|
||||
await Tests.fromText("Sub notebook (edited)").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", true)
|
||||
.wait(500)
|
||||
.longPressByText("Notebook 1")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Add notebook")
|
||||
.createNotebook("Sub notebook", true)
|
||||
.wait(500)
|
||||
.waitAndTapById("expand-notebook-0")
|
||||
.longPressByText("Sub notebook")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Edit notebook")
|
||||
.typeTextById(notesnook.ids.dialogs.notebook.inputs.title, " (edited)")
|
||||
.waitAndTapByText("Save")
|
||||
.isVisibleByText("Sub notebook (edited)")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Add a note to notebook", async () => {
|
||||
await Tests.prepare();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.createNotebook("Notebook 1", true);
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromText("Notebook 1").waitAndTap();
|
||||
await Tests.createNote();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", true)
|
||||
.wait(500)
|
||||
.waitAndTapByText("Notebook 1")
|
||||
.createNote()
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Remove note from Notebook", async () => {
|
||||
await Tests.prepare();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.createNotebook("Notebook 1", true);
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromText("Notebook 1").waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
let note = await Tests.createNote();
|
||||
await Tests.fromText(note.body).element.longPress();
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromId("select-minus").waitAndTap();
|
||||
await Tests.fromId(note.title).isNotVisible();
|
||||
it.only("Remove note from notebook", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", true)
|
||||
.wait(500)
|
||||
.waitAndTapByText("Notebook 1")
|
||||
.wait(500)
|
||||
.createNote()
|
||||
.saveResult()
|
||||
.processResult(async (note) => {
|
||||
await TestBuilder.create()
|
||||
.longPressByText(note.body)
|
||||
.wait(500)
|
||||
.waitAndTapById("select-minus")
|
||||
.isNotVisibleById(note.title)
|
||||
.run();
|
||||
})
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Add/Remove note to notebook from home", async () => {
|
||||
await Tests.prepare();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.createNotebook("Notebook 1", true);
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId("tab-home").waitAndTap();
|
||||
|
||||
await Tests.fromText("Notes").waitAndTap();
|
||||
await Tests.createNote();
|
||||
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromId("icon-notebooks").waitAndTap();
|
||||
await Tests.fromText("Notebook 1").waitAndTap();
|
||||
|
||||
await Tests.fromId("floating-save-button").waitAndTap();
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", true)
|
||||
.wait(500)
|
||||
.waitAndTapById("tab-home")
|
||||
.waitAndTapByText("Notes")
|
||||
.createNote()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait(500)
|
||||
.waitAndTapById("icon-notebooks")
|
||||
.waitAndTapByText("Notebook 1")
|
||||
.waitAndTapById("floating-save-button")
|
||||
.isVisibleByText("Notebook 1")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Edit notebook title, description", async () => {
|
||||
await Tests.prepare();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.createNotebook();
|
||||
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
|
||||
await Tests.fromText("Notebook 1").element.longPress();
|
||||
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Edit notebook").waitAndTap();
|
||||
await Tests.fromId(
|
||||
notesnook.ids.dialogs.notebook.inputs.title
|
||||
).element.typeText(" (Edited)");
|
||||
await Tests.fromId(
|
||||
notesnook.ids.dialogs.notebook.inputs.description
|
||||
).element.clearText();
|
||||
await Tests.fromId(
|
||||
notesnook.ids.dialogs.notebook.inputs.description
|
||||
).element.typeText("Description of Notebook 1 (Edited)");
|
||||
await Tests.fromText("Save").waitAndTap();
|
||||
await Tests.fromText("Notebook 1 (Edited)").isVisible();
|
||||
it("Edit notebook title and description", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook()
|
||||
.wait(500)
|
||||
.isVisibleByText("Notebook 1")
|
||||
.longPressByText("Notebook 1")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Edit notebook")
|
||||
.typeTextById(notesnook.ids.dialogs.notebook.inputs.title, " (Edited)")
|
||||
.clearTextById(notesnook.ids.dialogs.notebook.inputs.description)
|
||||
.typeTextById(
|
||||
notesnook.ids.dialogs.notebook.inputs.description,
|
||||
"Description of Notebook 1 (Edited)"
|
||||
)
|
||||
.waitAndTapByText("Save")
|
||||
.isVisibleByText("Notebook 1 (Edited)")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Move notebook to trash", async () => {
|
||||
await Tests.prepare();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.createNotebook("Notebook 1", false);
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
|
||||
await Tests.fromText("Notebook 1").element.longPress();
|
||||
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Move to trash").waitAndTap();
|
||||
await Tests.fromText("Delete").waitAndTap();
|
||||
|
||||
await Tests.fromId("tab-home").waitAndTap();
|
||||
|
||||
await Tests.fromText("Trash").waitAndTap();
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
});
|
||||
|
||||
it.skip("Move notebook to trash with notes", async () => {
|
||||
await Tests.prepare();
|
||||
let note = await Tests.createNote();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.createNotebook("Notebook 1", false);
|
||||
await device.pressBack();
|
||||
await Tests.fromId(notesnook.ids.note.get(0)).element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId("select-plus").waitAndTap();
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
await Tests.fromText("Notebook 1").waitAndTap();
|
||||
await Tests.fromId("floating-save-button").waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-home").waitAndTap();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
await Tests.fromText("Notebook 1").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Move to trash").waitAndTap();
|
||||
await Tests.fromText(
|
||||
"Move all notes in this notebook to trash"
|
||||
).waitAndTap();
|
||||
await Tests.fromText("Delete").waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId("tab-home").waitAndTap();
|
||||
|
||||
await Tests.fromText("Trash").waitAndTap();
|
||||
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
await Tests.fromText(note.body).isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", false)
|
||||
.wait(500)
|
||||
.isVisibleByText("Notebook 1")
|
||||
.longPressByText("Notebook 1")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Move to trash")
|
||||
.waitAndTapByText("Delete")
|
||||
.waitAndTapById("tab-home")
|
||||
.waitAndTapByText("Trash")
|
||||
.isVisibleByText("Notebook 1")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Pin notebook to side menu", async () => {
|
||||
await Tests.prepare();
|
||||
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-notebooks").waitAndTap();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.createNotebook("Notebook 1", false);
|
||||
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
|
||||
await Tests.fromText("Notebook 1").element.longPress();
|
||||
|
||||
await Tests.sleep(500);
|
||||
|
||||
await Tests.fromId("icon-add-shortcut").waitAndTap();
|
||||
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId("tab-home").waitAndTap();
|
||||
|
||||
await Tests.fromText("Notebook 1").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-notebooks")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.createNotebook("Notebook 1", false)
|
||||
.wait(500)
|
||||
.isVisibleByText("Notebook 1")
|
||||
.longPressByText("Notebook 1")
|
||||
.wait(500)
|
||||
.waitAndTapById("icon-add-shortcut")
|
||||
.wait(500)
|
||||
.waitAndTapById("tab-home")
|
||||
.isVisibleByText("Notebook 1")
|
||||
.run();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,15 +17,17 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Tests } from "./utils";
|
||||
import { TestBuilder } from "./utils";
|
||||
|
||||
describe("Search", () => {
|
||||
it("Search for a note", async () => {
|
||||
await Tests.prepare();
|
||||
let note = await Tests.createNote();
|
||||
await Tests.fromId("search-header").waitAndTap();
|
||||
await Tests.fromId("search-input").element.typeText("Test");
|
||||
await Tests.sleep(1000);
|
||||
await Tests.fromText("1").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.waitAndTapById("search-header")
|
||||
.typeTextById("search-input", "Test")
|
||||
.wait(1000)
|
||||
.isVisibleByText("1")
|
||||
.run();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,74 +18,99 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { notesnook } from "../test.ids";
|
||||
import { Tests } from "./utils";
|
||||
|
||||
async function sortBy(sorting: string) {
|
||||
await Tests.fromId("icon-sort").waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText(sorting).waitAndTap();
|
||||
await device.pressBack();
|
||||
}
|
||||
import { TestBuilder } from "./utils";
|
||||
|
||||
describe("Sort & filter", () => {
|
||||
it("Sort by date-edited/date-created", async () => {
|
||||
await Tests.prepare();
|
||||
let webview = web();
|
||||
await Tests.createNote("Note 1", "Note 1");
|
||||
await Tests.createNote("Note 2", "Note 2");
|
||||
await Tests.fromText("Note 1").waitAndTap();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Note 1", "Note 1")
|
||||
.createNote("Note 2", "Note 2")
|
||||
.waitAndTapByText("Note 1")
|
||||
.addStep(async () => {
|
||||
const webview = web();
|
||||
await webview.element(by.web.className("ProseMirror")).tap();
|
||||
await webview
|
||||
.element(by.web.className("ProseMirror"))
|
||||
.typeText("Edited ", true);
|
||||
await device.pressBack();
|
||||
await sortBy("Date created");
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await device.pressBack();
|
||||
await sortBy("Date edited");
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await device.pressBack();
|
||||
})
|
||||
.pressBack()
|
||||
.waitAndTapById("icon-sort")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Date created")
|
||||
.pressBack()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.pressBack()
|
||||
.waitAndTapById("icon-sort")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Date edited")
|
||||
.pressBack()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Disable grouping", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote("Note 1", "Note 1");
|
||||
await sortBy("None");
|
||||
await Tests.fromText("ALL").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Note 1", "Note 1")
|
||||
.waitAndTapById("icon-sort")
|
||||
.wait(500)
|
||||
.waitAndTapByText("None")
|
||||
.pressBack()
|
||||
.isVisibleByText("ALL")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Group by Abc", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote("Note 1", "Note 1");
|
||||
await sortBy("Abc");
|
||||
await Tests.fromText("N").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Note 1", "Note 1")
|
||||
.waitAndTapById("icon-sort")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Abc")
|
||||
.pressBack()
|
||||
.isVisibleByText("N")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Group by Year", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote("Note 1", "Note 1");
|
||||
await sortBy("Year");
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Note 1", "Note 1")
|
||||
.waitAndTapById("icon-sort")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Year")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Group by Week", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote("Note 1", "Note 1");
|
||||
await sortBy("Week");
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Note 1", "Note 1")
|
||||
.waitAndTapById("icon-sort")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Week")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Group by Month", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote("Note 1", "Note 1");
|
||||
await sortBy("Month");
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Note 1", "Note 1")
|
||||
.waitAndTapById("icon-sort")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Month")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Compact mode", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote("Note 1", "Note 1");
|
||||
await Tests.fromId("icon-compact-mode").waitAndTap();
|
||||
await Tests.fromText("Note 1").isNotVisible();
|
||||
await Tests.fromId("icon-compact-mode").waitAndTap();
|
||||
await Tests.fromText("Note 1").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote("Note 1", "Note 1")
|
||||
.waitAndTapById("icon-compact-mode")
|
||||
.isNotVisibleByText("Note 1")
|
||||
.waitAndTapById("icon-compact-mode")
|
||||
.isVisibleByText("Note 1")
|
||||
.run();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,95 +18,101 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { notesnook } from "../test.ids";
|
||||
import { Tests } from "./utils";
|
||||
import { TestBuilder } from "./utils";
|
||||
|
||||
describe("Tags", () => {
|
||||
it("Create a tag", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-tags").waitAndTap();
|
||||
|
||||
await Tests.fromText("No tags").isVisible();
|
||||
await Tests.fromId("sidebar-add-button").waitAndTap();
|
||||
|
||||
await Tests.fromId("input-value").element.typeText("testtag");
|
||||
|
||||
await Tests.fromText("Add").waitAndTap();
|
||||
await Tests.fromText("testtag").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-tags")
|
||||
.isVisibleByText("No tags")
|
||||
.waitAndTapById("sidebar-add-button")
|
||||
.typeTextById("input-value", "testtag")
|
||||
.waitAndTapByText("Add")
|
||||
.isVisibleByText("testtag")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Tag a note", async () => {
|
||||
await Tests.prepare();
|
||||
let note = await Tests.createNote();
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Add tag").waitAndTap();
|
||||
await Tests.fromId("tag-input").element.typeText("testtag");
|
||||
await Tests.fromText('Add "#testtag"').waitAndTap();
|
||||
await Tests.fromText("#testtag").isVisible();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-tags").waitAndTap();
|
||||
await Tests.fromText("#testtag").waitAndTap();
|
||||
await Tests.fromText(note.body).isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.saveResult()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait(500)
|
||||
.waitAndTapByText("Add tag")
|
||||
.typeTextById("tag-input", "testtag")
|
||||
.waitAndTapByText('Add "#testtag"')
|
||||
.isVisibleByText("#testtag")
|
||||
.pressBack(2)
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-tags")
|
||||
.waitAndTapByText("#testtag")
|
||||
.processResult(async (note) => {
|
||||
await TestBuilder.create().isVisibleByText(note.body).run();
|
||||
})
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Untag a note", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Add tag").waitAndTap();
|
||||
await Tests.fromId("tag-input").element.typeText("testtag");
|
||||
await Tests.fromText('Add "#testtag"').waitAndTap();
|
||||
await Tests.fromText("#testtag").isVisible();
|
||||
await Tests.fromText("#testtag").waitAndTap();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await Tests.fromText("#testtag").isNotVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait(500)
|
||||
.waitAndTapByText("Add tag")
|
||||
.typeTextById("tag-input", "testtag")
|
||||
.waitAndTapByText('Add "#testtag"')
|
||||
.isVisibleByText("#testtag")
|
||||
.waitAndTapByText("#testtag")
|
||||
.pressBack(2)
|
||||
.isNotVisibleByText("#testtag")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Create shortcut of a tag", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Add tag").waitAndTap();
|
||||
await Tests.fromId("tag-input").element.typeText("testtag");
|
||||
await Tests.fromText('Add "#testtag"').waitAndTap();
|
||||
await Tests.fromText("#testtag").isVisible();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-tags").waitAndTap();
|
||||
await Tests.fromText("testtag").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Add shortcut").waitAndTap();
|
||||
await Tests.fromId("tab-home").waitAndTap();
|
||||
await Tests.fromText("testtag").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait(500)
|
||||
.waitAndTapByText("Add tag")
|
||||
.typeTextById("tag-input", "testtag")
|
||||
.waitAndTapByText('Add "#testtag"')
|
||||
.isVisibleByText("#testtag")
|
||||
.pressBack(2)
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-tags")
|
||||
.longPressByText("testtag")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Add shortcut")
|
||||
.waitAndTapById("tab-home")
|
||||
.isVisibleByText("testtag")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Rename a tag", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Add tag").waitAndTap();
|
||||
await Tests.fromId("tag-input").element.typeText("testtag");
|
||||
await Tests.fromText('Add "#testtag"').waitAndTap();
|
||||
await Tests.fromText("#testtag").isVisible();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("tab-tags").waitAndTap();
|
||||
await Tests.fromText("testtag").element.longPress();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Rename").waitAndTap();
|
||||
await Tests.sleep(100);
|
||||
await Tests.fromId("input-value").element.clearText();
|
||||
await Tests.fromId("input-value").element.typeText("testtag_edited");
|
||||
await Tests.fromText("Save").waitAndTap();
|
||||
await Tests.fromText("testtag_edited").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait(500)
|
||||
.waitAndTapByText("Add tag")
|
||||
.typeTextById("tag-input", "testtag")
|
||||
.waitAndTapByText('Add "#testtag"')
|
||||
.isVisibleByText("#testtag")
|
||||
.pressBack(2)
|
||||
.openSideMenu()
|
||||
.waitAndTapById("tab-tags")
|
||||
.longPressByText("testtag")
|
||||
.wait(500)
|
||||
.waitAndTapByText("Rename")
|
||||
.wait(100)
|
||||
.clearTextById("input-value")
|
||||
.typeTextById("input-value", "testtag_edited")
|
||||
.waitAndTapByText("Save")
|
||||
.isVisibleByText("testtag_edited")
|
||||
.run();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -171,7 +171,7 @@ class TestBuilder {
|
||||
});
|
||||
}
|
||||
|
||||
wait(duration: number) {
|
||||
wait(duration = 500) {
|
||||
return this.addStep(async () => {
|
||||
await Tests.sleep(duration);
|
||||
});
|
||||
@@ -280,6 +280,13 @@ class TestBuilder {
|
||||
});
|
||||
}
|
||||
|
||||
tapReturnKeyById(id: string) {
|
||||
return this.addStep(async () => {
|
||||
const element = new Element("id", id);
|
||||
await element.element.tapReturnKey();
|
||||
});
|
||||
}
|
||||
|
||||
tapByText(text: string, point?: Detox.Point2D) {
|
||||
return this.addStep(async () => {
|
||||
const element = new Element("text", text);
|
||||
@@ -303,6 +310,12 @@ class TestBuilder {
|
||||
});
|
||||
}
|
||||
|
||||
clearTextById(id: string) {
|
||||
return this.addStep(async () => {
|
||||
await Element.fromId(id).element.clearText();
|
||||
});
|
||||
}
|
||||
|
||||
pressBack(count = 1) {
|
||||
return this.addStep(async () => {
|
||||
for (let i = 0; i < count; i++) {
|
||||
@@ -311,6 +324,20 @@ class TestBuilder {
|
||||
});
|
||||
}
|
||||
|
||||
longPressByText(text: string) {
|
||||
return this.addStep(async () => {
|
||||
const element = new Element("text", text);
|
||||
await element.element.longPress();
|
||||
});
|
||||
}
|
||||
|
||||
longPressById(id: string) {
|
||||
return this.addStep(async () => {
|
||||
const element = new Element("id", id);
|
||||
await element.element.longPress();
|
||||
});
|
||||
}
|
||||
|
||||
async run() {
|
||||
for (const step of this.steps) {
|
||||
const result = step.call(this);
|
||||
|
||||
@@ -18,134 +18,133 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { expect } from "detox";
|
||||
import { notesnook } from "../test.ids";
|
||||
import { Tests } from "./utils";
|
||||
import { TestBuilder, Tests } from "./utils";
|
||||
|
||||
async function lockNote() {
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId("icon-lock-unlock").waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromText("Lock").isVisible();
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwd).element.typeText("1234");
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwdAlt).element.typeText(
|
||||
"1234"
|
||||
);
|
||||
await Tests.fromText("Lock").waitAndTap();
|
||||
await Tests.fromId("note-locked-icon").isVisible();
|
||||
await TestBuilder.create()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait()
|
||||
.waitAndTapById("icon-lock-unlock")
|
||||
.wait()
|
||||
.isVisibleByText("Lock")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwd, "1234")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwdAlt, "1234")
|
||||
.waitAndTapByText("Lock")
|
||||
.isVisibleById("note-locked-icon")
|
||||
.run();
|
||||
}
|
||||
|
||||
async function removeFromVault() {
|
||||
await Tests.fromId(notesnook.listitem.menu).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId("icon-lock-unlock").waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwd).element.typeText("1234");
|
||||
await Tests.fromText("Unlock").waitAndTap();
|
||||
await Tests.fromId("note-locked-icon").isNotVisible();
|
||||
await TestBuilder.create()
|
||||
.waitAndTapById(notesnook.listitem.menu)
|
||||
.wait()
|
||||
.waitAndTapById("icon-lock-unlock")
|
||||
.wait()
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwd, "1234")
|
||||
.waitAndTapByText("Unlock")
|
||||
.isNotVisibleById("note-locked-icon")
|
||||
.run();
|
||||
}
|
||||
|
||||
async function openLockedNote(pwd?: string) {
|
||||
await Tests.fromId(notesnook.ids.note.get(0)).waitAndTap();
|
||||
await Tests.sleep(500);
|
||||
await web()
|
||||
.element(by.web.name("password"))
|
||||
.typeText(pwd || "1234", false);
|
||||
async function openLockedNote(pwd = "1234") {
|
||||
await TestBuilder.create()
|
||||
.waitAndTapById(notesnook.ids.note.get(0))
|
||||
.wait()
|
||||
.addStep(async () => {
|
||||
await web().element(by.web.name("password")).typeText(pwd, false);
|
||||
await web().element(by.web.className("unlock-note")).tap();
|
||||
await Tests.sleep(500);
|
||||
await expect(web().element(by.web.className("unlock-note"))).not.toExist();
|
||||
await expect(
|
||||
web().element(by.web.className("unlock-note"))
|
||||
).not.toExist();
|
||||
})
|
||||
.run();
|
||||
}
|
||||
|
||||
async function goToPrivacySecuritySettings() {
|
||||
await Tests.openSideMenu();
|
||||
await Tests.fromId("sidemenu-settings-icon").waitAndTap();
|
||||
await Tests.sleep(300);
|
||||
await Tests.fromText("Settings").waitAndTap();
|
||||
await Tests.fromText("Vault").waitAndTap();
|
||||
await TestBuilder.create()
|
||||
.openSideMenu()
|
||||
.waitAndTapById("sidemenu-settings-icon")
|
||||
.wait()
|
||||
.waitAndTapByText("Settings")
|
||||
.waitAndTapByText("Vault")
|
||||
.run();
|
||||
}
|
||||
|
||||
describe("VAULT", () => {
|
||||
it("Create vault from settings", async () => {
|
||||
await Tests.prepare();
|
||||
await goToPrivacySecuritySettings();
|
||||
await Tests.fromText("Create vault").waitAndTap();
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwd).element.typeText(
|
||||
"1234"
|
||||
);
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwdAlt).element.typeText(
|
||||
"1234"
|
||||
);
|
||||
await Tests.fromText("Create").waitAndTap();
|
||||
await Tests.fromText("Clear vault").isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.addStep(goToPrivacySecuritySettings)
|
||||
.waitAndTapByText("Create vault")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwd, "1234")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwdAlt, "1234")
|
||||
.waitAndTapByText("Create")
|
||||
.isVisibleByText("Clear vault")
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Change vault password", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await lockNote();
|
||||
await goToPrivacySecuritySettings();
|
||||
await Tests.fromText("Change vault password").waitAndTap();
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwd).element.typeText(
|
||||
"1234"
|
||||
);
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.changePwd).element.typeText(
|
||||
"2362"
|
||||
);
|
||||
await Tests.fromText("Change").waitAndTap();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await Tests.sleep(500);
|
||||
await openLockedNote("2362");
|
||||
it.only("Change vault password", async () => {
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.addStep(lockNote)
|
||||
.addStep(goToPrivacySecuritySettings)
|
||||
.waitAndTapByText("Change vault password")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwd, "1234")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.changePwd, "2362")
|
||||
.waitAndTapByText("Change")
|
||||
.pressBack(3)
|
||||
.addStep(async () => await openLockedNote("2362"))
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Delete vault", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await lockNote();
|
||||
await goToPrivacySecuritySettings();
|
||||
await Tests.fromText("Delete vault").waitAndTap();
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwd).element.typeText(
|
||||
"1234"
|
||||
);
|
||||
await Tests.fromText("Delete").waitAndTap();
|
||||
await Tests.sleep(300);
|
||||
await Tests.fromText("Create vault").isVisible();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await Tests.fromId(notesnook.listitem.menu).isVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.addStep(lockNote)
|
||||
.addStep(goToPrivacySecuritySettings)
|
||||
.waitAndTapByText("Delete vault")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwd, "1234")
|
||||
.waitAndTapByText("Delete")
|
||||
.isVisibleByText("Create vault")
|
||||
.pressBack(3)
|
||||
.isVisibleById(notesnook.listitem.menu)
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Delete vault with locked notes", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await lockNote();
|
||||
await goToPrivacySecuritySettings();
|
||||
await Tests.fromText("Delete vault").waitAndTap();
|
||||
await Tests.fromId(notesnook.ids.dialogs.vault.pwd).element.typeText(
|
||||
"1234"
|
||||
);
|
||||
await Tests.fromText("Delete notes in this vault").waitAndTap();
|
||||
await Tests.fromText("Delete").waitAndTap();
|
||||
await Tests.sleep(300);
|
||||
await Tests.fromText("Create vault").isVisible();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await device.pressBack();
|
||||
await Tests.fromId(notesnook.listitem.menu).isNotVisible();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.addStep(lockNote)
|
||||
.addStep(goToPrivacySecuritySettings)
|
||||
.waitAndTapByText("Delete vault")
|
||||
.typeTextById(notesnook.ids.dialogs.vault.pwd, "1234")
|
||||
.waitAndTapByText("Delete notes in this vault")
|
||||
.waitAndTapByText("Delete")
|
||||
.isVisibleByText("Create vault")
|
||||
.pressBack(3)
|
||||
.isNotVisibleById(notesnook.listitem.menu)
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Add a note to vault", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await lockNote();
|
||||
await openLockedNote();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.addStep(lockNote)
|
||||
.addStep(openLockedNote)
|
||||
.run();
|
||||
});
|
||||
|
||||
it("Remove note from vault", async () => {
|
||||
await Tests.prepare();
|
||||
await Tests.createNote();
|
||||
await lockNote();
|
||||
await removeFromVault();
|
||||
await TestBuilder.create()
|
||||
.prepare()
|
||||
.createNote()
|
||||
.addStep(lockNote)
|
||||
.addStep(removeFromVault)
|
||||
.run();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user