e2e testing framework-ish for obsidian plugins
Go to file
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 61b2232fb7
Some checks failed
Playwright Tests / test (push) Has been cancelled
Revert "rename framework->library"
This reverts commit 13c76cf3e5c403cad23088fb413fcff6167f9bee.
2024-10-26 15:05:43 -04:00
.github/workflows Revert "rename framework->library" 2024-10-26 15:05:43 -04:00
.vscode hello world! 🌸 2024-10-23 18:38:55 -04:00
.yarn Revert "rename framework->library" 2024-10-26 15:05:43 -04:00
packages Revert "rename framework->library" 2024-10-26 15:05:43 -04:00
vault fixes for github actions 2024-10-24 15:53:37 -04:00
.editorconfig hello world! 🌸 2024-10-23 18:38:55 -04:00
.gitattributes hello world! 🌸 2024-10-23 18:38:55 -04:00
.gitignore more publishing chores 2024-10-24 23:17:38 -04:00
.yarnrc.yml hello world! 🌸 2024-10-23 18:38:55 -04:00
package.json Revert "rename framework->library" 2024-10-26 15:05:43 -04:00
README.md fix incorrect readme example 2024-10-24 21:32:24 -04:00
yarn.lock Revert "rename framework->library" 2024-10-26 15:05:43 -04:00

the Obsidian Testing Framework

what is this?

this is a library that (finally!) lets you end-to-end test your obsidian plugins. it uses playwright to interact with obsidian, which is an Electron app under the hood.

great! how do i use it?

basic usage

import {test} from "obsidian-testing-library";
test('obsidian app url', async ({ page }) => {
	console.log(page.url());
	expect(/obsidian\.md/i.test(page.url())).toBeTruthy()
});

usage with the app instance

test("idk", async({page}) => {
	console.log("idk")
	let tfile = await doWithApp(page, async (app) => {
		return app.metadataCache.getFirstLinkpathDest("Welcome", "/");
	});
	expect(tfile.basename).toEqual("Welcome")
})

other utilities

see src/util.ts for the currently included utilities and their documentation.