diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca80f49..09af89d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build & Check Package +name: build & validate on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc26548..966dc07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Bump Version From PR Title +name: release on: pull_request: diff --git a/README.md b/README.md index 436ca11..6a8b70d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# robot-visualizer +# Robot Framework Visualizer Keywords from this repository can visualize CSV data as graph within the robotframework log file. ## Statistics @@ -29,14 +29,28 @@ pip install robotframework-visualizer ## Usage -```python +```robot *** Settings *** Library Visualizer *** Test Cases *** -Visualize Data - ${csv_file_path} = Keyword.Write Data To Csv - Visualizer.Add To Diagram ${csv_file_path} _time _value Value Axis Blue - Visualizer.Visualize +Add One Data Set + [Documentation] Add one graph to diagram. + Visualizer.Add To Diagramm ${CURDIR}${/}testdata${/}dummy_strom_spannung.csv _time _strom Strom Blue + Visualizer.Visualize Strom / Spannung Verlauf + +Add Two Data Sets + [Documentation] Add two graphs to diagram. + Visualizer.Add To Diagramm ${CURDIR}${/}testdata${/}dummy_strom_spannung.csv _time _spannung Spannung Green + Visualizer.Add To Diagramm ${CURDIR}${/}testdata${/}dummy_strom_spannung.csv _time _strom Strom Blue + Visualizer.Visualize Strom / Spannung Verlauf ``` + +## Result + +### Added one graph to diagram +![alt text](docs/one_graph.png) + +### Added one graph to diagram +![alt text](docs/two_graphs.png) \ No newline at end of file diff --git a/docs/one_graph.png b/docs/one_graph.png new file mode 100644 index 0000000..dd699f4 Binary files /dev/null and b/docs/one_graph.png differ diff --git a/docs/two_graphs.png b/docs/two_graphs.png new file mode 100644 index 0000000..5be47bc Binary files /dev/null and b/docs/two_graphs.png differ diff --git a/src/Visualizer/__init__.py b/src/Visualizer/__init__.py index 6f6440a..a060957 100644 --- a/src/Visualizer/__init__.py +++ b/src/Visualizer/__init__.py @@ -15,13 +15,10 @@ class Visualizer(HybridCore): """ Visualizer Library for creating visual diagrams as embedded 'png' images in the Robot Framework log file.\n - = Current Implementation = + = Use Case = The initial idea of the library was to create diagrams with the date time series on the x-axis & the raw value on the y-axis.\n - Currently, you need to pass the CSV header names into keyword to visualize the correct data. - - = Future Implementation = - The future implementation idea is, to pass multiple CSV header names into the keyword to visualize more than one value time series on the y-axis. - The x-axis should be kept reserved for the datetime time-series. + You can pass a CSV file or data-object & create one or multiple graphs within a diagram. + First, you need to add data to a diagram & afterwards you can use ``Visualize`` keyword to create the diagram as png image. """ def __init__(self): diff --git a/tests/atest/generic.robot b/tests/atest/generic.robot index 3c4c84f..2a27251 100644 --- a/tests/atest/generic.robot +++ b/tests/atest/generic.robot @@ -4,10 +4,12 @@ Library Visualizer *** Test Cases *** Add One Data Set + [Documentation] Add one graph to diagram. Visualizer.Add To Diagramm ${CURDIR}${/}testdata${/}dummy_strom_spannung.csv _time _strom Strom Blue Visualizer.Visualize Strom / Spannung Verlauf Add Two Data Sets + [Documentation] Add two graphs to diagram. Visualizer.Add To Diagramm ${CURDIR}${/}testdata${/}dummy_strom_spannung.csv _time _spannung Spannung Green Visualizer.Add To Diagramm ${CURDIR}${/}testdata${/}dummy_strom_spannung.csv _time _strom Strom Blue Visualizer.Visualize Strom / Spannung Verlauf