Commit 81f5c09a authored by Naum Spaseski's avatar Naum Spaseski
Browse files

add README

parents
Loading
Loading
Loading
Loading

README.md

0 → 100644
+63 −0
Original line number Original line Diff line number Diff line
# NCClient + Robot Framework

## Prepare environment / installation

In your WSL environment, create a folder for the project (or clone the corresponding repo from git).

Inside, create a requirements.txt file with the following contents:

```
robotframework
robotframework-ncclient
```

Then create the Python virtual env (venv) that will be used inside the project:

```
python3 -m venv .venv
```

If properly configured, VSCode will automaticaly detect the newly created venv.

Once you are inside the virtual env, install all dependencies:

```
pip install -r requirements.txt
```

## Writing test cases

Once the environment is ready, you can start writing test cases.

In the "Settings" part of the .robot file, import the libraries needed for the test.

```
*** Settings ***
Library           NcclientLibrary
```

Then you can start writing keywords:

```
*** Keywords ***
the Maker has started a game with the word "silky"
    No Operation
```

And use them in different test cases:

```
*** Test Cases ***
Test Login
    ${config} =    Create Dictionary    host=A.B.C.D    port=830    username=user    password=password    hostkey_verify=False
    Connect    &{config}
    Get Server Capabilities
    Should Contain    ${config}     an_item

test in gherkins
    Given the Maker has started a game with the word "silky"
    When the Breaker joins the Maker's game
    And some other thing
    Then the Breaker must guess a word with 5 characters
```