Admittedly, Claude Code's end of year double data bonanza was welcomed with open arms when it came to automated testing. Let's put it like this: without help from AI, I would not have written 1000+ lines of code and configuration to automate tasks that otherwise take seconds to do manually.
On the other hand: you're worse off doing all those tests for every release by hand. It's worth the investment, but in spite of AI guidance: implementing tests using Claude Code still takes a lot of time. It does make Nokta a better product. And also: it's sooo satisfying to watch the screen while a robot does hundreds of actions in seconds.
And another thing that's neat: since Nokta has its own file format, testing and logging can take place in the same test file.
Here's an example of what it looks like:
Test: does the F2 key work to rename notes?
it('F2 opens rename dialog', async () => {
// Press F2 Key
await browser.keys('F2');
await browser.pause(PAUSE);
expect(await isRenameDialogVisible()).toBe(true);
// Close dialog with cancel button
const cancelButton = await $('button=Cancel');
await cancelButton.click();
await browser.pause(PAUSE);
expect(await isRenameDialogVisible()).toBe(false);
});
Helper functions
//Building the log
afterEach(function () {
const icon = this.currentTest?.state === 'passed' ? '✅' : '❌';
specLog.push(`${icon} ${this.currentTest?.title}`);
});
//Look for a H3 element that contains a specific text
async function isRenameDialogVisible(): Promise<boolean> {
return browser.execute(() => {
const h3 = document.querySelector('h3');
return h3?.textContent === 'Rename this note';
});
}
Output
Test 008 - Keyboard Shortcuts
//...
✅ F2 opens rename dialog
More test automation
It's tempting to go down the rabbit hole and find out what the limits are of what could (or should) be automated. But while it saves me time, it doesn't directly add value to you, the user. So for now, I'm happy having shaved off a good chunk of manual testing time for each release. Testing will expand gradually as the app grows.
Appendix: Tech Stack
- WebdriverIO provides a mature, well-documented API
- Tauri-driver bridges WebDriver protocol to the native WebView
- Mocha as test framework (familiar BDD syntax)