> For the complete documentation index, see [llms.txt](https://aurococcus.gitbook.io/wasd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aurococcus.gitbook.io/wasd/master.md).

# Quick start

## 1. Requirements

* python >= 3.6
* pyenv is recommended ([pyenv](https://github.com/pyenv/pyenv) & [pyenv virtualenv plugin](https://github.com/pyenv/pyenv-virtualenv))
* Docker & image selenoid/vnc\_chrome:##.# (<https://hub.docker.com/r/selenoid/vnc_chrome>)
  * Or selenium-server

## 2. Install

Build from source:

```bash
$ git clone git@github.com:Aurococcus/wasd.git
$ cd wasd
$ pip install .
```

From pypi:

```bash
$ pip install wasd
```

## 3. Setup

```bash
$ mkdir my_project && cd my_project
# activate venv e.g. $ pyenv local my_venv
$ pip install wasd
$ wasd scaffold
$ invoke selenoid.up # if using Selenoid
$ pytest tests
```

This creates configuration file `_wasd_settings.yml`, basic project structure and sample test.

## 4. Configure

```
# web driver
url: 'https://google.com # your app url
implicit_timeout: 5      # implicit wait, sec.
window_size: 'maximize'  # 'maximize' or explicitly '800x600'

# selenium-server / selenoid
protocol: 'http'
host:     'localhost'
port:     '4444'
path:     '/wd/hub'

# any data
username: 'admin'
password: 'admin'

var_from_env: %MY_VARIABLE%  # Dynamic configuration from environment variables

# caps
capabilities:
    browserName: 'chrome'
    unexpectedAlertBehaviour: 'accept'
    enableVNC: True
    screenResolution: '1920x1080x24'
    loggingPrefs:
        browser: 'INFO'
    chromeOptions:
        args: ['--disable-infobars']
```

## 5. Write a test

Create file  `tests/test_foo.py`:

```python
import pytest
from wasd.wd import Element as E


class TestFoo:

    @pytest.mark.want_to('I wanna be the boshy')
    def test_a(self, browser):
        browser.open('/')
        browser.fill_field( E("[name = 'q']"), 'Hello, World!' )
        browser.wait_for_element_visible( E("[name = 'btnK']") )
        browser.click( E("[name = 'btnK']") )
```

## 6. Run

Use `pytest` for running tests:

```bash
$ pytest --steps
```

Add `--steps` option for verbose log.

![](/files/-M6pVaCoQBecMAxh1EPP)

## 7. CLI options

`$ pytest --env=<env>` - run tests with settings file `<env>.yml` from `_env` dir

`$ pytest --listener` - highlight found element during runtime

`$ pytest --save-screenshot` - save screenshot on failure in `_output` dir

`$ pytest --steps` - enable verbose log
