UNPKG

@progress/kendo-e2e

Version:

Kendo UI end-to-end test utilities.

131 lines (82 loc) 4.51 kB
![Kendo UI Logo](https://www.telerik.com/kendo-angular-ui/npm-banner.svg) ## Professional Grade UI Components This package is part of the [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/) and [KendoReact](https://www.telerik.com/kendo-react-ui/components/#react-components) suites. ## License This is commercial software. To use it, you need to agree to the [**Telerik End User License Agreement for Kendo UI** (for Kendo UI for Angular)](http://www.telerik.com/purchase/license-agreement/kendo-ui) or to the [**End User License Agreement for Progress KendoReact** (for KendoReact)](https://www.telerik.com/purchase/license-agreement/progress-kendoreact). If you do not own a commercial license, this file shall be governed by the trial license terms. All available Kendo UI commercial licenses may be obtained at http://www.telerik.com/purchase/kendo-ui. ## Kendo UI for Angular Resources and Feedback - [Get Started](https://www.telerik.com/kendo-angular-ui/getting-started) - [Component References](https://www.telerik.com/kendo-angular-ui/components) - [Blogs](http://www.telerik.com/blogs/kendo-ui) - [FAQ](https://www.telerik.com/kendo-angular-ui/components/faq/) - [GitHub Issues](https://github.com/telerik/kendo-angular/issues) - [Feedback Portal](http://kendoui-feedback.telerik.com/forums/555517-kendo-ui-for-angular-2-feedback) - [StackOverflow](https://stackoverflow.com/questions/tagged/kendo-ui-angular2) ## KendoReact Resources and Feedback - [Get Started](https://www.telerik.com/kendo-react-ui/getting-started) - [Component References](https://www.telerik.com/kendo-react-ui/components/#react-components) - [Blogs](http://www.telerik.com/blogs/kendo-ui) - [GitHub Issues](https://github.com/telerik/kendo-react/issues) - [Feedback Portal](http://kendoui-feedback.telerik.com/forums/908425-kendo-ui-for-react-feedback) - [StackOverflow](https://stackoverflow.com/questions/tagged/kendo-react-ui) *Copyright © 2021 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.* *Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.* # kendo-e2e Selenium based e2e testing for web. ## Usage ### Managing browsers Example: ```javascript const browser = new Browser(); await browser.navigateTo("https://www.telerik.com/") await browser.close(); ``` By default it will start Chrome browser with size 1366x768. Browser type and size can be controlled by settings following environment variables: - `BROWSER_NAME` Allowed values are `chrome`, `firefox`, `MicrosoftEdge` and `safari` (default is `chrome`). - `BROWSER_WIDTH` and `BROWSER_HEIGHT` Default values are `1366` and `768`. - `HEADLESS` If set to `true` it will start browsers in headless mode (default is `false`). Notes: `Safari` do not support headless mode and this setting will be ignored. ### Find Elements and Wait for Conditions Selenium default behavior when you search for element is to return it if available and throw if not available (do not try to wait until element is available). To make writing e2e tests easier and tests more stable in `kendo-e2e` we have: ```js const element = await browser.find(locator, timeout); ``` This `find` with wait until element is available (until timeout reached), if timeout reached and element still not found it will throw. ### Detect JavaScript errors in Browser Logs ```js await browser.getErrorLogs() ``` Will return all errors in browser console and it is nice check we can perform after each test to ensure we have no missing resources or scripts throwing errors. ### Detect Accessibility Violations ```js const disableRules = ['aria-allowed-role', 'label']; const errors = await browser.getAccessibilityViolations('#table', disableRules); expect(errors).toEqual([]); ``` `getAccessibilityViolations` uses [axe](https://www.deque.com/axe/) to detect WCAG 2.1 violations. ### Kendo UI Components Abstractions TODO ## Contribution PRs are welcome! Lint: ```bash npm run lint ``` Build: ```bash npm run build ``` Run tests: ```bash npm run test:a11y npm run test:e2e npm run test:visual npm run test:components npm run test:rendering npm run test:snapshot ```