Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-syntax-basics
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark committed Nov 22, 2024
2 parents ce62148 + 9e82161 commit f9d397c
Show file tree
Hide file tree
Showing 15 changed files with 341 additions and 146 deletions.
2 changes: 1 addition & 1 deletion code-examples/core/bdd-syntax/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
{
"fileName": "BDD.robot"
} ]
}
}
18 changes: 10 additions & 8 deletions website/docs/about/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ sidebar_label: How to contribute
title: How to contribute
---

## Quickstart

This documentation project is powered by [Docusaurus](https://docusaurus.io/) and maintained on [GitHub](https://github.com/MarketSquare/robotframeworkguides)

The basic steps to contribute to the project are:
Expand All @@ -19,18 +21,18 @@ The basic steps to contribute to the project are:
- Build and Deployment will be handled by GitHub Actions


# GitHub Repository
## GitHub Repository

## Branches
### Branches

There are two branches in the project:

- `main` is the default branch and is used to maintain the documentation
- `gh-pages` is only used for the deployment of the `.html` documentation to GitHub Pages

## Folders
### Folders

### Docs
#### Docs

Docs are written in Markdown and are stored [here](https://github.com/MarketSquare/robotframeworkguides/tree/main/website/docs)

Expand All @@ -54,14 +56,14 @@ You can use a `_category_.json` file to customize the sidebar label and the posi
}
```

## Static Files (e.g. images)
### Static Files (e.g. images)

Static files (like images) are stored in the `website/static` folder [here](https://github.com/MarketSquare/robotframeworkguides/tree/main/website/static)
They will be automatically included in the built and will be accessible via the `/` path (e.g. images are accessible via `/img/robotframeworkguides_logo.png`)

# Updating Documentation
## Updating Documentation

## Run the development server
### Run the development server

- Go to directory containing the `package.json` file
- Download dependencies via `npm install`
Expand All @@ -73,7 +75,7 @@ Changes are visible in real time in the browser.
![Development Server](/img/contribute/dev_server.png)


## Create Build and Push
### Create Build and Push

- Run the build via `npm run build`
- Test the build locally with `npm run serve`
Expand Down
2 changes: 1 addition & 1 deletion website/docs/different_libraries/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Examples are:

## Examples

Check out the [tests](https://github.com/franz-see/Robotframework-Database-Library/tree/master/test) folder in the repository for examples.
Check out the [tests](https://github.com/MarketSquare/Robotframework-Database-Library/tree/master/test) folder in the repository for examples.

Example for a PostgreSQL database:

Expand Down
2 changes: 1 addition & 1 deletion website/docs/different_libraries/libraries.table.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const libraries = [
title: "Database Library",
description: "Python based library for database testing.",
isData: "✅",
url: "https://github.com/franz-see/Robotframework-Database-Library",
url: "https://github.com/MarketSquare/Robotframework-Database-Library",
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Use a Keyword with multiple arguments

<iframe src="https://robotframework.org/embed/?code-gh-url=https://github.com/MarketSquare/robotframeworkguides/tree/main/code-examples/extending_robot_framework/static_library/Static_Library_With_Class" width="100%" height="250"></iframe>

### Static Library withouth a Class
### Static Library without a Class

```python
import base64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class CopyTest(SuiteVisitor):
"""Copy and modify tests in the test suite."""
for test in suite.tests:
if "copy" not in test.tags:
test_case = suite.tests.append(test.copy())
test_case = suite.tests.append(test.deepcopy())
test_case.tags.add("copy")
test_case.name = f"{test_case.name} (copy)"
```
Expand Down
47 changes: 41 additions & 6 deletions website/docs/getting_started/ide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ It provides extensions for a lot of different languages and technologies.
![VS Code](/img/vscode_site.png)

Popular extensions for Robot Framework:
- [Robot Code](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode)
- [Robot Code](https://robotcode.io)
- [Robot Framework Language Server](https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp)
- ⚠️ No longer maintained and does not work with Robot Framework 7+

#### Install Visual Studio Code

Expand Down Expand Up @@ -88,14 +89,15 @@ e.g. `sudo rpm -i ~/Downloads/code-1.65.2-1646927812.el7.x86_64.rpm`

#### Visual Studio Code Extensions

:::caution
:::tip Only install one Robot Framework Extension
Make sure that only a **single** Robot Framework extension is installed.
We strongly recommend to only install [RobotCode](https://robotcode.io)
:::

<Tabs>
<TabItem value="Robot Code" label="Robot Code">

[RobotCode](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode) is a Visual Studio Code extension for Robot Framework.
[RobotCode](https://robotcode.io) is a Visual Studio Code extension for Robot Framework.

![RobotCode](/img/robotcode.png)

Expand All @@ -104,11 +106,16 @@ Make sure that only a **single** Robot Framework extension is installed.
3. Search for `RobotCode` and click on it
4. Click on `Install`

Check out this extended Tutorial about Robot Code
<iframe width="560" height="315" src="https://www.youtube.com/embed/7Uad_250YuI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

</TabItem>
<TabItem value="Robot Framework Language Server" label="Robot Framework Language Server">

[Robot Framework Language Server](https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp) is a Visual Studio Code extension for Robot Framework.

⚠️ No longer maintained and does not work with Robot Framework 7+

![Robot Framework Language Server](/img/rflsp.png)

1. Open Visual Studio Code
Expand All @@ -126,6 +133,7 @@ Make sure that only a **single** Robot Framework extension is installed.

Popular extensions for Robot Framework:
- [Robot Framework Language Server](https://plugins.jetbrains.com/plugin/16086-robot-framework-language-server)
- [Hyper RobotFramework Support](https://plugins.jetbrains.com/plugin/16382-hyper-robotframework-support)

<iframe width="560" height="315" src="https://www.youtube.com/embed/srgZ3eQ6erw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Expand All @@ -141,7 +149,9 @@ Make sure to install the free `PyCharm Community Edition` and not the `PyCharm P

#### PyCharm extensions

Make sure that only one single Robot Framework extension is installed.
:::tip Only install one Robot Framework Extension
Make sure that only a **single** Robot Framework extension is installed.
:::

##### Robot Framework Language Server

Expand All @@ -154,6 +164,32 @@ Make sure that only one single Robot Framework extension is installed.
6. Add a Debug Configuration for Robot Framework to run current test case (via selected text)
![Debug Config Current Test Case](/img/getting_started/pycharm_conf_selected_test.png)

<Tabs>
<TabItem value="Robot Framework Language Server" label="Robot Framework Language Server">

⚠️ No longer maintained and does not work with Robot Framework 7+

1. Press `Ctrl + Alt + S` to open the settings dialog
2. Select `Plugins`
3. Select the `Marketplace` tab
4. Search for `Robot Framework Language Server` and click on `Install`
5. Add a Debug Configuration for Robot Framework to run current test suite
![Debug Config Current Test Suite](/img/getting_started/pycharm_conf_current_suite.png)
6. Add a Debug Configuration for Robot Framework to run current test case (via selected text)
![Debug Config Current Test Case](/img/getting_started/pycharm_conf_selected_test.png)

</TabItem>

<TabItem value="Hyper RobotFramework Support" label="Hyper RobotFramework Support">

1. Press `Ctrl + Alt + S` to open the settings dialog
2. Select `Plugins`
3. Select the `Marketplace` tab
4. Search for `Hyper RobotFramework Support` and click on `Install`

</TabItem>

</Tabs>

## Run and Debug Robot Framework Tests

Expand All @@ -176,8 +212,7 @@ Test Execution will begin and stop at the breakpoint.
Use `Debug Toolbar` to select actions like step over, step into, step out, continue, pause, etc.
![Debug Toolbar](/img/VSC_DebugToolbar.png)

Run Robot Frameworm commands while debugging from `Debug Console`.
Commands needs to start with `! `
Run Robot Framework commands while debugging from `Debug Console`.
![Debug Console](/img/VSC_RBTCD_executeDebugCommands.png)

### PyCharm with Robot Framework Language Server
Expand Down
133 changes: 22 additions & 111 deletions website/docs/getting_started/rpa.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,115 +7,6 @@ description: Use rcc to create a new RPA project
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

:rocket: **Welcome!** <br/>
You can find more explanations and guidance down below, but first, let's get you running a bot :runner:

## Run your first robot
The scripts below enable you to get a robot setup and running from a selection of templates using a CLI tool called [RCC](https://github.com/robocorp/rcc#readme)

<Tabs>
<TabItem value="Windows" label="Windows" default>

```
curl -o rcc.exe https://downloads.robocorp.com/rcc/releases/latest/windows64/rcc.exe
rcc create example
cd example
..\rcc run
```
</TabItem>
<TabItem value="MacOS" label="MacOS">

```
brew install robocorp/tools/rcc
rcc create example
cd example
../rcc run
```
</TabItem>
<TabItem value="Linux" label="Linux">

```
curl -o rcc https://downloads.robocorp.com/rcc/releases/latest/linux64/rcc
chmod a+x rcc
rcc create example
cd example
../rcc run
```
</TabItem>
</Tabs>

The first run sets up the environment, so it takes a bit longer, but if you do the `rcc run` a second time, you'll see the power of RCC.

:rocket: With your bot running, you can now look deeper into what you just did and then jump on to editors to get cracking.

## What is this RCC?

[RCC](https://github.com/robocorp/rcc#readme) is an open-source tool that handles everything essential around an RPA robot run on Windows, macOS, and Linux. With RCC, the machine running the robot does not even need Python installed.

So, if you look back into [the first robot you ran](/docs/getting_started/rpa#run-your-first-robot), you will see the following:
1. The environment your bot needs is defined in: [conda.yaml](https://github.com/robocorp/rcc/blob/master/docs/recipes.md#what-is-in-condayaml)
1. How your robot is executed is defined in: [robot.yaml](https://github.com/robocorp/rcc/blob/master/docs/recipes.md#what-is-in-robotyaml)
1. The logic of your bot is in Robot Framework (`.robot`) or Python (`.py`) -files... or both.

With the above files [RCC](https://github.com/robocorp/rcc#readme) can set up an isolated environment and ensure your bot runs the same way every time.<br/>
:point_right: Get rid of: "Works on my machine".

> RCC has a lot of cool tricks, so once you've gotten started, it is worth [check out some more](https://github.com/robocorp/rcc/tree/master/docs#readme)
:rocket: So now you have your bot running and have a slight idea how you got there; what next?<br/>
You need to see and edit your bot code to get it doing what you need, so head-on to the [Editor and IDEs](/docs/getting_started/rpa#editors-and-ides)

## Editors and IDEs
There is no shortage of editors for Robot Framework and Python, but for RPA work, we limit the list to get you started. In the end, what you create is just Robot Framework and Python code, so you are not limited to the tools mentioned here.

### Automation Studio
If you are unfamiliar with coding and tools like VS Code, we'd recommend starting with a tool like [Automation Studio](https://robocorp.com/automation-studio).

![](studio.gif)

This kind of IDE enables you to start without worrying about syntax, environments, etc., right from the bat. You can still get quite far, and the tool allows you to see and edit on the code level. Automation Studio is also creating a robot just like the first RCC bot, so you can jump to other tools if you feel limited.

> For the test automation people:<br/>
Note that there is very little RPA specific about Automation Studio as it is just generating Robot Framework code.<br/>
Even hard-boiled coders like to do things easy once in a while :wink:

### Visual Studio Code

If you are using [VS Code](https://code.visualstudio.com) or are looking for the complete feature set of developer tools, then the extensions are for you.

:point_right: [Get VS Code here](https://code.visualstudio.com)

To get going with RPA development, you need two extensions: The extension for LSP and the RCC extension.

### RCC extension for VS Code
This extension brings in the RCC functionality with command palette commands and a nice sidebar.

:point_right: [Get Robocorp Code here](https://marketplace.visualstudio.com/items?itemName=robocorp.robocorp-code)

![](vscode-code.gif)

### Robot Framework LSP extensions for VS Code
Language Server Protocol extensions bring in code completion, documentation, highlighting, etc., for your Robot Framework code.
There are options here, but **remember only to install one** as multiple LSP handlers will cause problems:


<Tabs>
<TabItem value="LSP" label="Robot Framework Language Server" default>

:point_right: [Get Robot Framework LSP here](https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp)

![](vscode-lsp.gif)

</TabItem>
<TabItem value="RobotCode" label="Robot Code">

:point_right: [Get Robot Code here](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode)

![](vscode-robotcode.gif)
</TabItem>
</Tabs>


## About Robotic Process Automation (RPA)

Robotic Process Automation (RPA) is similar to test automation on the technical level, but the mentality is different on the business and results side. In RPA, it is pretty standard that you are not running on a machine you control entirely, so your robot needs to be "self-sufficient" and isolated. Also, instead of finding and documenting places where robot execution fails or succeeds, the aim is always to succeed and get the result of the process.
Expand All @@ -136,8 +27,6 @@ You are raring to go, so go ahead and check out the resources and libraries -par
For the resources and libraries part you can check out the following pages:
* [RPA libraries](/docs/different_libraries/rpa)
* [How to find the right library](/docs/different_libraries/how_to_find_library)
* Sources for RPA example in Robot Framework:
* [Robocorp Portal](https://robocorp.com/portal/)

The main point to remember is that with Robot Framework and Python, there are just about no limits to what you can do. There are a ton of libraries out there, but you can also make your own.

Expand All @@ -149,5 +38,27 @@ It is quite rare that the business value of an RPA process is in the library tha
* [Help out with this documentation](/docs/about/contribute)
* Create example bots into the public repository and ping in the forums and Slacks

## Editors and IDEs
There is no shortage of editors for Robot Framework and Python, but for RPA work, we limit the list to get you started. In the end, what you create is just Robot Framework and Python code, so you are not limited to the tools mentioned here.

### Visual Studio Code

If you are using [VS Code](https://code.visualstudio.com) or are looking for the complete feature set of developer tools, then the extensions are for you.

:point_right: [Get VS Code here](https://code.visualstudio.com)

To get going with RPA development, you need an extension that's call a language server protocl. Essentially it is a plug-in or extension that provides helpers within the IDE environment that assist you in writing your RPA scripts.

### Robot Framework LSP extensions for VS Code
Language Server Protocol extensions bring in code completion, documentation, highlighting, etc., for your Robot Framework code.
There are a few options here but we recommend Robot Code. It is important to **remember only to install one** as multiple extensions will cause problems:


<Tabs>
<TabItem value="RobotCode" label="Robot Code" default>

:point_right: [Get Robot Code here](https://marketplace.visualstudio.com/items?itemName=d-biehl.robotcode)

![](vscode-robotcode.gif)
</TabItem>
</Tabs>
6 changes: 3 additions & 3 deletions website/docs/parsing_results.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Simple example to read number of passed and failed tests
from robot.api import ExecutionResult
result = ExecutionResult('output.xml')
stats = result.statistics
print(f"Number of Failed Tests: {stats.failed}")
print(f"Total number of Tests: {stats.passed}")
print(f"Number of Failed Tests: {stats.total.failed}")
print(f"Total number of Tests: {stats.total.passed}")
```

You can also create a table in a markdown file `report.md`with the results.
Expand Down Expand Up @@ -128,4 +128,4 @@ That's how the result will look like:
|A Failed Test Case|FAIL|

### More information
Check the [documentation](https://robot-framework.readthedocs.io/en/stable/autodoc/robot.result.html?highlight=Resultvisitor%20#module-robot.result.visitor)
Check the [documentation](https://robot-framework.readthedocs.io/en/stable/autodoc/robot.result.html?highlight=Resultvisitor%20#module-robot.result.visitor)
4 changes: 2 additions & 2 deletions website/docs/reporting_alternatives.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ It is integrated with Robot Framework via a listener [robotframework-reportporta


### Allure
[Allure Framework](https://docs.qameta.io/allure-report/) is a flexible lightweight multi-language test report tool that not only shows a very concise representation of what have been tested in a neat web report form, but allows everyone participating in the development process to extract maximum of useful information from everyday execution of tests.
[Allure Report](https://allurereport.org/) is a flexible lightweight multi-language test report tool that not only shows a very concise representation of what have been tested in a neat web report form, but allows everyone participating in the development process to extract maximum of useful information from everyday execution of tests.

It is integrated with Robot Framework via a listener [robotframework-allure](https://github.com/allure-framework/allure-python)
It is integrated with Robot Framework via a listener [robotframework-allure](https://github.com/allure-framework/allure-python). A detailed integration guide is available on the official website: https://allurereport.org/docs/robotframework/

### Grafana
Grafana can be used to visualize test results in a dashboard.
Expand Down
Loading

0 comments on commit f9d397c

Please sign in to comment.