Skip to content

Commit

Permalink
tests: Add environment variable and document commands to run behat te…
Browse files Browse the repository at this point in the history
…sts locally

Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Jul 24, 2024
1 parent 210b4a2 commit 4ec4f86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ You can use the provided Makefile to run all tests by using:

make test

#### Running behat integration tests

Within `tests/integration/` run `composer install` and then choose one of the two options:
- Run tests with a local php server: `bash run.sh`
- Run against an existing Nextcloud installation: `BEHAT_SERVER_URL=http://nextcloud.local ./vendor/bin/behat --colors features/decks.feature`

### Documentation

The documentation for our REST API can be found at https://deck.readthedocs.io/en/latest/API/
Expand Down
8 changes: 7 additions & 1 deletion tests/integration/features/bootstrap/ServerContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ class ServerContext implements Context {

public function __construct($baseUrl) {
$this->rawBaseUrl = $baseUrl;
$this->__tConstruct($baseUrl . '/index.php/ocs/', ['admin', 'admin'], '123456');

$testServerUrl = getenv('BEHAT_SERVER_URL');
if ($testServerUrl !== false) {
$this->rawBaseUrl = rtrim($testServerUrl, '/');
}

$this->__tConstruct($this->rawBaseUrl . '/ocs/', ['admin', 'admin'], '123456');
}


Expand Down

0 comments on commit 4ec4f86

Please sign in to comment.