Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWC Support and update the latest config #26

Merged
merged 2 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions documentation/docs/1-getting-started/setup-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This framework provides an Interactive CLI to quickly setup the framework for yo
Below steps assumes you have already installed all the required dependencies from _Getting Started > Installation_

```bash

git clone https://github.com/gkushang/codeceptjs-bdd.git
git clone https://github.com/gkushang/codeceptjs-bdd.git
cd codeceptjs-bdd/packages/codeceptjs-cucumber
yarn
npm run cli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,50 @@ The Codeceptjs-BDD provides the complete example to **Automate the Salesforce LW

##### Quick example of "how to click the button in Shadow DOM",

```sh
```js
I.click({ shadow: ['my-app', 'recipe-hello', 'button'] });
```

## BDD or Mocha styles tests

With Codeceptjs-bdd, you can choose to write your tests in any format. BDD and/or Mocha styles tests OR mix/match both styles - all are supported!

### BDD Scenarios

```js

@hello_binding @lwc_recipes
Feature: HelloBinding from Salesforce LWC Recipes

As a LWC developer
I want to be able to automate the LWC Shadow Dom Components
So that I can quicly create my UI Automated Suite using Selenium

=> LWC Recipe Page: https://recipes.lwc.dev/#hello

@hello_binding_component
Scenario: Fred successfully types in and verifies the title in Hello Binding LWC Component

When Fred types "Kushang Gajjar" into the Hello Binding Component
Then he sees the title is updated accordingly

```

### Mocha Scenarios

```js

Feature('HelloBinding from Salesforce LWC Recipes (mocha)');

Scenario('Fred successfully types in and verifies the title in Hello Binding LWC Component', async (I, helloBinding) => {

const name = 'Salesforce LWC';
I.amOnPage('/#hello/');
helloBinding.enterName(name);
(await helloBinding.grabTitle()).should.equal(`Hello, ${name}!`);

}).tag('@hello-binding-mocha').tag('smoke');
```

If you have any questions regarding automating Saleforce LWC or Web Components or Shadow DOM, please reach out to us by submitting an issue [here](https://github.com/gkushang/codeceptjs-bdd/issues).

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature('HelloBinding from Salesforce LWC Recipes (mocha)');

Scenario('Fred successfully types in and verifies the title in Hello Binding LWC Component', async (I, helloBinding) => {
const name = 'Salesforce LWC';
I.amOnPage('/#hello/');
helloBinding.enterName(name);
(await helloBinding.grabTitle()).should.equal(`Hello, ${name}!`);
}).tag('@hello-binding-mocha').tag('smoke');
2 changes: 1 addition & 1 deletion packages/codeceptjs-lwc-example/codecept.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ let conf = {
exports.config = merge(
merge(conf, master_config),
codeceptjs_saucelabs(SAUCE_USERNAME, SAUCE_KEY)
);
);
6 changes: 4 additions & 2 deletions packages/codeceptjs-lwc-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
"devDependencies": {
"@wdio/selenium-standalone-service": "^5.16.10",
"allure-commandline": "^2.13.0",
"codeceptjs": "https://github.com/gkushang/CodeceptJS#feature/shadow-dom",
"codeceptjs-saucelabs": "^4.0.1",
"codeceptjs-shared": "^4.0.3",
"debug": "^4.1.1",
"deepmerge": "^4.2.2",
"faker": "^4.1.0",
Expand All @@ -49,5 +47,9 @@
"should": "^13.2.3",
"soft-assert": "^0.2.0",
"webdriverio": "^5.22.3"
},
"dependencies": {
"codeceptjs": "^2.6.0",
"codeceptjs-shared": "^4.0.3"
}
}
22 changes: 16 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1865,9 +1865,10 @@ codeceptjs@^2.5.0:
semver "^6.2.0"
sprintf-js "^1.1.1"

"codeceptjs@https://github.com/gkushang/CodeceptJS#feature/shadow-dom":
version "2.5.0"
resolved "https://github.com/gkushang/CodeceptJS#636f7331388c263312ef666171d8c9fa211483c7"
codeceptjs@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/codeceptjs/-/codeceptjs-2.6.0.tgz#49658768e009701c68e7db37b6eb3e89f569e94d"
integrity sha512-8nqQ5cpSiyTnXkS0r93lKmuYxkqHrKYg8FFdhDqy3TDv8xR8OVyGAmf7zOh/oWCbwTX4wvRfEz7oKTLFrmeKKA==
dependencies:
"@codeceptjs/configure" "^0.4.0"
allure-js-commons "^1.3.2"
Expand All @@ -1888,13 +1889,13 @@ codeceptjs@^2.5.0:
js-beautify "^1.10.2"
lodash.clonedeep "^4.5.0"
lodash.merge "^4.6.2"
mkdirp "^0.5.1"
mkdirp "^1.0.3"
mocha "^6.2.2"
mocha-junit-reporter "^1.23.1"
ms "^2.1.2"
parse-function "^5.5.0"
promise-retry "^1.1.1"
requireg "^0.1.8"
requireg "^0.2.2"
resq "^1.7.0"
semver "^6.2.0"
sprintf-js "^1.1.1"
Expand Down Expand Up @@ -4387,7 +4388,7 @@ mkdirp-promise@^5.0.1:
dependencies:
mkdirp "*"

mkdirp@*:
mkdirp@*, mkdirp@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea"
integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g==
Expand Down Expand Up @@ -5541,6 +5542,15 @@ requireg@^0.1.8:
rc "~1.2.7"
resolve "~1.7.1"

requireg@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/requireg/-/requireg-0.2.2.tgz#437e77a5316a54c9bcdbbf5d1f755fe093089830"
integrity sha512-nYzyjnFcPNGR3lx9lwPPPnuQxv6JWEZd2Ci0u9opN7N5zUEPIhY/GbL3vMGOr2UXwEg9WwSyV9X9Y/kLFgPsOg==
dependencies:
nested-error-stacks "~2.0.1"
rc "~1.2.7"
resolve "~1.7.1"

resolve-cwd@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
Expand Down