Skip to content

Commit 0d690e5

Browse files
committed
Add MkDocs GitHub Pages, libdoc keyword docs, and Robocop CI
MkDocs + GitHub Pages: - Add mkdocs.yml with Material theme, navigation, and extensions - Rename docs to clean filenames (drop numeric prefixes) - Create docs/index.md for MkDocs homepage - Add .github/workflows/docs.yml for automated deployment - Enable GitHub Pages with Actions deployment Libdoc keyword documentation: - Add scripts/generate_keyword_docs.py (libdoc JSON → Markdown) - Generate docs/keywords/*.md for all 5 resource files - Add keyword docs section to MkDocs navigation Robocop code quality: - Add "minimal" ruleset v0.1.0 to pyproject.toml [tool.robocop.lint] - Add lint job to robot-tests.yml (separate from test job) - Add robocop step to pr-feedback.yml with PR comment integration - Fix DOC01 warnings in 3 test files (missing keyword docs) - Add mkdocs-material and mkdocs to docs dependency group
1 parent 316c64e commit 0d690e5

26 files changed

Lines changed: 1180 additions & 21 deletions

.github/workflows/docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy Documentation
2+
on:
3+
push:
4+
branches: [main]
5+
paths:
6+
- 'docs/**'
7+
- 'mkdocs.yml'
8+
- 'resources/*.resource'
9+
- 'scripts/generate_keyword_docs.py'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v7
29+
with:
30+
enable-cache: true
31+
python-version: "3.12"
32+
33+
- name: Install dependencies
34+
run: uv sync --no-dev --group docs
35+
36+
- name: Generate keyword documentation
37+
run: uv run python scripts/generate_keyword_docs.py
38+
39+
- name: Build MkDocs site
40+
run: uv run mkdocs build
41+
42+
- name: Upload Pages artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: site/
46+
47+
deploy:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.github/workflows/pr-feedback.yml

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ jobs:
2828
- name: Install dependencies
2929
run: uv sync --locked
3030

31+
- name: Run Robocop lint
32+
id: robocop
33+
continue-on-error: true
34+
run: |
35+
uv run robocop check tests/ resources/ 2>&1 | tee robocop-output.txt
36+
echo "exit_code=$?" >> $GITHUB_OUTPUT
37+
3138
- name: Initialize Browser Library
3239
run: uv run rfbrowser init chromium
3340

@@ -47,30 +54,56 @@ jobs:
4754
with:
4855
script: |
4956
const fs = require('fs');
50-
let output = '';
57+
58+
// Read test output
59+
let testOutput = '';
5160
try {
52-
output = fs.readFileSync('test-output.txt', 'utf8');
61+
testOutput = fs.readFileSync('test-output.txt', 'utf8');
5362
} catch (e) {
54-
output = 'Could not read test output.';
63+
testOutput = 'Could not read test output.';
5564
}
65+
const testLines = testOutput.trim().split('\n');
66+
const testSummary = testLines.slice(-10).join('\n');
5667
57-
// Extract summary line (last few lines of robot output)
58-
const lines = output.trim().split('\n');
59-
const summaryLines = lines.slice(-10).join('\n');
68+
// Read robocop output
69+
let robocopOutput = '';
70+
try {
71+
robocopOutput = fs.readFileSync('robocop-output.txt', 'utf8').trim();
72+
} catch (e) {
73+
robocopOutput = 'Could not read Robocop output.';
74+
}
75+
76+
const testPassed = '${{ steps.tests.outcome }}' === 'success';
77+
const robocopPassed = '${{ steps.robocop.outcome }}' === 'success';
78+
79+
const testIcon = testPassed ? '✅' : '❌';
80+
const testStatus = testPassed ? 'All tests passed!' : 'Some tests failed.';
6081
61-
const passed = '${{ steps.tests.outcome }}' === 'success';
62-
const icon = passed ? '✅' : '❌';
63-
const status = passed ? 'All tests passed!' : 'Some tests failed.';
82+
const robocopIcon = robocopPassed ? '✅' : '⚠️';
83+
const robocopStatus = robocopPassed ? 'No issues found.' : 'Issues found — see details below.';
6484
65-
const body = `## ${icon} Robot Framework Test Results
85+
const body = `## ${testIcon} Robot Framework Test Results
6686
67-
**Status:** ${status}
87+
**Status:** ${testStatus}
6888
6989
<details>
7090
<summary>Test Output (last 10 lines)</summary>
7191
7292
\`\`\`
73-
${summaryLines}
93+
${testSummary}
94+
\`\`\`
95+
96+
</details>
97+
98+
## ${robocopIcon} Robocop Code Quality
99+
100+
**Status:** ${robocopStatus}
101+
102+
<details>
103+
<summary>Robocop Output</summary>
104+
105+
\`\`\`
106+
${robocopOutput}
74107
\`\`\`
75108
76109
</details>
@@ -91,3 +124,10 @@ jobs:
91124
with:
92125
name: pr-robot-results
93126
path: results/
127+
128+
- name: Upload Robocop report
129+
if: always()
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: pr-robocop-report
133+
path: robocop-output.txt

.github/workflows/robot-tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ on:
66
branches: [main]
77

88
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v7
16+
with:
17+
enable-cache: true
18+
python-version: "3.12"
19+
20+
- name: Install dependencies
21+
run: uv sync --locked
22+
23+
- name: Run Robocop lint
24+
run: uv run robocop check --output robocop-output.txt tests/ resources/
25+
26+
- name: Upload Robocop report
27+
if: always()
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: robocop-report
31+
path: robocop-output.txt
32+
933
robot-tests:
1034
runs-on: ubuntu-latest
1135
steps:

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ Thumbs.db
2121
# Browser Library runtime
2222
browser/
2323
playwright-log.txt
24+
25+
# MkDocs
26+
site/
27+
28+
# Robocop
29+
robocop.json
30+
.robocop_cache/

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ This workshop focuses on **web testing** using Browser Library against [SauceDem
4848

4949
## Documentation
5050

51-
- [Getting Started](docs/01-getting-started.md) — setup guide (Codespaces, local, Windows)
52-
- [RF Syntax Cheatsheet](docs/02-rf-syntax-cheatsheet.md) — quick reference
53-
- [Browser Library Guide](docs/03-browser-library-guide.md) — Browser Library keywords
54-
- [Exercises](docs/04-exercises.md) — progressive hands-on exercises
55-
- [Troubleshooting](docs/05-troubleshooting.md) — common issues and fixes
56-
- [AI-Assisted Testing](docs/06-ai-assisted-testing.md) — using AI for test generation
57-
- [Student Workflow](docs/07-student-workflow.md) — fork, write tests, submit PR
51+
- [Getting Started](docs/getting-started.md) — setup guide (Codespaces, local, Windows)
52+
- [RF Syntax Cheatsheet](docs/rf-syntax-cheatsheet.md) — quick reference
53+
- [Browser Library Guide](docs/browser-library-guide.md) — Browser Library keywords
54+
- [Exercises](docs/exercises.md) — progressive hands-on exercises
55+
- [Troubleshooting](docs/troubleshooting.md) — common issues and fixes
56+
- [AI-Assisted Testing](docs/ai-assisted-testing.md) — using AI for test generation
57+
- [Student Workflow](docs/student-workflow.md) — fork, write tests, submit PR
5858
- [Windows Setup](docs/windows-setup.md) — detailed Windows instructions
59+
- **[Full Documentation Site](https://hackxit.github.io/42vienna-robotframework-workshop/)** — hosted on GitHub Pages
5960

6061
## Common Commands
6162

File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ This is the **page object pattern** in action — abstracting complex flows into
103103
- Locked user → should show locked message
104104
- Empty username → should show required error
105105

106-
Study the `[Template]` section in `docs/02-rf-syntax-cheatsheet.md`.
106+
Study the `[Template]` section in the [RF Syntax Cheatsheet](rf-syntax-cheatsheet.md).
107107

108108
## Exercise 8: AI-Assisted Testing (Demo)
109109

File renamed without changes.

docs/index.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Robot Framework E2E Testing Workshop — 42 Vienna
2+
3+
[![Robot Framework Tests](https://github.com/HackXIt/42vienna-robotframework-workshop/actions/workflows/robot-tests.yml/badge.svg)](https://github.com/HackXIt/42vienna-robotframework-workshop/actions/workflows/robot-tests.yml)
4+
5+
**Part 2: Browser Library & Playwright for Web Testing**
6+
7+
Workshop Date: March 16, 2026, 16:00 — 42 Vienna, Muthgasse 24-26, 1190 Vienna
8+
9+
## Quick Start (3 steps)
10+
11+
1. **Fork** this repository (click "Fork" on GitHub)
12+
2. **Open a Codespace** on your fork: Code → Codespaces → Create codespace on main
13+
3. **Run the first test:**
14+
```bash
15+
uv run robot tests/00_setup_verification/
16+
```
17+
18+
That's it! If the test passes, your environment is ready.
19+
20+
## What is Robot Framework?
21+
22+
Robot Framework is a **generic** test automation framework. Unlike specialized tools (Cypress for web only, Postman for API only), Robot Framework uses **one syntax** and **one reporting format** across different testing domains:
23+
24+
- **Web testing** → Browser Library (Playwright) or SeleniumLibrary
25+
- **API testing** → RequestsLibrary or RESTinstance
26+
- **Mobile testing** → AppiumLibrary
27+
- **Desktop testing** → Various libraries
28+
29+
This workshop focuses on **web testing** using Browser Library against [SauceDemo](https://www.saucedemo.com).
30+
31+
## Prerequisites
32+
33+
- A **GitHub account** (that's it — we use Codespaces)
34+
- Optionally: local setup with Python 3.12+, Node.js 22+, and uv
35+
36+
## Workshop Agenda
37+
38+
| Time | Activity |
39+
|-------|----------|
40+
| 16:00 | Welcome, intro, environment setup |
41+
| 16:30 | RF syntax walkthrough + Browser Library basics |
42+
| 17:05 | Break |
43+
| 17:15 | Guided exercises: Login & Product tests |
44+
| 18:15 | Break |
45+
| 18:25 | Resource files, keyword abstraction, free exercises |
46+
| 19:15 | AI-assisted testing demo |
47+
| 19:30 | PR creation, CI results, wrap-up |
48+
49+
## Documentation
50+
51+
- [Getting Started](getting-started.md) — setup guide (Codespaces, local, Windows)
52+
- [RF Syntax Cheatsheet](rf-syntax-cheatsheet.md) — quick reference
53+
- [Browser Library Guide](browser-library-guide.md) — Browser Library keywords
54+
- [Exercises](exercises.md) — progressive hands-on exercises
55+
- [Troubleshooting](troubleshooting.md) — common issues and fixes
56+
- [AI-Assisted Testing](ai-assisted-testing.md) — using AI for test generation
57+
- [Student Workflow](student-workflow.md) — fork, write tests, submit PR
58+
- [Windows Setup](windows-setup.md) — detailed Windows instructions
59+
- [Keyword Documentation](keywords/index.md) — auto-generated keyword reference
60+
61+
## Common Commands
62+
63+
```bash
64+
# Verify environment
65+
python scripts/check_environment.py
66+
67+
# Install dependencies
68+
uv sync
69+
70+
# Initialize browsers
71+
uv run rfbrowser init chromium
72+
73+
# Run all tests
74+
uv run robot tests/
75+
76+
# Run specific suite
77+
uv run robot tests/02_login_tests/
78+
79+
# Run your exercises
80+
uv run robot tests/student_exercises/yourname_*.robot
81+
```
82+
83+
## License
84+
85+
[MIT](https://github.com/HackXIt/42vienna-robotframework-workshop/blob/main/LICENSE) — Nikolaus Rieder, 2026

0 commit comments

Comments
 (0)