This article demonstrates how AskUI helps users to automate a Canvas applications' test cases in 63 seconds or less.
Given you have an AskUI account and setup already ready to go.
The Use Case
Automate a single test run, on our canvas based calculator. This is what our result will look like eventually:
Lets dig a little bit deeper to understand how we could do this:
Test Steps:
- Open Calculator URL in Browser
- Press 3
- Press Multiplication button
- Press 3 and then 3 again
- Verify, that 99 is the Result
How to build this in 63 seconds or less
Yes it is really that fast.
1. Create a new Workflow, like demonstrated here:
Open the file askui_example/my-first-askui-test-suite.test.ts and delete its entire contents! It should look like this afterward:
import { aui } from './helpers/askui-helper';
describe('jest with askui', () => {
it('should generate an (interactive) annotation', async () => {
});
});
2. Paste the following AskUI Instructions. They assume that you started the AskUI Controller and have chrome already open:
import { aui } from './helpers/askui-helper';
describe('jest with askui', () => {
it('should solve a simple arithmetic task', async () => {
await aui.typeIn('https://askui.github.io/askui-practice-page/').textfield().exec();
await aui.pressKey('enter').exec();
await aui.click().button().withText('3').exec();
await aui.click().button().rightOf().text('9').exec();
await aui.click().button().withText('3').exec();
await aui.click().button().below().text('3').exec();
});
});
3. Run the workflow and you should see how AskUI executes the test steps outlined above:
Thats it, that is how you automate a given test case in a canvas environment. It is important to note that it is applicable to any browser, any Operating System and also any desktop application.
There are truly no limitations of what you can automate, test, build.