diff --git a/apps/advanced/README.md b/apps/advanced/README.md index b1d7351059..508a4140bd 100644 --- a/apps/advanced/README.md +++ b/apps/advanced/README.md @@ -113,7 +113,7 @@ it will upgrade your database to the last state according migrations. To be able to run acceptance tests you need a running webserver. For this you can use the php builtin server and run it in the directory where your main project folder is located. For example if your application is located in `/www/advanced` all you need to is: `cd /www` and then `php -S 127.0.0.1:8080` because the default configuration of acceptance tests expects the url of the application to be `/advanced/`. -If you already have a server configured or your application is not located in a folder called `advanced`, you may need to adjust the `TEST_ENTRY_URL` in `frontend/tests/_bootstrap.php` and `backend/tests/_bootstrap.php`. +If you already have a server configured or your application is not located in a folder called `advanced`, you may need to adjust the `test_entry_url` in `backend/codeception.yml` and `frontend/codeception.yml`. After that is done you should be able to run your tests, for example to run `frontend` tests do: @@ -123,5 +123,7 @@ After that is done you should be able to run your tests, for example to run `fro In similar way you can run tests for other application tiers - `backend`, `console`, `common`. +If you already have run `../vendor/bin/codecept build` for each application, you can run all tests by one command: `vendor/bin/codecept run` + You also can adjust you application suite configs and `_bootstrap.php` settings to use other urls and files, as it is can be done in `yii2-basic`. Current template also includes [yii2-faker](https://github.com/yiisoft/yii2/tree/master/extensions/faker) extension, that is correctly setup for each application tier. diff --git a/apps/advanced/backend/codeception.yml b/apps/advanced/backend/codeception.yml index 6d2019c859..49a978b6dc 100644 --- a/apps/advanced/backend/codeception.yml +++ b/apps/advanced/backend/codeception.yml @@ -1,3 +1,4 @@ +namespace: backend actor: Tester paths: tests: tests @@ -17,3 +18,7 @@ modules: user: '' password: '' dump: tests/_data/dump.sql +config: + # the entry script URL (without host info) for functional and acceptance tests + # PLEASE ADJUST IT TO THE ACTUAL ENTRY SCRIPT URL + test_entry_url: /advanced/backend/web/index-test.php diff --git a/apps/advanced/backend/tests/_bootstrap.php b/apps/advanced/backend/tests/_bootstrap.php index 76f6348cea..bc9d17c28a 100644 --- a/apps/advanced/backend/tests/_bootstrap.php +++ b/apps/advanced/backend/tests/_bootstrap.php @@ -1,12 +1,5 @@ wantTo('ensure login page works'); diff --git a/apps/advanced/backend/tests/functional/LoginCept.php b/apps/advanced/backend/tests/functional/LoginCept.php index 3c347b7c43..5bba9594a7 100644 --- a/apps/advanced/backend/tests/functional/LoginCept.php +++ b/apps/advanced/backend/tests/functional/LoginCept.php @@ -1,6 +1,7 @@ wantTo('ensure login page works'); diff --git a/apps/advanced/backend/tests/functional/_config.php b/apps/advanced/backend/tests/functional/_config.php index ba776b6169..15d3100cfc 100644 --- a/apps/advanced/backend/tests/functional/_config.php +++ b/apps/advanced/backend/tests/functional/_config.php @@ -1,8 +1,8 @@ wantTo('ensure that about works'); diff --git a/apps/advanced/frontend/tests/acceptance/ContactCept.php b/apps/advanced/frontend/tests/acceptance/ContactCept.php index b8492cdc65..5a36e1d5f3 100644 --- a/apps/advanced/frontend/tests/acceptance/ContactCept.php +++ b/apps/advanced/frontend/tests/acceptance/ContactCept.php @@ -1,6 +1,7 @@ wantTo('ensure that contact works'); diff --git a/apps/advanced/frontend/tests/acceptance/HomeCept.php b/apps/advanced/frontend/tests/acceptance/HomeCept.php index 62456f930e..4f5cc19966 100644 --- a/apps/advanced/frontend/tests/acceptance/HomeCept.php +++ b/apps/advanced/frontend/tests/acceptance/HomeCept.php @@ -1,5 +1,7 @@ wantTo('ensure that home page works'); $I->amOnPage(Yii::$app->homeUrl); diff --git a/apps/advanced/frontend/tests/acceptance/LoginCept.php b/apps/advanced/frontend/tests/acceptance/LoginCept.php index fddcf87f09..3728baff1d 100644 --- a/apps/advanced/frontend/tests/acceptance/LoginCept.php +++ b/apps/advanced/frontend/tests/acceptance/LoginCept.php @@ -1,6 +1,7 @@ wantTo('ensure login page works'); diff --git a/apps/advanced/frontend/tests/functional/AboutCept.php b/apps/advanced/frontend/tests/functional/AboutCept.php index b2153b3c1f..f9dd1a5a03 100644 --- a/apps/advanced/frontend/tests/functional/AboutCept.php +++ b/apps/advanced/frontend/tests/functional/AboutCept.php @@ -1,6 +1,7 @@ wantTo('ensure that about works'); diff --git a/apps/advanced/frontend/tests/functional/ContactCept.php b/apps/advanced/frontend/tests/functional/ContactCept.php index c08e8e0c4b..774428c8bd 100644 --- a/apps/advanced/frontend/tests/functional/ContactCept.php +++ b/apps/advanced/frontend/tests/functional/ContactCept.php @@ -1,6 +1,7 @@ wantTo('ensure that contact works'); diff --git a/apps/advanced/frontend/tests/functional/HomeCept.php b/apps/advanced/frontend/tests/functional/HomeCept.php index 3258ba3331..1bc1d5b6ea 100644 --- a/apps/advanced/frontend/tests/functional/HomeCept.php +++ b/apps/advanced/frontend/tests/functional/HomeCept.php @@ -1,5 +1,7 @@ wantTo('ensure that home page works'); $I->amOnPage(Yii::$app->homeUrl); diff --git a/apps/advanced/frontend/tests/functional/LoginCept.php b/apps/advanced/frontend/tests/functional/LoginCept.php index 3c347b7c43..7e1e1be508 100644 --- a/apps/advanced/frontend/tests/functional/LoginCept.php +++ b/apps/advanced/frontend/tests/functional/LoginCept.php @@ -1,6 +1,7 @@ wantTo('ensure login page works'); diff --git a/apps/advanced/frontend/tests/functional/_config.php b/apps/advanced/frontend/tests/functional/_config.php index ba776b6169..15d3100cfc 100644 --- a/apps/advanced/frontend/tests/functional/_config.php +++ b/apps/advanced/frontend/tests/functional/_config.php @@ -1,8 +1,8 @@