2024-11-11 18:44:28 +05:00
|
|
|
import { notesnook } from "../test.ids";
|
2025-10-04 12:54:01 +05:00
|
|
|
import { TestBuilder } from "./utils";
|
2024-11-11 18:44:28 +05:00
|
|
|
|
|
|
|
|
describe("NOTE TESTS", () => {
|
|
|
|
|
it("Create a note in editor", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create().prepare().createNote().run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("Open and close a note", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.waitAndTapById(notesnook.ids.note.get(0))
|
|
|
|
|
.exitEditor()
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("Notes properties should show", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.isVisibleByText("Created at")
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("Favorite and unfavorite a note", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.saveResult()
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.waitAndTapById("icon-favorite")
|
|
|
|
|
.pressBack()
|
|
|
|
|
.isVisibleById("icon-star")
|
|
|
|
|
.navigate("Favorites")
|
|
|
|
|
.processResult(async (note) => {
|
|
|
|
|
await TestBuilder.create()
|
|
|
|
|
.isVisibleByText(note.body)
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.waitAndTapById("icon-favorite")
|
|
|
|
|
.pressBack()
|
|
|
|
|
.isNotVisibleByText(note.body)
|
|
|
|
|
.navigate("Notes")
|
|
|
|
|
.run();
|
|
|
|
|
})
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("Pin a note to top", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.waitAndTapById("icon-pin")
|
|
|
|
|
.pressBack()
|
|
|
|
|
.isVisibleByText("PINNED")
|
|
|
|
|
.isVisibleById("icon-pinned")
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.waitAndTapById("icon-pin")
|
|
|
|
|
.pressBack()
|
|
|
|
|
.isNotVisibleByText("icon-pinned")
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
2025-10-03 14:38:34 +05:00
|
|
|
it.skip("Pin a note in notifications", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.waitAndTapById("icon-pin-to-notifications")
|
|
|
|
|
.isVisibleByText("Unpin from notifications")
|
|
|
|
|
.waitAndTapById("icon-pin-to-notifications")
|
|
|
|
|
.isVisibleByText("Pin to notifications")
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("Copy note", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.isVisibleById("icon-copy")
|
|
|
|
|
.waitAndTapById("icon-copy")
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("Assign colors to a note", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.saveResult()
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.waitAndTapByText("Add color")
|
|
|
|
|
.typeTextById("color-title-input", "Test color")
|
|
|
|
|
.waitAndTapByText("Add color")
|
|
|
|
|
.isVisibleById("icon-check")
|
|
|
|
|
.waitAndTapById("icon-color-#efefef")
|
|
|
|
|
.isNotVisibleById("icon-check")
|
|
|
|
|
.waitAndTapById("icon-color-#efefef")
|
|
|
|
|
.pressBack()
|
|
|
|
|
.navigate("Test color")
|
|
|
|
|
.processResult(async (note) => {
|
|
|
|
|
await TestBuilder.create().isVisibleByText(note.body).run();
|
|
|
|
|
})
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
|
2025-10-03 14:38:34 +05:00
|
|
|
it("Delete & restore a note", async () => {
|
2025-10-04 12:54:01 +05:00
|
|
|
await TestBuilder.create()
|
|
|
|
|
.prepare()
|
|
|
|
|
.createNote()
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.waitAndTapById("icon-trash")
|
|
|
|
|
.navigate("Trash")
|
|
|
|
|
.waitAndTapById(notesnook.listitem.menu)
|
|
|
|
|
.wait(500)
|
|
|
|
|
.waitAndTapByText("Restore")
|
|
|
|
|
.pressBack()
|
|
|
|
|
.isVisibleByText(
|
|
|
|
|
"Test note description that is very long and should not fit in text."
|
|
|
|
|
)
|
|
|
|
|
.run();
|
2024-11-11 18:44:28 +05:00
|
|
|
});
|
|
|
|
|
});
|