qa-skills 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -0
- package/bin/cli.js +42 -0
- package/dist/agents/registry.d.ts +5 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +101 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/types.d.ts +9 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/dependencies.d.ts +21 -0
- package/dist/dependencies.d.ts.map +1 -0
- package/dist/dependencies.js +125 -0
- package/dist/dependencies.js.map +1 -0
- package/dist/installer.d.ts +25 -0
- package/dist/installer.d.ts.map +1 -0
- package/dist/installer.js +437 -0
- package/dist/installer.js.map +1 -0
- package/dist/scaffold.d.ts +27 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +182 -0
- package/dist/scaffold.js.map +1 -0
- package/package.json +40 -0
- package/skills/qa-accessibility-test-writer/SKILL.md +127 -0
- package/skills/qa-accessibility-test-writer/references/axe-core-patterns.md +349 -0
- package/skills/qa-accessibility-test-writer/references/best-practices.md +184 -0
- package/skills/qa-accessibility-test-writer/references/wcag-tests.md +331 -0
- package/skills/qa-api-contract-curator/SKILL.md +104 -0
- package/skills/qa-api-contract-curator/references/breaking-changes.md +363 -0
- package/skills/qa-api-contract-curator/references/openapi-structure.md +404 -0
- package/skills/qa-browser-data-collector/SKILL.md +132 -0
- package/skills/qa-browser-data-collector/references/data-collection-checklist.md +91 -0
- package/skills/qa-browser-data-collector/references/playwright-mcp-patterns.md +113 -0
- package/skills/qa-bug-ticket-creator/SKILL.md +148 -0
- package/skills/qa-bug-ticket-creator/references/bug-report-format.md +149 -0
- package/skills/qa-bug-ticket-creator/references/severity-guide.md +81 -0
- package/skills/qa-bug-ticket-creator/templates/bug-ticket-template.md +39 -0
- package/skills/qa-changelog-analyzer/SKILL.md +134 -0
- package/skills/qa-changelog-analyzer/references/git-analysis-patterns.md +138 -0
- package/skills/qa-changelog-analyzer/references/impact-mapping.md +120 -0
- package/skills/qa-clickup-integration/SKILL.md +166 -0
- package/skills/qa-clickup-integration/references/api-patterns.md +102 -0
- package/skills/qa-clickup-integration/references/field-mapping.md +71 -0
- package/skills/qa-codeceptjs-writer/SKILL.md +136 -0
- package/skills/qa-codeceptjs-writer/references/best-practices.md +207 -0
- package/skills/qa-codeceptjs-writer/references/config.md +255 -0
- package/skills/qa-codeceptjs-writer/references/patterns.md +285 -0
- package/skills/qa-coverage-analyzer/SKILL.md +166 -0
- package/skills/qa-coverage-analyzer/references/best-practices.md +142 -0
- package/skills/qa-coverage-analyzer/references/coverage-dimensions.md +155 -0
- package/skills/qa-coverage-analyzer/references/tools.md +204 -0
- package/skills/qa-cypress-writer/SKILL.md +134 -0
- package/skills/qa-cypress-writer/references/assertions.md +121 -0
- package/skills/qa-cypress-writer/references/best-practices.md +82 -0
- package/skills/qa-cypress-writer/references/config.md +121 -0
- package/skills/qa-cypress-writer/references/patterns.md +170 -0
- package/skills/qa-data-factory/SKILL.md +126 -0
- package/skills/qa-data-factory/references/factory-patterns.md +164 -0
- package/skills/qa-data-factory/references/faker-guide.md +131 -0
- package/skills/qa-diagram-generator/SKILL.md +125 -0
- package/skills/qa-diagram-generator/references/c4-model.md +53 -0
- package/skills/qa-diagram-generator/references/charts.md +58 -0
- package/skills/qa-diagram-generator/references/class-diagram.md +85 -0
- package/skills/qa-diagram-generator/references/er-diagram.md +69 -0
- package/skills/qa-diagram-generator/references/flowchart.md +92 -0
- package/skills/qa-diagram-generator/references/from-screenshot.md +45 -0
- package/skills/qa-diagram-generator/references/gantt.md +49 -0
- package/skills/qa-diagram-generator/references/journey.md +50 -0
- package/skills/qa-diagram-generator/references/mindmap.md +75 -0
- package/skills/qa-diagram-generator/references/sequence.md +69 -0
- package/skills/qa-diagram-generator/references/state-diagram.md +56 -0
- package/skills/qa-discovery-interview/SKILL.md +182 -0
- package/skills/qa-discovery-interview/references/completeness-checklist.md +53 -0
- package/skills/qa-discovery-interview/references/conflict-patterns.md +101 -0
- package/skills/qa-discovery-interview/references/qa-categories.md +147 -0
- package/skills/qa-discovery-interview/templates/qa-brief-template.md +168 -0
- package/skills/qa-environment-checker/SKILL.md +142 -0
- package/skills/qa-environment-checker/references/dependency-matrix.md +101 -0
- package/skills/qa-environment-checker/references/health-checks.md +209 -0
- package/skills/qa-environment-checker/templates/env-readiness-template.md +64 -0
- package/skills/qa-flaky-detector/SKILL.md +153 -0
- package/skills/qa-flaky-detector/references/ci-analysis.md +140 -0
- package/skills/qa-flaky-detector/references/flaky-patterns.md +247 -0
- package/skills/qa-github-issues-enhanced/SKILL.md +175 -0
- package/skills/qa-github-issues-enhanced/references/issue-templates.md +425 -0
- package/skills/qa-github-issues-enhanced/references/label-taxonomy.md +130 -0
- package/skills/qa-github-issues-enhanced/references/workflow-patterns.md +188 -0
- package/skills/qa-httpx-writer/SKILL.md +138 -0
- package/skills/qa-httpx-writer/references/assertions.md +195 -0
- package/skills/qa-httpx-writer/references/best-practices.md +140 -0
- package/skills/qa-httpx-writer/references/config.md +212 -0
- package/skills/qa-httpx-writer/references/patterns.md +262 -0
- package/skills/qa-jest-writer/SKILL.md +131 -0
- package/skills/qa-jest-writer/references/assertions.md +125 -0
- package/skills/qa-jest-writer/references/best-practices.md +136 -0
- package/skills/qa-jest-writer/references/config.md +134 -0
- package/skills/qa-jest-writer/references/patterns.md +172 -0
- package/skills/qa-jira-integration/SKILL.md +135 -0
- package/skills/qa-jira-integration/references/api-patterns.md +143 -0
- package/skills/qa-jira-integration/references/field-mapping.md +79 -0
- package/skills/qa-jira-integration/references/xray-integration.md +85 -0
- package/skills/qa-jmeter-writer/SKILL.md +171 -0
- package/skills/qa-jmeter-writer/references/best-practices.md +157 -0
- package/skills/qa-jmeter-writer/references/config.md +204 -0
- package/skills/qa-jmeter-writer/references/patterns.md +242 -0
- package/skills/qa-junit5-writer/SKILL.md +157 -0
- package/skills/qa-junit5-writer/references/assertions.md +118 -0
- package/skills/qa-junit5-writer/references/config.md +97 -0
- package/skills/qa-junit5-writer/references/patterns.md +162 -0
- package/skills/qa-k6-writer/SKILL.md +155 -0
- package/skills/qa-k6-writer/references/best-practices.md +236 -0
- package/skills/qa-k6-writer/references/config.md +219 -0
- package/skills/qa-k6-writer/references/patterns.md +304 -0
- package/skills/qa-linear-integration/SKILL.md +137 -0
- package/skills/qa-linear-integration/references/api-patterns.md +249 -0
- package/skills/qa-linear-integration/references/field-mapping.md +121 -0
- package/skills/qa-locust-writer/SKILL.md +151 -0
- package/skills/qa-locust-writer/references/best-practices.md +126 -0
- package/skills/qa-locust-writer/references/config.md +170 -0
- package/skills/qa-locust-writer/references/patterns.md +235 -0
- package/skills/qa-manual-test-designer/SKILL.md +145 -0
- package/skills/qa-manual-test-designer/references/exploratory-charters.md +138 -0
- package/skills/qa-manual-test-designer/references/personas.md +146 -0
- package/skills/qa-manual-test-designer/templates/exploratory-charter-template.md +47 -0
- package/skills/qa-manual-test-designer/templates/test-case-template.md +31 -0
- package/skills/qa-mobile-test-writer/SKILL.md +144 -0
- package/skills/qa-mobile-test-writer/references/best-practices.md +214 -0
- package/skills/qa-mobile-test-writer/references/config.md +309 -0
- package/skills/qa-mobile-test-writer/references/patterns.md +304 -0
- package/skills/qa-nfr-analyst/SKILL.md +177 -0
- package/skills/qa-nfr-analyst/references/iso-25010-model.md +159 -0
- package/skills/qa-nfr-analyst/references/owasp-wstg-baseline.md +202 -0
- package/skills/qa-nfr-analyst/references/wcag-checklist.md +184 -0
- package/skills/qa-nfr-analyst/templates/owasp-checklist-template.md +89 -0
- package/skills/qa-nfr-analyst/templates/wcag-checklist-template.md +48 -0
- package/skills/qa-orchestrator/SKILL.md +132 -0
- package/skills/qa-orchestrator/references/handoff-chains.md +105 -0
- package/skills/qa-orchestrator/references/pipeline-modes.md +115 -0
- package/skills/qa-orchestrator/references/scheduler-rules.md +84 -0
- package/skills/qa-pact-writer/SKILL.md +133 -0
- package/skills/qa-pact-writer/references/best-practices.md +100 -0
- package/skills/qa-pact-writer/references/config.md +135 -0
- package/skills/qa-pact-writer/references/patterns.md +161 -0
- package/skills/qa-plan-creator/SKILL.md +139 -0
- package/skills/qa-plan-creator/references/introduction-plan.md +43 -0
- package/skills/qa-plan-creator/references/migration-plan.md +44 -0
- package/skills/qa-plan-creator/references/onboarding-plan.md +46 -0
- package/skills/qa-plan-creator/references/performance-plan.md +44 -0
- package/skills/qa-plan-creator/references/regression-plan.md +45 -0
- package/skills/qa-plan-creator/references/release-plan.md +45 -0
- package/skills/qa-plan-creator/references/sprint-plan.md +44 -0
- package/skills/qa-plan-creator/references/test-plan.md +59 -0
- package/skills/qa-plan-creator/references/uat-plan.md +43 -0
- package/skills/qa-plan-creator/templates/checklist-template.md +36 -0
- package/skills/qa-plan-creator/templates/regression-checklist-template.md +49 -0
- package/skills/qa-plan-creator/templates/release-checklist-template.md +46 -0
- package/skills/qa-plan-creator/templates/test-plan-template.md +74 -0
- package/skills/qa-playwright-py-writer/SKILL.md +156 -0
- package/skills/qa-playwright-py-writer/references/best-practices.md +194 -0
- package/skills/qa-playwright-py-writer/references/config.md +195 -0
- package/skills/qa-playwright-py-writer/references/patterns.md +212 -0
- package/skills/qa-playwright-ts-writer/SKILL.md +151 -0
- package/skills/qa-playwright-ts-writer/references/assertions.md +109 -0
- package/skills/qa-playwright-ts-writer/references/best-practices.md +191 -0
- package/skills/qa-playwright-ts-writer/references/config.md +144 -0
- package/skills/qa-playwright-ts-writer/references/patterns.md +171 -0
- package/skills/qa-pytest-writer/SKILL.md +145 -0
- package/skills/qa-pytest-writer/references/assertions.md +149 -0
- package/skills/qa-pytest-writer/references/best-practices.md +97 -0
- package/skills/qa-pytest-writer/references/config.md +176 -0
- package/skills/qa-pytest-writer/references/patterns.md +251 -0
- package/skills/qa-qase-integration/SKILL.md +149 -0
- package/skills/qa-qase-integration/references/api-reference.md +354 -0
- package/skills/qa-qase-integration/references/ci-integration.md +196 -0
- package/skills/qa-qase-integration/references/field-mapping.md +157 -0
- package/skills/qa-requirements-generator/SKILL.md +152 -0
- package/skills/qa-requirements-generator/references/iso-29148-structure.md +153 -0
- package/skills/qa-requirements-generator/references/requirement-patterns.md +278 -0
- package/skills/qa-rest-assured-writer/SKILL.md +137 -0
- package/skills/qa-rest-assured-writer/references/best-practices.md +50 -0
- package/skills/qa-rest-assured-writer/references/config.md +124 -0
- package/skills/qa-rest-assured-writer/references/patterns.md +192 -0
- package/skills/qa-risk-analyzer/SKILL.md +158 -0
- package/skills/qa-risk-analyzer/references/impact-analysis.md +133 -0
- package/skills/qa-risk-analyzer/references/risk-factors.md +123 -0
- package/skills/qa-robot-framework-writer/SKILL.md +147 -0
- package/skills/qa-robot-framework-writer/references/best-practices.md +249 -0
- package/skills/qa-robot-framework-writer/references/config.md +204 -0
- package/skills/qa-robot-framework-writer/references/libraries.md +273 -0
- package/skills/qa-robot-framework-writer/references/patterns.md +216 -0
- package/skills/qa-security-test-writer/SKILL.md +123 -0
- package/skills/qa-security-test-writer/references/best-practices.md +155 -0
- package/skills/qa-security-test-writer/references/owasp-top10.md +331 -0
- package/skills/qa-security-test-writer/references/zap-config.md +258 -0
- package/skills/qa-selenium-java-writer/SKILL.md +143 -0
- package/skills/qa-selenium-java-writer/references/best-practices.md +59 -0
- package/skills/qa-selenium-java-writer/references/config.md +143 -0
- package/skills/qa-selenium-java-writer/references/patterns.md +170 -0
- package/skills/qa-selenium-py-writer/SKILL.md +150 -0
- package/skills/qa-selenium-py-writer/references/best-practices.md +175 -0
- package/skills/qa-selenium-py-writer/references/config.md +224 -0
- package/skills/qa-selenium-py-writer/references/patterns.md +255 -0
- package/skills/qa-shortcut-integration/SKILL.md +143 -0
- package/skills/qa-shortcut-integration/references/api-patterns.md +126 -0
- package/skills/qa-shortcut-integration/references/field-mapping.md +66 -0
- package/skills/qa-spec-auditor/SKILL.md +162 -0
- package/skills/qa-spec-auditor/references/audit-checklist.md +144 -0
- package/skills/qa-spec-auditor/references/drift-patterns.md +207 -0
- package/skills/qa-spec-writer/SKILL.md +143 -0
- package/skills/qa-spec-writer/references/gherkin-guide.md +253 -0
- package/skills/qa-spec-writer/references/specification-patterns.md +274 -0
- package/skills/qa-spring-test-writer/SKILL.md +170 -0
- package/skills/qa-spring-test-writer/references/best-practices.md +57 -0
- package/skills/qa-spring-test-writer/references/config.md +179 -0
- package/skills/qa-spring-test-writer/references/patterns.md +235 -0
- package/skills/qa-supertest-writer/SKILL.md +150 -0
- package/skills/qa-supertest-writer/references/assertions.md +192 -0
- package/skills/qa-supertest-writer/references/best-practices.md +102 -0
- package/skills/qa-supertest-writer/references/config.md +166 -0
- package/skills/qa-supertest-writer/references/patterns.md +242 -0
- package/skills/qa-task-creator/SKILL.md +142 -0
- package/skills/qa-task-creator/references/linking-patterns.md +127 -0
- package/skills/qa-task-creator/references/task-types.md +169 -0
- package/skills/qa-task-creator/templates/task-template.md +24 -0
- package/skills/qa-test-doc-compiler/SKILL.md +114 -0
- package/skills/qa-test-doc-compiler/references/agile-tailoring.md +220 -0
- package/skills/qa-test-doc-compiler/references/iso-29119-3-documents.md +302 -0
- package/skills/qa-test-healer/SKILL.md +101 -0
- package/skills/qa-test-healer/references/diagnosis-patterns.md +142 -0
- package/skills/qa-test-healer/references/fix-strategies.md +177 -0
- package/skills/qa-test-reporter/SKILL.md +130 -0
- package/skills/qa-test-reporter/references/best-practices.md +162 -0
- package/skills/qa-test-reporter/references/iso-29119-reports.md +236 -0
- package/skills/qa-test-reporter/references/report-formats.md +287 -0
- package/skills/qa-test-reviewer/SKILL.md +142 -0
- package/skills/qa-test-reviewer/references/anti-patterns.md +268 -0
- package/skills/qa-test-reviewer/references/review-checklist.md +93 -0
- package/skills/qa-test-strategy/SKILL.md +133 -0
- package/skills/qa-test-strategy/references/entry-exit-criteria.md +176 -0
- package/skills/qa-test-strategy/references/risk-matrix.md +102 -0
- package/skills/qa-test-strategy/references/testing-types.md +143 -0
- package/skills/qa-testcase-from-docs/SKILL.md +161 -0
- package/skills/qa-testcase-from-docs/references/test-case-format.md +196 -0
- package/skills/qa-testcase-from-docs/references/test-design-techniques.md +126 -0
- package/skills/qa-testcase-from-docs/templates/test-case-template.md +31 -0
- package/skills/qa-testcase-from-ui/SKILL.md +109 -0
- package/skills/qa-testcase-from-ui/references/ui-element-patterns.md +126 -0
- package/skills/qa-testcase-from-ui/references/visual-analysis-guide.md +146 -0
- package/skills/qa-testcase-from-ui/templates/test-case-template.md +31 -0
- package/skills/qa-visual-regression-writer/SKILL.md +175 -0
- package/skills/qa-visual-regression-writer/references/best-practices.md +154 -0
- package/skills/qa-visual-regression-writer/references/config.md +220 -0
- package/skills/qa-visual-regression-writer/references/patterns.md +213 -0
- package/skills/qa-vitest-writer/SKILL.md +141 -0
- package/skills/qa-vitest-writer/references/assertions.md +105 -0
- package/skills/qa-vitest-writer/references/best-practices.md +62 -0
- package/skills/qa-vitest-writer/references/config.md +127 -0
- package/skills/qa-vitest-writer/references/patterns.md +141 -0
- package/skills/qa-webdriverio-writer/SKILL.md +145 -0
- package/skills/qa-webdriverio-writer/references/best-practices.md +176 -0
- package/skills/qa-webdriverio-writer/references/config.md +240 -0
- package/skills/qa-webdriverio-writer/references/patterns.md +269 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Robot Framework Configuration
|
|
2
|
+
|
|
3
|
+
## CLI Options
|
|
4
|
+
|
|
5
|
+
### Basic Execution
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
robot tests/ # Run all tests in tests/
|
|
9
|
+
robot login.robot # Run single file
|
|
10
|
+
robot tests/login.robot tests/api/ # Run specific files/dirs
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Output and Reports
|
|
14
|
+
|
|
15
|
+
| Option | Description | Example |
|
|
16
|
+
| ------ | ----------- | ------- |
|
|
17
|
+
| `-d DIR` | Output directory | `-d results` |
|
|
18
|
+
| `-o FILE` | Output XML file | `-o output.xml` |
|
|
19
|
+
| `-l FILE` | Log file (HTML) | `-l log.html` |
|
|
20
|
+
| `-r FILE` | Report file (HTML) | `-r report.html` |
|
|
21
|
+
| `-N NAME` | Set suite name | `-N "Smoke Tests"` |
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
robot -d results -l results/log.html -r results/report.html tests/
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Variables
|
|
28
|
+
|
|
29
|
+
| Option | Description | Example |
|
|
30
|
+
| ------ | ----------- | ------- |
|
|
31
|
+
| `-v VAR:value` | Set scalar variable | `-v BROWSER:chrome` |
|
|
32
|
+
| `-v VAR:value1;value2` | Set list variable | `-v USERS:user1;user2` |
|
|
33
|
+
| `-V FILE` | Variable file (Python/YAML) | `-V config/env.py` |
|
|
34
|
+
| `--variablefile FILE` | Legacy variable file | `--variablefile env.py` |
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
robot -v BROWSER:headlesschrome -v BASE_URL:https://staging.example.com -V config/prod.py tests/
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Test Selection
|
|
41
|
+
|
|
42
|
+
| Option | Description | Example |
|
|
43
|
+
| ------ | ----------- | ------- |
|
|
44
|
+
| `-t "Test Name"` | Run specific test | `-t "User Can Log In"` |
|
|
45
|
+
| `-i TAG` | Include tests with tag | `-i smoke` |
|
|
46
|
+
| `-e TAG` | Exclude tests with tag | `-e slow` |
|
|
47
|
+
| `--include TAG*` | Include (supports patterns) | `--include smoke*` |
|
|
48
|
+
| `--exclude TAG*` | Exclude (supports patterns) | `--exclude skip` |
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
robot -i smoke --exclude slow -d results tests/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Execution Control
|
|
55
|
+
|
|
56
|
+
| Option | Description | Example |
|
|
57
|
+
| ------ | ----------- | ------- |
|
|
58
|
+
| `--loglevel LEVEL` | Log level (TRACE, DEBUG, INFO, WARN) | `--loglevel DEBUG` |
|
|
59
|
+
| `--randomize all` | Randomize test order | `--randomize all` |
|
|
60
|
+
| `--rerunfailed FILE` | Re-run failed tests from output | `--rerunfailed output.xml` |
|
|
61
|
+
| `--dryrun` | Validate without executing | `--dryrun` |
|
|
62
|
+
| `--test "Name"` | Run single test | `--test "Login Test"` |
|
|
63
|
+
| `--suite "Suite"` | Run single suite | `--suite "Login"` |
|
|
64
|
+
|
|
65
|
+
### Parallel Execution (pabot)
|
|
66
|
+
|
|
67
|
+
For parallel runs, use `pabot` (parallel Robot Framework):
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install robotframework-pabot
|
|
71
|
+
pabot --processes 4 -d results tests/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Variable Files
|
|
77
|
+
|
|
78
|
+
### Python Variable File
|
|
79
|
+
|
|
80
|
+
**config/env.py:**
|
|
81
|
+
```python
|
|
82
|
+
def get_variables(env=None):
|
|
83
|
+
return {
|
|
84
|
+
'BROWSER': 'chrome',
|
|
85
|
+
'BASE_URL': 'https://example.com',
|
|
86
|
+
'HEADLESS': env == 'ci',
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Dynamic variables based on environment:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
import os
|
|
94
|
+
|
|
95
|
+
def get_variables():
|
|
96
|
+
return {
|
|
97
|
+
'BASE_URL': os.getenv('BASE_URL', 'https://default.example.com'),
|
|
98
|
+
'API_KEY': os.getenv('API_KEY', ''),
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### YAML Variable File
|
|
103
|
+
|
|
104
|
+
**config/default.yaml:**
|
|
105
|
+
```yaml
|
|
106
|
+
BROWSER: chrome
|
|
107
|
+
BASE_URL: https://example.com
|
|
108
|
+
USERS:
|
|
109
|
+
- user1
|
|
110
|
+
- user2
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### JSON Variable File (RF 6.0+)
|
|
114
|
+
|
|
115
|
+
**config/default.json:**
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"BROWSER": "chrome",
|
|
119
|
+
"BASE_URL": "https://example.com"
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## robot.yaml / pyproject.toml
|
|
126
|
+
|
|
127
|
+
Robot Framework 6.0+ supports `robot.yaml` for configuration:
|
|
128
|
+
|
|
129
|
+
**robot.yaml:**
|
|
130
|
+
```yaml
|
|
131
|
+
default:
|
|
132
|
+
outputDir: results
|
|
133
|
+
log: results/log.html
|
|
134
|
+
report: results/report.html
|
|
135
|
+
variableFiles:
|
|
136
|
+
- config/env.yaml
|
|
137
|
+
variables:
|
|
138
|
+
BROWSER: chrome
|
|
139
|
+
include:
|
|
140
|
+
- smoke
|
|
141
|
+
exclude:
|
|
142
|
+
- skip
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Or in **pyproject.toml** under `[tool.robotframework]`:
|
|
146
|
+
|
|
147
|
+
```toml
|
|
148
|
+
[tool.robotframework]
|
|
149
|
+
outputDir = "results"
|
|
150
|
+
log = "results/log.html"
|
|
151
|
+
report = "results/report.html"
|
|
152
|
+
variableFiles = ["config/env.yaml"]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Listeners
|
|
158
|
+
|
|
159
|
+
Custom listeners for hooks (start/end suite, test, keyword):
|
|
160
|
+
|
|
161
|
+
**listeners/custom_listener.py:**
|
|
162
|
+
```python
|
|
163
|
+
class CustomListener:
|
|
164
|
+
ROBOT_LISTENER_API_VERSION = 3
|
|
165
|
+
|
|
166
|
+
def start_test(self, data, test):
|
|
167
|
+
print(f"Starting: {test.name}")
|
|
168
|
+
|
|
169
|
+
def end_test(self, data, test):
|
|
170
|
+
print(f"Ended: {test.name} - {test.status}")
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Usage: `robot --listener listeners/custom_listener.py tests/`
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Resource and Library Paths
|
|
178
|
+
|
|
179
|
+
- **Resource imports** — Relative to the file containing the import
|
|
180
|
+
- **PYTHONPATH** — For Python libraries; set before running: `export PYTHONPATH=libs:$PYTHONPATH`
|
|
181
|
+
- **--pythonpath** — Add path: `robot --pythonpath libs tests/`
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Recommended Project Layout
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
project/
|
|
189
|
+
├── tests/
|
|
190
|
+
│ ├── login.robot
|
|
191
|
+
│ ├── checkout.robot
|
|
192
|
+
│ └── api/
|
|
193
|
+
│ └── users.robot
|
|
194
|
+
├── resources/
|
|
195
|
+
│ ├── common.robot
|
|
196
|
+
│ ├── login_keywords.robot
|
|
197
|
+
│ └── api_keywords.robot
|
|
198
|
+
├── variables/
|
|
199
|
+
│ ├── env.yaml
|
|
200
|
+
│ └── prod.py
|
|
201
|
+
├── results/ # -d results
|
|
202
|
+
├── robot.yaml # Optional config
|
|
203
|
+
└── requirements.txt
|
|
204
|
+
```
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Robot Framework Libraries Reference
|
|
2
|
+
|
|
3
|
+
## SeleniumLibrary
|
|
4
|
+
|
|
5
|
+
Browser automation via Selenium WebDriver. Install: `pip install robotframework-seleniumlibrary`
|
|
6
|
+
|
|
7
|
+
### Setup/Teardown
|
|
8
|
+
|
|
9
|
+
| Keyword | Description |
|
|
10
|
+
| ------- | ----------- |
|
|
11
|
+
| `Open Browser` | Open browser; args: url, browser (chrome, firefox, etc.) |
|
|
12
|
+
| `Close Browser` | Close current browser |
|
|
13
|
+
| `Close All Browsers` | Close all open browsers |
|
|
14
|
+
|
|
15
|
+
### Navigation
|
|
16
|
+
|
|
17
|
+
| Keyword | Description |
|
|
18
|
+
| ------- | ----------- |
|
|
19
|
+
| `Go To` | Navigate to URL |
|
|
20
|
+
| `Go Back` | Browser back |
|
|
21
|
+
| `Reload Page` | Reload current page |
|
|
22
|
+
| `Get Location` | Get current URL |
|
|
23
|
+
| `Get Title` | Get page title |
|
|
24
|
+
|
|
25
|
+
### Element Interaction
|
|
26
|
+
|
|
27
|
+
| Keyword | Description |
|
|
28
|
+
| ------- | ----------- |
|
|
29
|
+
| `Click Element` | Click element by locator |
|
|
30
|
+
| `Click Button` | Click button |
|
|
31
|
+
| `Input Text` | Type text into input |
|
|
32
|
+
| `Input Password` | Type password (masked in logs) |
|
|
33
|
+
| `Clear Element Text` | Clear input field |
|
|
34
|
+
| `Select From List By Value` | Select dropdown option by value |
|
|
35
|
+
| `Select Checkbox` / `Unselect Checkbox` | Toggle checkbox |
|
|
36
|
+
| `Choose File` | Upload file |
|
|
37
|
+
|
|
38
|
+
### Waits
|
|
39
|
+
|
|
40
|
+
| Keyword | Description |
|
|
41
|
+
| ------- | ----------- |
|
|
42
|
+
| `Wait Until Element Is Visible` | Wait for element |
|
|
43
|
+
| `Wait Until Page Contains` | Wait for text |
|
|
44
|
+
| `Wait Until Location Contains` | Wait for URL |
|
|
45
|
+
| `Set Selenium Implicit Wait` | Set default wait timeout |
|
|
46
|
+
|
|
47
|
+
### Assertions
|
|
48
|
+
|
|
49
|
+
| Keyword | Description |
|
|
50
|
+
| ------- | ----------- |
|
|
51
|
+
| `Element Should Be Visible` | Assert element visible |
|
|
52
|
+
| `Page Should Contain` | Assert text on page |
|
|
53
|
+
| `Title Should Be` | Assert page title |
|
|
54
|
+
| `Location Should Be` | Assert URL |
|
|
55
|
+
| `Element Should Be Enabled` | Assert element enabled |
|
|
56
|
+
|
|
57
|
+
### Locators
|
|
58
|
+
|
|
59
|
+
- `id=element_id`
|
|
60
|
+
- `css=div.class`
|
|
61
|
+
- `xpath=//button[@type='submit']`
|
|
62
|
+
- `name=fieldname`
|
|
63
|
+
- `link=Click here`
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## BrowserLibrary
|
|
68
|
+
|
|
69
|
+
Playwright-based browser automation. Install: `pip install robotframework-browser`
|
|
70
|
+
|
|
71
|
+
### Setup/Teardown
|
|
72
|
+
|
|
73
|
+
| Keyword | Description |
|
|
74
|
+
| ------- | ----------- |
|
|
75
|
+
| `New Browser` | Create browser; args: browser (chromium, firefox, webkit), headless |
|
|
76
|
+
| `New Page` | Open new page/tab |
|
|
77
|
+
| `Close Browser` | Close browser |
|
|
78
|
+
| `Close Context` | Close browser context |
|
|
79
|
+
|
|
80
|
+
### Navigation
|
|
81
|
+
|
|
82
|
+
| Keyword | Description |
|
|
83
|
+
| ------- | ----------- |
|
|
84
|
+
| `Go To` | Navigate to URL |
|
|
85
|
+
| `Get Url` | Get current URL |
|
|
86
|
+
| `Get Title` | Get page title |
|
|
87
|
+
|
|
88
|
+
### Element Interaction
|
|
89
|
+
|
|
90
|
+
| Keyword | Description |
|
|
91
|
+
| ------- | ----------- |
|
|
92
|
+
| `Click` | Click element (selector) |
|
|
93
|
+
| `Fill Text` | Fill text input |
|
|
94
|
+
| `Type Text` | Type with optional delay |
|
|
95
|
+
| `Check` / `Uncheck` | Toggle checkbox |
|
|
96
|
+
| `Select Options By` | Select dropdown |
|
|
97
|
+
| `Upload File By Selector` | Upload file |
|
|
98
|
+
|
|
99
|
+
### Assertions
|
|
100
|
+
|
|
101
|
+
| Keyword | Description |
|
|
102
|
+
| ------- | ----------- |
|
|
103
|
+
| `Get Text` | Get element text |
|
|
104
|
+
| `Get Property` | Get element property |
|
|
105
|
+
| `Get Attribute` | Get element attribute |
|
|
106
|
+
| `Wait For Elements State` | Wait for element state (visible, hidden, etc.) |
|
|
107
|
+
|
|
108
|
+
### Selectors
|
|
109
|
+
|
|
110
|
+
- `text=Exact text`
|
|
111
|
+
- `css=button.primary`
|
|
112
|
+
- `id=element-id`
|
|
113
|
+
- `role=button[name="Submit"]`
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## RequestsLibrary
|
|
118
|
+
|
|
119
|
+
API testing. Install: `pip install robotframework-requests`
|
|
120
|
+
|
|
121
|
+
### Session Management
|
|
122
|
+
|
|
123
|
+
| Keyword | Description |
|
|
124
|
+
| ------- | ----------- |
|
|
125
|
+
| `Create Session` | Create named session; args: alias, base_url, optional auth, headers |
|
|
126
|
+
| `Delete All Sessions` | Close all sessions |
|
|
127
|
+
|
|
128
|
+
### HTTP Methods
|
|
129
|
+
|
|
130
|
+
| Keyword | Description |
|
|
131
|
+
| ------- | ----------- |
|
|
132
|
+
| `GET` | GET request; returns response |
|
|
133
|
+
| `POST` | POST request |
|
|
134
|
+
| `PUT` | PUT request |
|
|
135
|
+
| `PATCH` | PATCH request |
|
|
136
|
+
| `DELETE` | DELETE request |
|
|
137
|
+
| `HEAD` | HEAD request |
|
|
138
|
+
|
|
139
|
+
### Assertions
|
|
140
|
+
|
|
141
|
+
| Keyword | Description |
|
|
142
|
+
| ------- | ----------- |
|
|
143
|
+
| `Status Should Be` | Assert status code (e.g., 200, 201) |
|
|
144
|
+
| `Response Should Be Successful` | 2xx status |
|
|
145
|
+
| `Response Should Be Client Error` | 4xx status |
|
|
146
|
+
| `Response Should Be Server Error` | 5xx status |
|
|
147
|
+
|
|
148
|
+
### Response Access
|
|
149
|
+
|
|
150
|
+
| Keyword | Description |
|
|
151
|
+
| ------- | ----------- |
|
|
152
|
+
| `Integer` | Parse response as int |
|
|
153
|
+
| `Json` | Parse response as JSON |
|
|
154
|
+
| `Content` | Raw response content |
|
|
155
|
+
| `Headers` | Response headers |
|
|
156
|
+
|
|
157
|
+
### Example
|
|
158
|
+
|
|
159
|
+
```robot
|
|
160
|
+
*** Settings ***
|
|
161
|
+
Library RequestsLibrary
|
|
162
|
+
|
|
163
|
+
*** Test Cases ***
|
|
164
|
+
Get User
|
|
165
|
+
Create Session api https://api.example.com
|
|
166
|
+
${resp}= GET api /users/1
|
|
167
|
+
Status Should Be 200 ${resp}
|
|
168
|
+
Dictionary Should Contain Key ${resp.json()} id
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## BuiltIn
|
|
174
|
+
|
|
175
|
+
Always available. Core keywords for logic, assertions, control flow.
|
|
176
|
+
|
|
177
|
+
### Logging
|
|
178
|
+
|
|
179
|
+
| Keyword | Description |
|
|
180
|
+
| ------- | ----------- |
|
|
181
|
+
| `Log` | Log message |
|
|
182
|
+
| `Log To Console` | Print to console |
|
|
183
|
+
| `Log Many` | Log multiple variables |
|
|
184
|
+
|
|
185
|
+
### Assertions
|
|
186
|
+
|
|
187
|
+
| Keyword | Description |
|
|
188
|
+
| ------- | ----------- |
|
|
189
|
+
| `Should Be Equal` | Assert equality |
|
|
190
|
+
| `Should Not Be Equal` | Assert inequality |
|
|
191
|
+
| `Should Be True` | Assert expression true |
|
|
192
|
+
| `Should Contain` | Assert string/list contains |
|
|
193
|
+
| `Should Match Regexp` | Assert regex match |
|
|
194
|
+
| `Fail` | Force test failure |
|
|
195
|
+
|
|
196
|
+
### Control Flow
|
|
197
|
+
|
|
198
|
+
| Keyword | Description |
|
|
199
|
+
| ------- | ----------- |
|
|
200
|
+
| `Run Keyword If` | Conditional keyword execution |
|
|
201
|
+
| `Run Keyword And Return` | Execute and return value |
|
|
202
|
+
| `Run Keyword And Ignore Error` | Execute, return status and output |
|
|
203
|
+
| `Wait Until Keyword Succeeds` | Retry keyword until success |
|
|
204
|
+
| `FOR` / `END` | Loop |
|
|
205
|
+
| `IF` / `ELSE` / `END` | Conditional (RF 5.0+) |
|
|
206
|
+
| `TRY` / `EXCEPT` / `END` | Exception handling (RF 5.0+) |
|
|
207
|
+
|
|
208
|
+
### Variables
|
|
209
|
+
|
|
210
|
+
| Keyword | Description |
|
|
211
|
+
| ------- | ----------- |
|
|
212
|
+
| `Set Variable` | Create variable |
|
|
213
|
+
| `Set Suite Variable` | Suite-level variable |
|
|
214
|
+
| `Set Test Variable` | Test-level variable |
|
|
215
|
+
| `Get Variable Value` | Get variable with default |
|
|
216
|
+
| `Evaluate` | Evaluate Python expression |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Collections
|
|
221
|
+
|
|
222
|
+
List and dictionary operations. Import: `Library Collections`
|
|
223
|
+
|
|
224
|
+
### List Keywords
|
|
225
|
+
|
|
226
|
+
| Keyword | Description |
|
|
227
|
+
| ------- | ----------- |
|
|
228
|
+
| `Append To List` | Add item to list |
|
|
229
|
+
| `Get From List` | Get item by index |
|
|
230
|
+
| `Length` | Get list length |
|
|
231
|
+
| `List Should Contain Value` | Assert list contains |
|
|
232
|
+
| `Remove From List` | Remove by index |
|
|
233
|
+
| `Sort List` | Sort list |
|
|
234
|
+
|
|
235
|
+
### Dictionary Keywords
|
|
236
|
+
|
|
237
|
+
| Keyword | Description |
|
|
238
|
+
| ------- | ----------- |
|
|
239
|
+
| `Get From Dictionary` | Get value by key |
|
|
240
|
+
| `Set To Dictionary` | Set key-value |
|
|
241
|
+
| `Dictionary Should Contain Key` | Assert key exists |
|
|
242
|
+
| `Dictionary Should Contain Value` | Assert value exists |
|
|
243
|
+
| `Log Dictionary` | Log dict contents |
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## String
|
|
248
|
+
|
|
249
|
+
String manipulation. Import: `Library String`
|
|
250
|
+
|
|
251
|
+
| Keyword | Description |
|
|
252
|
+
| ------- | ----------- |
|
|
253
|
+
| `Get Length` | String length |
|
|
254
|
+
| `Split String` | Split by separator |
|
|
255
|
+
| `Replace String` | Replace substring |
|
|
256
|
+
| `Get Substring` | Extract substring |
|
|
257
|
+
| `Convert To Lowercase` | Lowercase |
|
|
258
|
+
| `Convert To Uppercase` | Uppercase |
|
|
259
|
+
| `Strip String` | Trim whitespace |
|
|
260
|
+
| `Should Match Regexp` | Regex match |
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## DateTime
|
|
265
|
+
|
|
266
|
+
Date and time. Import: `Library DateTime`
|
|
267
|
+
|
|
268
|
+
| Keyword | Description |
|
|
269
|
+
| ------- | ----------- |
|
|
270
|
+
| `Get Current Date` | Current date/time |
|
|
271
|
+
| `Add Time To Date` | Add duration to date |
|
|
272
|
+
| `Subtract Date From Date` | Date difference |
|
|
273
|
+
| `Convert Date` | Format date (e.g., `%Y-%m-%d`) |
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Robot Framework Patterns
|
|
2
|
+
|
|
3
|
+
## Keyword-Driven Testing
|
|
4
|
+
|
|
5
|
+
Tests are composed of high-level keywords that hide implementation details:
|
|
6
|
+
|
|
7
|
+
```robot
|
|
8
|
+
*** Test Cases ***
|
|
9
|
+
User Can Log In
|
|
10
|
+
[Documentation] Verify successful login
|
|
11
|
+
Given User Is On Login Page
|
|
12
|
+
When User Enters Credentials ${VALID_USER} ${VALID_PASS}
|
|
13
|
+
And User Clicks Login Button
|
|
14
|
+
Then User Should See Dashboard
|
|
15
|
+
And User Should Be Logged In
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Keywords are defined in *** Keywords *** or imported from resource files:
|
|
19
|
+
|
|
20
|
+
```robot
|
|
21
|
+
*** Keywords ***
|
|
22
|
+
User Is On Login Page
|
|
23
|
+
Open Browser ${LOGIN_URL} ${BROWSER}
|
|
24
|
+
Title Should Be Login
|
|
25
|
+
|
|
26
|
+
User Enters Credentials
|
|
27
|
+
[Arguments] ${username} ${password}
|
|
28
|
+
Input Text id=username ${username}
|
|
29
|
+
Input Password id=password ${password}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## BDD Syntax (Given/When/Then)
|
|
33
|
+
|
|
34
|
+
Use BDD-style keyword names for readability:
|
|
35
|
+
|
|
36
|
+
```robot
|
|
37
|
+
*** Test Cases ***
|
|
38
|
+
Checkout With Valid Card
|
|
39
|
+
Given User Has Items In Cart
|
|
40
|
+
When User Proceeds To Checkout
|
|
41
|
+
And User Enters Payment ${CARD_NUMBER} ${EXPIRY}
|
|
42
|
+
Then Order Should Be Confirmed
|
|
43
|
+
And User Receives Confirmation Email
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Keyword naming convention:
|
|
47
|
+
- **Given** — Setup, preconditions
|
|
48
|
+
- **When** — Action, user/system behavior
|
|
49
|
+
- **Then** — Assertion, expected outcome
|
|
50
|
+
- **And** — Additional step in same phase
|
|
51
|
+
|
|
52
|
+
## Data-Driven Tests
|
|
53
|
+
|
|
54
|
+
### FOR Loops
|
|
55
|
+
|
|
56
|
+
```robot
|
|
57
|
+
*** Test Cases ***
|
|
58
|
+
Validate Multiple Inputs
|
|
59
|
+
FOR ${input} IN valid invalid empty
|
|
60
|
+
Log Testing with: ${input}
|
|
61
|
+
Validate Input ${input}
|
|
62
|
+
END
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Template Tests
|
|
66
|
+
|
|
67
|
+
Single keyword executed with different arguments:
|
|
68
|
+
|
|
69
|
+
```robot
|
|
70
|
+
*** Test Cases ***
|
|
71
|
+
Login With Valid Credentials
|
|
72
|
+
[Template] Login And Verify
|
|
73
|
+
user1 pass1 Dashboard
|
|
74
|
+
user2 pass2 Admin Panel
|
|
75
|
+
admin admin123 Settings
|
|
76
|
+
|
|
77
|
+
*** Keywords ***
|
|
78
|
+
Login And Verify
|
|
79
|
+
[Arguments] ${user} ${pass} ${expected_page}
|
|
80
|
+
Input Text id=username ${user}
|
|
81
|
+
Input Password id=password ${pass}
|
|
82
|
+
Click Button id=login
|
|
83
|
+
Location Should Contain ${expected_page}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Data-Driven With [Template] and Multiple Rows
|
|
87
|
+
|
|
88
|
+
```robot
|
|
89
|
+
*** Test Cases ***
|
|
90
|
+
Search With Different Terms
|
|
91
|
+
[Template] Search And Verify Results
|
|
92
|
+
robot framework 10
|
|
93
|
+
selenium 5
|
|
94
|
+
pytest 8
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Resource Files
|
|
98
|
+
|
|
99
|
+
Shared keywords and variables in separate files:
|
|
100
|
+
|
|
101
|
+
```robot
|
|
102
|
+
*** Settings ***
|
|
103
|
+
Resource resources/common.robot
|
|
104
|
+
Resource resources/login_keywords.robot
|
|
105
|
+
Library SeleniumLibrary
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**resources/common.robot:**
|
|
109
|
+
```robot
|
|
110
|
+
*** Settings ***
|
|
111
|
+
Library SeleniumLibrary
|
|
112
|
+
|
|
113
|
+
*** Variables ***
|
|
114
|
+
${BROWSER} chrome
|
|
115
|
+
${BASE_URL} https://example.com
|
|
116
|
+
|
|
117
|
+
*** Keywords ***
|
|
118
|
+
Open Application
|
|
119
|
+
Open Browser ${BASE_URL} ${BROWSER}
|
|
120
|
+
Maximize Browser Window
|
|
121
|
+
|
|
122
|
+
Close Application
|
|
123
|
+
Close All Browsers
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Variable Files
|
|
127
|
+
|
|
128
|
+
### Python Variable File
|
|
129
|
+
|
|
130
|
+
**variables/env.py:**
|
|
131
|
+
```python
|
|
132
|
+
BROWSER = "chrome"
|
|
133
|
+
BASE_URL = "https://example.com"
|
|
134
|
+
VALID_USER = "testuser"
|
|
135
|
+
VALID_PASS = "secret"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Usage: `robot -V variables/env.py tests/`
|
|
139
|
+
|
|
140
|
+
### YAML Variable File
|
|
141
|
+
|
|
142
|
+
**variables/config.yaml:**
|
|
143
|
+
```yaml
|
|
144
|
+
BROWSER: chrome
|
|
145
|
+
BASE_URL: https://example.com
|
|
146
|
+
VALID_USER: testuser
|
|
147
|
+
VALID_PASS: secret
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Usage: `robot -V variables/config.yaml tests/`
|
|
151
|
+
|
|
152
|
+
## Control Flow
|
|
153
|
+
|
|
154
|
+
### IF / ELSE (RF 5.0+)
|
|
155
|
+
|
|
156
|
+
```robot
|
|
157
|
+
*** Keywords ***
|
|
158
|
+
Handle Optional Step
|
|
159
|
+
[Arguments] ${condition}
|
|
160
|
+
IF ${condition} == ${True}
|
|
161
|
+
Click Button submit
|
|
162
|
+
ELSE
|
|
163
|
+
Log Skipping submit
|
|
164
|
+
END
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### TRY / EXCEPT (RF 5.0+)
|
|
168
|
+
|
|
169
|
+
```robot
|
|
170
|
+
*** Keywords ***
|
|
171
|
+
Safe Click
|
|
172
|
+
[Arguments] ${locator}
|
|
173
|
+
TRY
|
|
174
|
+
Click Element ${locator}
|
|
175
|
+
EXCEPT Element not found
|
|
176
|
+
Log Element not found, skipping
|
|
177
|
+
END
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Run Keyword If (Legacy)
|
|
181
|
+
|
|
182
|
+
```robot
|
|
183
|
+
Run Keyword If '${ENV}' == 'prod' Log Production
|
|
184
|
+
... ELSE IF '${ENV}' == 'staging' Log Staging
|
|
185
|
+
... ELSE Log Development
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Test Setup and Teardown
|
|
189
|
+
|
|
190
|
+
```robot
|
|
191
|
+
*** Settings ***
|
|
192
|
+
Suite Setup Open Application
|
|
193
|
+
Suite Teardown Close Application
|
|
194
|
+
Test Setup Navigate To Home
|
|
195
|
+
Test Teardown Capture Page Screenshot On Failure
|
|
196
|
+
|
|
197
|
+
*** Keywords ***
|
|
198
|
+
Capture Page Screenshot On Failure
|
|
199
|
+
Run Keyword If Test Failed Capture Page Screenshot
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Tags
|
|
203
|
+
|
|
204
|
+
```robot
|
|
205
|
+
*** Test Cases ***
|
|
206
|
+
Critical Login Test
|
|
207
|
+
[Tags] smoke critical login
|
|
208
|
+
User Can Log In
|
|
209
|
+
|
|
210
|
+
Slow E2E Flow
|
|
211
|
+
[Tags] e2e slow
|
|
212
|
+
[Timeout] 2 minutes
|
|
213
|
+
Complete Checkout Flow
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Run by tag: `robot --include smoke tests/` or `robot --exclude slow tests/`
|