Skip to content

Commit

Permalink
Installation of behat (#96)
Browse files Browse the repository at this point in the history
* feat: Introduce behat (and phpunit)

* Add behat.yml.dist config file

* start adding test on impact

* Fix Authorization

* Update behat yml dist

* add host

* everytest working on impact atm

* create update delete list tested on impact

* impact done

* continue host

* add tests for steps and fix hosts

* fix beyat

* Rewording

Co-authored-by: Houziaux mike / Jenaye <[email protected]>
  • Loading branch information
darkweak and jenaye authored Apr 17, 2021
1 parent a475cb7 commit 9a74fcf
Show file tree
Hide file tree
Showing 23 changed files with 13,196 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ then you can run `ssh smersh` and go to `http://localhost:4200`

Run API using this command `docker-compose up api` then execute `cd client && npm i && npm start`

## Run behat test
```
make reset-db
docker-compose exec php sh
./vendor/bin/behat
```

>you can specify scenario like this `./vendor/bin/behat --name="Impact API testing"`

## Todo
- add conclusion generator
Expand Down
4 changes: 4 additions & 0 deletions api/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
8 changes: 8 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
vendor/
config/jwt/*.pem
###> friends-of-behat/symfony-extension ###
/behat.yml
###< friends-of-behat/symfony-extension ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###
46 changes: 46 additions & 0 deletions api/behat.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
default:
suites:
impact:
paths: [ '%paths.base%/features/impact.feature' ]
contexts:
- App\Tests\Behat\ClientContext:
kernel: '@kernel'
- App\Tests\Behat\DemoContext:
kernel: '@kernel'
- App\Tests\Behat\FeatureContext
- App\Tests\Behat\ImpactContext:
kernel: '@kernel'
- Behatch\Context\JsonContext
host:
paths: [ '%paths.base%/features/host.feature' ]
contexts:
- App\Tests\Behat\ClientContext:
kernel: '@kernel'
- App\Tests\Behat\DemoContext:
kernel: '@kernel'
- App\Tests\Behat\FeatureContext
- App\Tests\Behat\HostContext:
kernel: '@kernel'
- Behatch\Context\JsonContext
step:
paths: [ '%paths.base%/features/step.feature' ]
contexts:
- App\Tests\Behat\ClientContext:
kernel: '@kernel'
- App\Tests\Behat\DemoContext:
kernel: '@kernel'
- App\Tests\Behat\FeatureContext
- App\Tests\Behat\StepContext:
kernel: '@kernel'
- Behatch\Context\JsonContext


extensions:
FriendsOfBehat\SymfonyExtension:
kernel:
environment: test
Behatch\Extension: ~
Behat\MinkExtension:
sessions:
default:
symfony: ~
6 changes: 6 additions & 0 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
},
"require-dev": {
"api-platform/schema-generator": "^2.1",
"behat/behat": "^3.8",
"behat/mink": "^1.8",
"behatch/contexts": "^3.3",
"doctrine/doctrine-fixtures-bundle": "^3.3",
"friends-of-behat/mink-browserkit-driver": "^1.5",
"friends-of-behat/symfony-extension": "^2.1",
"phpunit/phpunit": "^9.5",
"symfony/maker-bundle": "^1.23",
"symfony/profiler-pack": "^1.0"
},
Expand Down
Loading

0 comments on commit 9a74fcf

Please sign in to comment.