An example of how to create an XRAY compatible report you can import via XRAYs-REST-API with AskUI and jest.
Install example project's dependencies
# Root folder
npm install-
You need to configure credentials to be able to run the example (except on Windows). See AskUI UI Control Client docs
-
Also the example assumes that you start the AskUI UI Controller manually instead of through the
beforeAllandafterAll(teardown) hooks.
Downloads:
ℹ️ macOS After installation to
Applicationsremove the quarantine flag with the following command run from a terminal:xattr -d com.apple.quarantine /Applications/askui-ui-controller.app
- Set the environment variable
ASKUI_INFERENCE_SERVER_URLfor your terminal session like this:
export ASKUI_INFERENCE_SERVER_URL=https://inference.askui.com
Workflows can be run with:
npm run askuiThe JSON with the results in XRAYs proprietary format will be generated under xray-report/report.json and will look like this:
{
"tests": [
{
"testKey": "TEST1",
"start": "2024-01-10T15:17:05.998Z",
"steps": [
{
"status": "PASS",
"evidences": [
{
"data": "iVBORw0KGgoAAAANSUhEUgAAC ...",
"filename": "before.png",
"contentType": "image/png"
},
{
"data": "AAAAesCAYAAACEMRk8ABJYYklEQVR ...",
"filename": "after.png",
"contentType": "image/png"
}
]
}
],
"finish": "2024-01-10T15:17:10.852Z",
"status": "FAIL"
}
]
}The testKey property is extracted from the it-block. So a workflow file that looks like this will generate the above report:
import { aui } from './helpers/askui-helper';
describe('jest with XRAY', () => {
it('TEST1', async () => {
// For Windows users:
// Use annotate() to create an annotated HTML file
// of your screen that is saved under <project_root>/report
// await aui.annotate();
await aui.moveMouse(200, 200).exec();
expect(true).toBe(false);
// Uncomment for macOS and Linux
// Delete the lines above to not trigger annotate()
// await aui.annotateInteractively();
});
});In case you only need a JUnit-XML file for XRAY. The JUnit-XML will be generated in your root-folder as junit.xml