{"id":22699838,"url":"https://github.com/enactjs/ui-test-utils","last_synced_at":"2026-04-20T06:11:37.785Z","repository":{"id":37634558,"uuid":"88916758","full_name":"enactjs/ui-test-utils","owner":"enactjs","description":"UI Tests for Enact","archived":false,"fork":false,"pushed_at":"2026-04-03T02:18:50.000Z","size":6273,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":83,"default_branch":"master","last_synced_at":"2026-04-03T11:47:53.355Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enactjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-04-20T22:44:22.000Z","updated_at":"2026-01-13T08:17:37.000Z","dependencies_parsed_at":"2023-09-23T05:03:35.638Z","dependency_job_id":"69a8f54c-5130-47ba-af31-3ed2a9e46a42","html_url":"https://github.com/enactjs/ui-test-utils","commit_stats":{"total_commits":242,"total_committers":33,"mean_commits":7.333333333333333,"dds":0.6900826446280992,"last_synced_commit":"5646e3c51442c7ca393a27ce17ac18f14c69433f"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/enactjs/ui-test-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enactjs%2Fui-test-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enactjs%2Fui-test-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enactjs%2Fui-test-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enactjs%2Fui-test-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enactjs","download_url":"https://codeload.github.com/enactjs/ui-test-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enactjs%2Fui-test-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32035309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T06:08:51.438Z","updated_at":"2026-04-20T06:11:37.752Z","avatar_url":"https://github.com/enactjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utilities for Automated UI Testing of Enact components\n\nThis package includes the common WebDriver configurations and some utility modules for executing\nautomated UI tests from Enact UI library packages. This package is not intended to be used directly\nand must be configured as a `devDependency` of the UI library.\n\n## Setting up a UI Library\n\n1. Add `@enact/ui-test-utils` as a devDependency: `npm i --save-dev @enact/ui-test-utils`\n2. Create the `tests/ui` folder structure within the UI library\n3. Add `apps` and `specs` folders to `tests/ui`\n4. Add local WebDriver configuration files within `tests/ui/config`\n\n    * `wdio.conf.js` containing `import config from '@enact/ui-test-utils/ui/wdio.conf.js'; export default uiConfig;`\n    * `wdio.docker.conf.js` containing `import {uiDockerConfig} from '@enact/ui-test-utils/ui/wdio.docker.conf.js'; export default config;`\n    * `wdio.tv.conf.js` containing `import {uiTVConfig} from '@enact/ui-test-utils/ui/wdio.tv.conf.js'; export default config;`\n\n* and `tests/screenshot/config`\n\n    * `wdio.conf.js` containing `import config from '@enact/ui-test-utils/screenshot/wdio.conf.js'; export default ssConfig;`\n    * `wdio.docker.conf.js` containing `import {ssDockerConfig} from '@enact/ui-test-utils/screenshot/wdio.docker.conf.js'; export default config;`\n    * `wdio.tv.conf.js` containing `import {ssTVConfig} from '@enact/ui-test-utils/screenshot/wdio.tv.conf.js'; export default config;`\n\n5. Add npm scripts for each of the above configuration files. There are likely other scripts already\n   defined so these will be added to the existing scripts.\n\n```json\n   \"scripts\": {\n      \"test-ui\": \"start-tests tests/ui/config/wdio.conf.js\",\n      \"test-ui-docker\": \"start-tests tests/ui/config/wdio.docker.conf.js\",\n      \"test-ui-tv\": \"start-tests tests/ui/config/wdio.tv.conf.js\",\n      \"test-ss\": \"start-tests tests/screenshot/config/wdio.conf.js\",\n      \"test-ss-docker\": \"start-tests tests/screenshot/config/wdio.docker.conf.js\",\n      \"test-ss-tv\": \"start-tests tests/screenshot/config/wdio.tv.conf.js\",\n   }\n```\n\n6. Optionally configure different ESLint and git configuration rules using `eslint.config.js` and\n   `.gitignore` files, respectively\n\n## Creating tests\n\nWithin the UI Library, create an app for testing in **`/tests/ui/apps`** and create a corresponding test in **`/tests/ui/specs`**.\n\nThe `Page` component from `@enact/ui-test-utils/test/Page` contains useful methods for loading tests.\n\n## Testing on TV\n\nPass the IP address of the TV as an environment variable and use the `test-ui-tv` task:\n\n```bash\nTV_IP=10.0.1.1 npm run test-ui-tv\n```\n\n## Filtering Tests\n\n### Filtering UI by Component\n\n```bash\nnpm run test-ui -- --spec \u003cpattern\u003e\n```\n\nExample 1 -  will execute tests for 'Button'\n\n```bash\nnpm run test-ui -- --spec Button\n```\n\nExample 2 - will execute tests for 'InputField' component\n\n```bash\nnpm run test-ui -- --spec /InputField\n```\n\nNote: `\u003cpattern\u003e` can also be a regex and may need to be in quotes to prevent expansion on the command\nline.\n\n### Filtering Screenshot by Component\n\n```bash\nnpm run test-ss -- --component \u003cpattern\u003e\n```\n\nNote: `pattern` may need to be in quotes to prevent expansion on the command line if you use a regex.\n\nExample 1 - uses regular expression to match only tests that begin with 'Button'\n\n```bash\nnpm run test-ss -- --component \"^Button\"\n```\n\nExample 2 - match all tests that contain 'Button'\n\n```bash\nnpm run test-ss -- --component Button\n```\n\n### Filtering Screenshot by Theme\n\n```bash\nnpm run test-ss -- --spec Light-specs\n```\n\nYou can combine theme and component filtering for more precise runs:\n\n```bash\nnpm run test-ss -- --component CheckboxItem --spec Default-specs\n```\n\n### Filtering Screenshot by Title\n\nSearch within the title of the screenshot for a specific regex string:\n\n```bash\nnpm run test-ss -- --title \"color = green\"\n```\n\nAs before, you can combine multiple filters:\n\n```bash\nnpm run test-ss -- --component \"^Button\" --title \"disabled\"\n```\n\n### Filtering Screenshot by Test ID\n\nExecute the first test of each component:\n\n```bash\nnpm run test-ss -- --id 0\n```\n\nThe test ID can be gotten from the failed tests results, looking at the request output or by counting the number of tests in a component.\n\nAs before, you can combine multiple filters:\n\n```bash\nnpm run test-ss -- --component \"^Button\" --id 10\n```\n\n## Failed UI Test Screenshots\n\nWhen a test fails, a screenshot will be captured showing the state when it failed. The screenshots\nare saved to **`./tests/ui/errorShots/`**. The test run will display the filename for a failed test:\n\nExample:\n\n```none\nF\n\tScreenshot location: ./tests/ui/errorShots/should-meet-initial-conditions.png\n```\n\n## Viewing Test Results\n\nAfter a test runs, if new screenshots are generated, a page is created with links to open each of the images. To open this file (on a Mac):\n\n```bash\nopen tests/screenshot/dist/newFiles.html\n```\n\nIf there are test failures, a failure log is created that contains links to the sets of images. To open this file (on a Mac):\n\n```bash\nopen tests/screenshot/dist/failedTests.html\n```\n\nImages can be navigated using the keyboard arrow keys. Click on an image to zoom in.  Click out of the image to zoom out.\n\nIn the output, the **test case** button opens the sample app with the parameters that produced the output. This requires that a server be running on port 3000. If you have globally installed the `serve` command with `npm install -g serve` you can start the server like this:\n\n```bash\nserve tests/screenshot/dist\n```\n\n## Optimizing Building\n\n### Re-run tests without building\n\nThe `--skip-build` option can be used to skip packing Enact and the `apps` directory.  Changes to\nthe Enact version or test apps will not be picked up.\n\n```bash\nnpm run test-ui -- --spec /Input --skip-build\n```\n\n## Advanced Usage\n\n### Setting the Number of Concurrent Instances\n\nTo limit or increase the number of concurrent tests, use the `--instances` option:\n\n```bash\nnpm run test-ui -- --instances 2\n```\n\n### Running Tests Offline\n\nBy default, the latest versions of various drivers will be downloaded before starting tests. This\ncan be skipped when no internet connection is available by specifying the `--offline` option:\n\n```bash\nnpm run test-ui -- --offline\n```\n\n### Running with visible browser\n\nBy default, tests run in 'headless' mode, which hides the browser window used for testing.  You can\nwatch the tests run by passing `--visible`:\n\n```bash\nnpm run test-ui -- --visible\n```\n\n### Running with visible browser and filtering by component\n\nFor example, filtering for the component 'Input'.\n\n```bash\nnpm run test-ui -- --visible --spec /Input\n```\n\n### Running without animation effects\n\nThe `--no-animation` option is used to pack Enact without animation.\nYou can use this option to test the apps without animation effects.\n\n```bash\nnpm run test-ss -- --no-animation\n```\n\n### Loading sample apps in a browser\n\n This requires that a server be running on port 3000. If you have globally installed the `serve`\n command with `npm install -g serve` you can start the server like this:\n\n```bash\nserve dist\n```\n\nTo open a specific test app, open the URL path for the test.  The path will match the name of the JS\nsource file for the app.  For example, to open the `VirtualList` test app, navigate to:\n\n```none\nhttp://localhost:3000/VirtualList-View/\n```\n\n### Viewing screenshot tests in the browser\n\nNavigate to a URL using the component name and test case number. Change 'Sandstone-View' to the name of the view appropriate for your library.\n\nAn index page will be served when no component is specified.  Select a test from the list to open it.\n\n```none\nlocalhost:3000/Sandstone-View/\n```\n\nYou can go directly to a test by specifying the component name and test ID number:\n\n```none\nlocalhost:3000/Sandstone-View/?component=\u003ccomponent name\u003e\u0026testId=\u003cnumber of the test\u003e\n```\n\nExample:\n\n```none\nlocalhost:3000/Sandstone-View/?component=RadioItem\u0026testId=10\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenactjs%2Fui-test-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenactjs%2Fui-test-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenactjs%2Fui-test-utils/lists"}