1.0.2 • Published 3 years ago
@betty-blocks/ui-test-framework v1.0.2
UI Test Framework
Description
UI Test Framework is a handy tool for writing UI Automated tests across Betty Blocks
The framework is based on TestCafe
API
ImageAsserter
Class for visual testing. See documentation here
BaseElement
Base class for OOP-styled page object models
const page = new BaseElement('#page');
const loginButton = new BaseElement('#loginBtn', button);
bbTest
Wrapper above testcafe's test function with the enhanced skip behavior
bbTest.skip(
{ jiraId: 'KEK-666' },
'Test name',
acync (t: TestController): Promise<void> {
// Your test here
});
createTimestamp
Returns the current timestamp in the format 33625
reload
Reloads the current active browser window
await reload(t);
repeatAsync
Sequentially executes an async function N times
await repeatAsync(
async () => PageBuilder.Prefabs.dragBottom(NameComponent, Canvas),
3,
);
defaultRole
Returns a role object which stores session cookies to be re-used across multiple tests
const actionIdeRole = defaultRole(APP_ACTIONS_URL, USERNAME, PASSWORD);
select
Renamed testcafe's Selector
const actionIdeRole = defaultRole(APP_ACTIONS_URL, USERNAME, PASSWORD);
sleep
Generic async wait function
await sleep(300); // 300 ms