Skip to content

Commit

Permalink
Merge pull request #1 from pagopa/test-automation
Browse files Browse the repository at this point in the history
automation test first commit
  • Loading branch information
aferracci authored Jun 14, 2024
2 parents 32faca2 + 8910228 commit c634615
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/run_behave_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Run Behave Tests

on:
schedule:
- cron: '0 9 * * *' # Esegue ogni giorno alle 9:00 UTC
workflow_dispatch: # Permette di eseguire manualmente il workflow

jobs:
report:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.10.5
- uses: cryptic-wizard/[email protected]
with:
test-path: automation-test
test-output-name: results.txt
6 changes: 6 additions & 0 deletions src/automation-test/features/helloworld.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Feature: showing off behave

Scenario: run a simple test
Given we have behave installed
When we implement a test
Then behave will test it for us!
16 changes: 16 additions & 0 deletions src/automation-test/features/steps/helloworld.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from behave import *


@given('we have behave installed')
def step_impl(context):
pass


@when('we implement a test')
def step_impl(context):
assert True is not False


@then('behave will test it for us!')
def step_impl(context):
assert context.failed is False
63 changes: 63 additions & 0 deletions src/automation-test/reports/my_report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[
{
"elements": [
{
"keyword": "Scenario",
"location": "features/helloworld.feature:3",
"name": "run a simple test",
"status": "passed",
"steps": [
{
"keyword": "Given",
"location": "features/helloworld.feature:4",
"match": {
"arguments": [],
"location": "features/steps/helloworld.py:4"
},
"name": "we have behave installed",
"result": {
"duration": 0.00016880035400390625,
"status": "passed"
},
"step_type": "given"
},
{
"keyword": "When",
"location": "features/helloworld.feature:5",
"match": {
"arguments": [],
"location": "features/steps/helloworld.py:9"
},
"name": "we implement a test",
"result": {
"duration": 9.775161743164062e-05,
"status": "passed"
},
"step_type": "when"
},
{
"keyword": "Then",
"location": "features/helloworld.feature:6",
"match": {
"arguments": [],
"location": "features/steps/helloworld.py:14"
},
"name": "behave will test it for us!",
"result": {
"duration": 8.726119995117188e-05,
"status": "passed"
},
"step_type": "then"
}
],
"tags": [],
"type": "scenario"
}
],
"keyword": "Feature",
"location": "features/helloworld.feature:1",
"name": "showing off behave",
"status": "passed",
"tags": []
}
]

0 comments on commit c634615

Please sign in to comment.