Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/salesforce/codeceptjs-bdd
Javascript BDD UI Automation Framework. Exclusive LWC Shadow DOM Support. Playwright, Webdriver.io, Appium, Saucelabs.
https://github.com/salesforce/codeceptjs-bdd
assertions bdd codeceptjs-bdd cucumber lwc multi-browsers parallel salesforce salesforce-automation saucelabs shadow-dom webcomponents
Last synced: 25 days ago
JSON representation
Javascript BDD UI Automation Framework. Exclusive LWC Shadow DOM Support. Playwright, Webdriver.io, Appium, Saucelabs.
- Host: GitHub
- URL: https://github.com/salesforce/codeceptjs-bdd
- Owner: salesforce
- License: mit
- Created: 2020-05-28T18:08:13.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-30T18:47:25.000Z (about 1 month ago)
- Last Synced: 2024-09-30T18:52:06.445Z (about 1 month ago)
- Topics: assertions, bdd, codeceptjs-bdd, cucumber, lwc, multi-browsers, parallel, salesforce, salesforce-automation, saucelabs, shadow-dom, webcomponents
- Language: JavaScript
- Homepage: https://gkushang.github.io/
- Size: 52.7 MB
- Stars: 45
- Watchers: 7
- Forks: 14
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# [CodeceptJS BDD](http://gkushang.github.io/)
#### UI/API Test Automation Framework: WebdriverIO & Playwright with Cucumber & Mocha-stylig features/scenarios
[![CircleCI](https://circleci.com/gh/salesforce/codeceptjs-bdd.svg?style=svg)](https://circleci.com/gh/salesforce/codeceptjs-bdd) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/) [![License](https://img.shields.io/npm/l/codeceptjs-cucumber.svg)](LICENSE)
- Webdriver and Playwright parity: Write one test, Run on both drivers
- BDD Cucumber and traditional Mocha-styled
- SauceLabs and Selenoid integrations
- Applitools, Appium integrations
- Ease of Automating Salesforce Apps
- Exclusive Shadow DOM support for LWC/LWR applications, WebComponents
- WebdriverIO parity with Playwright to work with Shadow Elements
- and many more features##### Website: [Codeceptjs-BDD Framework Documentations](http://gkushang.github.io/)
## Get Started
One line Setup,
```
npx create-codeceptjs-bdd-tests
```Node 16 is required!
This **Interactive CLI** walks you through the _step-step setup_. It will setup,
- Executions on both Webdriver & Playwright.
- Create the framework structure with page objects, helpers, plugins, test env files etc.
- Integrate Sauce Labs with framework
- Provides default BDD & Mocha-style example scenarios to start with
- Setup Parallel executions, and many moreAbove command will also add **Webdriver parity with Playwright to work with Shadow elements**.
#### Example of out-of-the-box ShadowDOM support for WebComponents (LWC for Salesforce) & Applitools
Take a look at [here](https://github.com/salesforce/codeceptjs-bdd/tree/develop/examples/webcomponents-playwright-webdriver-example#webcomponents-playwright--webdriver-e2e-example)
## Execute
##### Webdriver
```
yarn acceptance --profile webdriver:chrome
```##### Playwright
```
yarn acceptance --profile playwright:chrome
yarn acceptance --profile playwright:safari
yarn acceptance --profile playwright:firefox
yarn acceptance --profile playwright:google:chrome
```##### Mobile or Tablets
```
yarn acceptance --profile device:'iPhone 11':safari
```[List of devices](https://github.com/microsoft/playwright/blob/master/packages/playwright-core/src/server/deviceDescriptorsSource.json)
##### Sauce Labs
```
yarn acceptance --profile sauce:chrome
yarn acceptance --profile sauce:"macOS 11.00":firefox:80
```##### Parallel
```
yarn acceptance:parallel --profile playwright:chrome
```##### Headless
```
HEADLESS=true yarn acceptance:parallel --profile playwright:chrome
```###### For more info about the framework visit [CodeceptJS BDD Docs](http://gkushang.github.io/) & https://codecept.io/
### Ease of working with Shadow Elements. Webdriver & Playwright Parity
Assuming you've enabled the Shadow DOM Support thru the CLI framework setup.
Let's say you want to fill-field on the Shadow element on this Lighting Web Components page: https://recipes.lwc.dev/. You aren't required to provide the DOM Hierarchy in this framework and still, it will find the elements thru Webdriver (Playwright has default support). Meaning, it provides the Playwright parity with Webdriver.
Means, same tests can run on both: Webdriver & Playwright.
So, all you need to provide unique CSS as shown below,
```
I.fillField('ui-input input','codeceptjs-bdd')
```There may be cases that doesn't require you to deal with Shadow Element, e.g. plain login page, you can disable the Shadow Locators finder by providing CSS objects, e.g.
```
I.fillField({css: 'div.username'},'myusername');
I.fillField({css: 'div.password'},'******');
```## Have any questions? Join Slack community for more help
[Slack Chat](https://bit.ly/chat-codeceptjs) and join channel `#codeceptjs-bdd` for any specific questions about this framework
## 🚚 Changelog
[Link to Changelog](https://gkushang.github.io/CHANGELOG)
## 🎥 How to Videos
## Contributors
Thanks goes to these wonderful people who are and will have contributing to this awesome project!
[//]: contributor-faces
[//]: contributor-faces