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

Docs about Overview of Framework, Getting Started, Quick Setup #13

Merged
merged 62 commits into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
4dffa54
add quick start docs
gkushang Jan 13, 2020
8ffc052
docs
gkushang Jan 13, 2020
426380a
docs site
gkushang Jan 13, 2020
754b966
bmjenkins
gkushang Jan 15, 2020
94931da
docs
gkushang Jan 16, 2020
4dc4559
docs
gkushang Jan 16, 2020
2c68359
docs
gkushang Jan 17, 2020
1ee2afe
docs
gkushang Jan 17, 2020
c8d601b
docs
gkushang Jan 17, 2020
1e68c5e
docs
Jan 17, 2020
222d22e
docs
Jan 17, 2020
02dcd1d
docs
Jan 17, 2020
22f027b
docs
Jan 17, 2020
d45e790
docs
Jan 18, 2020
ea4ec34
docs
Jan 18, 2020
9cbd05f
docs
Jan 18, 2020
b49b46e
docs
Jan 18, 2020
d0c406e
docs
Jan 19, 2020
7fa8511
docs
Jan 19, 2020
bb65b80
docs
Jan 19, 2020
faa4f05
docs
Jan 19, 2020
6f2b7fb
docs
Jan 19, 2020
3ba3e47
docs
Jan 19, 2020
28d6c7f
docs
Jan 19, 2020
a3a13d0
update to codeceptjs-bdd
Jan 19, 2020
a8e44d2
docs
Jan 19, 2020
100cc40
docs
Jan 19, 2020
da0aa5a
docs
Jan 19, 2020
49cf847
docs
Jan 20, 2020
1c91797
Merge branch 'develop' of github.com:gkushang/codeceptjs-bdd into doc…
Jan 20, 2020
69dd37e
remove idea
Jan 20, 2020
6fcaa19
remove idea
Jan 20, 2020
f3f517f
home page
Jan 20, 2020
d2a5630
home page
Jan 20, 2020
7aa91d5
home page
Jan 20, 2020
95e6e88
docs
Jan 20, 2020
6ff421f
docs
Jan 20, 2020
8ff56ee
docs
Jan 20, 2020
502c986
docs
Jan 20, 2020
e6d74da
docs
Jan 20, 2020
656436e
docs
Jan 20, 2020
bce13f7
docs
Jan 20, 2020
7bad3e7
docs
Jan 20, 2020
98e4827
docs
Jan 20, 2020
a623d7a
docs
Jan 20, 2020
e76ca5e
docs
Jan 20, 2020
891bb62
docs
Jan 20, 2020
a9a9a99
docs
Jan 20, 2020
901d046
docs
Jan 20, 2020
6927edf
docs
Jan 20, 2020
ed76c16
docs
Jan 21, 2020
864aade
docs
Jan 22, 2020
9765e59
docs
Jan 22, 2020
f6aaca5
docs
Jan 22, 2020
a23529f
docs
Jan 22, 2020
cd098c3
docs
Jan 22, 2020
b1ca746
docs
Jan 23, 2020
a7c93a9
docs
Jan 23, 2020
e5d036d
docs
Jan 24, 2020
731f6f2
docs
Jan 24, 2020
f842adb
docs
Jan 24, 2020
105e706
docs
Jan 24, 2020
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
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions .idea/codeceptjs-bdd.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

49 changes: 49 additions & 0 deletions documentation/docs/1-getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Installation
sub_title: Install required dependencies to setup CodeceptJs BDD Framework
parents: ["Getting Started"]
---

# ⏳ codeceptjs-bdd

Clone Codeceptjs-BDD framework libraries for getting started

```bash

git clone https://github.com/gkushang/codeceptjs-bdd.git

```

<br/>

## ⏳ yarn

You can install Yarn through the [Homebrew package manager](https://brew.sh/). This will also install Node.js if it is not already installed.

```bash

brew install yarn

```

<br/>

## ⏳ lerna

Install Lerna through the [Lerna](https://lerna.js.org/).

```bash

yarn add lerna

```

(optional) Boostrap the Codeceptjs-BDD Packages

```bash

cd codeceptjs-bdd
lerna bootstrap

```

40 changes: 40 additions & 0 deletions documentation/docs/1-getting-started/setup-framework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Setup Framework
sub_title: Setup Codeceptjs-BDD Framework for your app
parents: ["Getting Started"]
---

## 🔳 Interactive CLI

This framework provides an Interactive CLI to setup the framework in just two steps.

The CLI,
1. Creates a Codeceptjs BDD Framework for your App
2. Automatically updates your `package.json` with all required dependencies.
3. Installs all dependencies as part of setup process
4. Adds Master Configuration
5. Configures Sauce Labs (optional)
6. Runs existing Sample BDD Feature Files to test your setup

This Framework comes with the Sample BDD Feature files with examples. Please follow through the [Examples](https://github.com/gkushang/codeceptjs-bdd/tree/develop/packages/codeceptjs-cucumber/acceptance/features) to create your own Feature Files & Scenarios.


## 🚀 Quick Setup

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
cd codeceptjs-bdd/packages/codeceptjs-cucumber
yarn
npm run cli

```

💯Follow the instructions on CLI. Once done, you're ready to start writing automated Feature files for your app 🎉

### 🎥 Watch Quick Setup in Action

<a href='https://youtu.be/OGrn1ejyb-k' target='_blank'><img src='https://i.postimg.cc/DZ15ztxk/Screen-Shot-2020-01-20-at-2-53-19-PM.png' border='0' alt='BDD'/></a>

51 changes: 51 additions & 0 deletions documentation/docs/execution/1-run-locally.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Run Locally
sub_title: Execute Features on Local Development Enviornment
parents: ["Execution"]
---

## 💻 Run All Tests

Below command runs full regression on Default Browser.

Default Browser: `Chrome`

```bash

yarn acceptance

```
<br>

### 🎠 Run on Different Browser

Browser selection is conrolled by `--profile <browser>` command line parameter

Below command runs full regression on **Firefox** Browser.

```bash

yarn acceptance --profile firefox

```
<br>

### 🌀 To run Individual Tags

Run individual tags by `--grep <@tag>` command line parameter

Below command runs tests tagged with **@my\_test\_tag** on _default_ browser

```bash

yarn acceptance --grep @my_test_tag

```

More information on tags is available [here](https://somelin.com)

### 🎥 Watch in Action

<a href='https://youtu.be/udp_ZYT4imM' target='_blank'><img src='https://i.postimg.cc/XNL9jHmW/Run-All-Tests-Locally.png' border='0' alt='How To Run Tests Locally'/></a>


59 changes: 59 additions & 0 deletions documentation/docs/execution/2-run-subset-of-scenarios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: Run Subset of Scenarios
sub_title: Run subset of Scenarios through @Tags
parents: ["Execution"]
---

## 🌀Tags

Tags are a great way to organise your features and scenarios. Cucumber features and scenarios can contain Tags marked with `@`. Tags can be used to run Subset of Scenarios.

```bash
@checkout
Feature: Checkout Cart

@checkout_as_guest
Scenario: Fred check out the item as a guest user
Given hello

Scenario: More other checkouts
Given hello
```

A feature or scenario can have as many tags as you like. Separate them with spaces:

```bash
@checkout @checkout_guest @checkout_registered
Feature: Checkout Cart
```

Tags can be placed above the following Gherkin elements:

* Feature
* Scenario
* Scenario Outline
* Examples

### 🌀 Running a subset of scenarios

Run subset of tags through command line parameter: `--grep <@tag>`.

Below command runs tests tagged with **@my\_test\_tag** on _default_ browser

```bash

yarn acceptance --grep @my_test_tag

```

### 🌀 Exclude or Include certain types of Tags

Use regex for more flexible filtering:

* **\--grep** '(?=.*@smoke2)(?=.*@smoke3)' - run tests with @smoke2 and @smoke3 in name
* **\--grep** "\@smoke2|\@smoke3" - run tests with @smoke2 or @smoke3 in name
* **\--grep** '((?=.*@smoke2)(?=.*@smoke3))|@smoke4' - run tests with (@smoke2 and @smoke3) or @smoke4 in name
* **\--grep** '(?=.*@smoke2)^(?!.*@smoke3)' - run tests with @smoke2 but without @smoke3 in name
* **\--grep** '(?=.*)^(?!.*@smoke4)' - run all tests except @smoke4

More information is available on [codecpet.io](https://codecept.io/bdd/#tags)
93 changes: 93 additions & 0 deletions documentation/docs/execution/3-run-on-saucelabs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: Run on Sauce Labs
sub_title: Execute BDD Scenarios on Sauce Labs
parents: ["Execution"]
---
## ⚡️ Sauce Labs
Codeceptjs-BDD framework integrates the cloud based platform [Sauce Labs](https://saucelabs.com) to execute scenarios on **900+** Desktop/Mobile browses, OS & Devices combinations, providing Greater Scenarios Execution Coverage.

### ** Prerequsite

1. In order to run on Sauce Labs, you should have an account with Sauce Labs.

2. During Codeceptjs-BDD setup through CLI, you should have provided your Sauce Username and Sauce Access Key in order to start running your tests on Sauce Labs.
3. You must export **SAUCE\_USERNAME** and **SAUCE\_KEY** environmental variables as shown below,

**Recommendation:** Export these enviornment variable through your ZSH or BASH profile.

```bash
export SAUCE_USERNAME=<your_sauce_username>
export SAUCE_KEY=<your_sauce_accesskey>
```

Once you provide your Sauce username and accesskey during [quick setup](/1-getting-started/setup-framework/), Codeceptjs-BDD will do the rest of the job for you, and integrates all required libraries, plugins and helpers to get started.

<br>

## 🏃 Run Scenarios on Sauce Labs

Codeceptjs-BDD implements the quick way to run your tests on Sauce Labs. Please note the `sauce:` in the below command, which does the magic running your tests on Sauce.

`--profile sauce:<browser>`
<br>

### ✔️ Run all scenarios

Below command runs all scenarios on Sauce Labs' _chrome_ browser

```bash
yarn acceptance --profile sauce:chrome
```


### ✔️ Run subset of scenarios

Below command runs all scenarios marked with tag _@my\_tag_ on Sauce Labs' _firefox_ browser

```bash
yarn acceptance --profile sauce:firefox --grep @my_tag
```
<br>

## 📋 Sauce Labs Dashboard

Dashboard is the great way group your scenarios/regression suites on Sauce platform. The Sauce Dashboard is the first page you'll see when you log into the Sauce Labs web interface. Each link on Dashboard contains group of tests ran for the particular _build_.

Codeceptjs-BDD will automatically create an Unique dashboard for every tests run.

**Can I Customize my Dashboard Title?**
Yes, you can do that too by by providing `SAUCE_BUILD` environment variable. This is sometimes very helpful to view how many and what tests ran for which release build.

Below command will create unique dashboard on sauce with title **release-1.0-{random-unique-number}**

```bash
SAUCE_BUILD=release-1.0 yarn acceptance --profile sauce:chrome
```
<br>

## ➕ Supported Sauce Labs Browsers/OS Combinations

The supported browsers/OS is listed [here](https://github.com/gkushang/codeceptjs-bdd/blob/master/packages/codeceptjs-saucelabs/lib/browsers.conf.js).

**Can I run on my own Customized browser/os?** Yes, you can override any existing configruation or provide new Browser configuration through your `codecept.conf.js` file.

Follow the below steps,
1. Go to your codecept.conf.js
2. Go to last line of the config and look for `codeceptjs_saucelabs(SAUCE_USERNAME, SAUCE_KEY)`
3. Pass your customized Browser/OS combination JSON as a **third** argument in above function.

Below call will add `opera` browser to your Sauce configuration at runtime.

```bash
codeceptjs_saucelabs(SAUCE_USERNAME, SAUCE_KEY, {opera: {
browser: 'opera',
capabilities: {
'sauce:options': {
seleniumVersion: '3.11.0'
}
}
}
})
```


7 changes: 7 additions & 0 deletions documentation/docs/execution/4-run-parallel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Run Tests in Parallel
sub_title: Execute features on Single browser locally
parents: ["Execution"]
---

# Coming Soon
7 changes: 7 additions & 0 deletions documentation/docs/execution/5-run-on-multi-browsers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: Run Tests on MultiBrowsers
sub_title: Execute features on Single browser locally
parents: ["Execution"]
---

# Coming Soon
Binary file removed documentation/docs/quick-start/codeceptjs-cli.gif
Binary file not shown.
19 changes: 0 additions & 19 deletions documentation/docs/quick-start/codeceptjs-cucumber.md

This file was deleted.

Loading