Skip to content

Commit

Permalink
1.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
sjro committed Oct 12, 2022
2 parents 23fd120 + d73ca45 commit 4dbe8db
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ install:
- npm install
script:
- echo -e "\x1b\x5b35;1m*** Linting...\x1b\x5b0m"
- npm run lint
- npm run lint -- --report-unused-disable-directives --max-warnings 0
- echo -e "\x1b\x5b35;1m*** Linting complete...\x1b\x5b0m"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [1.0.1] (October 12, 2022)

* Fixed the first tests in the test suite fail randomly by adding missed `await` in `utils/Page`.
* Fixed the util method `waitTransitionEnd` in `utils/Page` to correctly call `browser.waitUntil()` and to wait for the promise of `browser.execute()` to be resolved.

## [1.0.0] (June 8, 2022)

* Updated test app to use `createRoot` API from React 18.
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@enact/ui-test-utils",
"version": "1.0.0",
"version": "1.0.1",
"description": "UI Testing for the Enact framework",
"repository": "https://github.com/enactjs/ui-test-utils",
"main": "index.js",
"bin": {
"start-tests": "./start-tests.js"
Expand Down
19 changes: 12 additions & 7 deletions utils/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class Page {
}

async open (appPath, urlExtra = '?locale=en-US') {
await browser.execute(function () {
document.body.innerHTML = '';
});

this._url = `/${appPath}/${urlExtra}`;
// Can't resize browser window when connected to remote debugger!
if (!browser._options || !browser._options.remote) {
Expand All @@ -22,7 +26,9 @@ class Page {
await browser.url(this.url);

const body = await $('body');
await body.waitForExist({timeout: 1000});
await body.waitForDisplayed({timeout: 5000});

await this.delay(200);
}

serializeParams (params) {
Expand Down Expand Up @@ -69,7 +75,7 @@ class Page {

// For testing "pointer off" by timeout.
async hidePointerByKeycode () {
browser.execute(function () {
await browser.execute(function () {
const event = document.createEvent('Events');
event.initEvent('keydown', true, true);
event.keyCode = 1537;
Expand Down Expand Up @@ -136,7 +142,7 @@ class Page {
await browser.waitUntil(() => target.isExisting() && target.isFocused(), {timeout, timeoutMsg, interval});
}

async waitTransitionEnd (delay = 3000, msg = 'timed out waiting for transitionend', callback, ignore = ['opacity', 'filter']) {
async waitTransitionEnd (timeout = 3000, timeoutMsg = 'timed out waiting for transitionend', callback, ignore = ['opacity', 'filter']) {
await browser.execute(
// eslint-disable-next-line no-shadow
function (ignore) {
Expand All @@ -153,15 +159,14 @@ class Page {
callback();
}
await browser.waitUntil(
function () {
return browser.execute(
async function () {
return await browser.execute(
function () {
return window.__transition;
}
);
},
delay,
msg
{timeout, timeoutMsg}
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion utils/runTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const runTest = ({concurrency, filter, Page, testName, ...rest}) => {
await Page.open('?request');

let testCases = await browser.execute(async function () {
return await window.__TEST_DATA; // eslint-disable-line no-undef
return await window.__TEST_DATA;
});

await expect(testCases).to.be.an('object', 'Test data failed to load');
Expand Down

0 comments on commit 4dbe8db

Please sign in to comment.