olexiy
(Aleksey)
January 18, 2017, 8:53pm
1
Hello. I need a help.
I have just installed yii2-advanced template.
try to run Codecept tests and get the following errors:
Frontend\tests.functional Tests (12) ------------------------------------------- ------------------------------------------------------------
Check about (functional\AboutCest::checkAbout) Error
Trying to check contact (functional\ContactCest::checkContact)… <pre>PHP User Error 'yii\base\ErrorException' with message 'Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'Th e directory does not exist: C:\Users\oleksii\projects\advanced\vendor\bin\/…/co deception/codeception/assets'
in C:\Users\oleksii\projects\advanced\vendor\yiisoft\yii2\web\AssetManager.php:2 11
I will be appreciate any help.
Thanks in advace.
alirz23
(Ali Raza)
January 19, 2017, 12:18pm
2
if you read the error it says "Th e directory does not exist: C:\Users\oleksii\projects\advanced\vendor\bin\/../co deception/codeception/assets" make sure that directory exists and you have write permission for that directory
olexiy
(Aleksey)
January 19, 2017, 8:27pm
3
You are right!
I have reinstalled yii2 and try to run tests again and it says me the following error:
PHP User Error 'yii\base\ErrorException' with message 'Exception (Invalid Configuration)
'yii\base\InvalidConfigException' with message 'The directory does not exist: ./assets'
It is kind of the same but why they asks me to create directory on my root directory. It actually little bit break yii2 structure. Am I wrong?
Do you do the same (create assets directory in root direcroty)?
jacmoe
(Jacob Moena)
January 19, 2017, 9:04pm
4
The C:\Users\oleksii\projects\advanced\vendor\bin\… is just the path to the ‘codecept’ binary, so it is already created.
The problem lies elsewhere.
Check the configuration files (in ‘testing’).
alirz23
(Ali Raza)
January 20, 2017, 3:38pm
5
what I am referring to is the assets directory, not the vendor path how did you install codeception is it installed globally
gnkevadia
(Gautam Superior)
January 24, 2017, 11:19am
6
I have the same problem, any luck?
Just installed fresh yii2 and try that running and getting same error ./advance not exist.
jacmoe
(Jacob Moena)
January 24, 2017, 12:37pm
7
I just tested this, and it ran just fine.
I guess you didn’t set it up as described in the docs?
http://www.yiiframew …ment-setup.html
composer global require "codeception/codeception=2.1.*"
composer global require "codeception/specify=*"
composer global require "codeception/verify=*"
jacmoe
(Jacob Moena)
January 24, 2017, 12:56pm
8
Also, make sure that you’ve read the testing readme for the advanced app:
Testing
===============================
Yii2 Advanced Application uses Codeception as its primary test framework.
There are already some sample tests prepared in `tests` directory of `frontend`, `backend`, and `common`.
In order for the following procedure to work, it is assumed that the application has been initialized using
the `dev` environment. In the case where tests need to be executed in a `Production` environment, `yii_test` and
`yii_test.bat` must be manually copied from the `environments/dev` folder into the project root directory.
Tests require an **additional database**, which will be cleaned up between tests.
Create database `yii2advanced_test` in mysql (according to config in `common/config/test-local.php`) and execute:
```
./yii_test migrate
```
Build the test suite:
```
This file has been truncated. show original
olexiy
(Aleksey)
January 24, 2017, 9:51pm
9
I have the same problem, any luck?
Just installed fresh yii2 and try that running and getting same error ./advance not exist.
I have fixed this error. I have just created ‘assets’ folder in my root directory + granted 0775 access to it.
olexiy
(Aleksey)
January 24, 2017, 9:54pm
10
Thanks. I have read it. I fixed it just to creating ‘assets’ directory in my root(project) folder. I am also little bit confused about it because creating new directory in Yii2 projects will violate yii2 file structure. But that what my ERROR was and it is only way I have found.
olexiy
(Aleksey)
January 24, 2017, 9:55pm
11
I have installed it using composer.json as described in yii2-advanced documentation.
jacmoe
(Jacob Moena)
January 24, 2017, 10:00pm
12
Yes, but did you run the init command as instructed?
To initialize the new Yii project, I mean.
It does not sound right that you needed to create an ‘assets’ directory at the root, because the advanced app has two web roots: frontend and backend.
shyevsa
(Sakurai Evsa)
August 1, 2017, 8:35am
13
Just found myself in the same problem when testing my backend functional test
I don’t know what exactly wrong but I fixed it by adding
'components'=>[
'assetManager' =>[
'basePath'=>'@backend/web/assets'
]
]
into
backend/config/test.php
1 Like