This repository has been archived on 2022-05-04. You can view files and clone it, but cannot push or open issues or pull requests.
tso-sw/README.md

63 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2020-05-11 03:21:43 +02:00
# TSO-SW
2020-05-11 04:40:46 +02:00
[![Build Status](https://drone.dotya.ml/api/badges/wanderer/tso-sw/status.svg)](https://drone.dotya.ml/wanderer/tso-sw)
2020-06-23 02:34:23 +02:00
[![](https://img.shields.io/badge/license-WTFPL-blue)]()
2020-05-11 04:40:46 +02:00
2020-06-23 02:34:23 +02:00
this repo holds the *sawce* files for the TSO semestral work
2020-07-01 17:06:09 +02:00
#### hierarchy
<p align="center">
<img alt="test_hierarchy" src="test_hierarchy.png" height="386" />
2020-07-01 17:06:09 +02:00
</p>
### preferred workflow
2020-06-15 00:29:19 +02:00
* using a container image with `robotframework`, `selenium`, `chromium` and `chromedriver` preinstalled, such as [`alpine-rf`](https://git.dotya.ml/wanderer/docker-alpine-rf) or [`archlinux-rf`](https://git.dotya.ml/wanderer/docker-archlinux-rf)
> Note: you may need to run some of the following commands as root. You can as well learn how not to [here.](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
2020-06-15 00:29:19 +02:00
#### get a container and run it
2020-06-15 00:29:19 +02:00
fetch an image from a central container repository (by default it's [DockerHub](https://hub.docker.com/)) using
```bash
2020-06-15 00:29:19 +02:00
docker pull immawanderer/alpine-rf:latest
```
the [`alpine-rf`](https://hub.docker.com/r/immawanderer/alpine-rf/builds) image is being rebuilt <del>on an hourly</del> on a daily basis, so I recommend updating frequently.
2020-06-15 00:29:19 +02:00
run the container in interactive mode, mounting user's `$PWD` into container's `/testing` folder, removing the container after exiting (so that it doesn't take up space) while preserving the work done (saved on the shared volume)
```bash
2020-06-15 00:29:19 +02:00
docker run --rm -it -v $PWD:/testing immawanderer/alpine-rf:latest
```
#### run robot tests
2020-06-15 00:29:19 +02:00
as the `WORKDIR` of the image used in this example is set to the `/testing` folder, all that's left is to prepare a `results` directory inside there
2020-06-15 00:29:19 +02:00
```bash
❄ root@alpine-rf /testing
➜ mkdir -p /testing/results
```
then simply run the test(s)
2020-06-15 00:29:19 +02:00
```bash
❄ root@alpine-rf /testing
➜ robot -T -d results test00.robot
```
2020-06-15 00:29:19 +02:00
or (when using the [`alpine-rf image`](https://git.dotya.ml/wanderer/docker-alpine-rf)) run all of the above as a designated test user `rf` (`uid=1000`) instead of `root`
```bash
❄ root@alpine-rf /testing
➜ su rf
/testing $ mkdir -pv results
/testing $ robot -T -d results test00.robot
2020-05-28 02:52:49 +02:00
```
#### mermaid.js
the [diagram](test_hierarchy.png) under [hierarchy](#hierarchy) was generated using [this](./test_hierarchy.mermaid.js) [`mermaid.js`](https://mermaid-js.github.io/mermaid/#/ "mermaid.js") code