Yii Framework Forum: Codecept test failed on advanced template - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Codecept test failed on advanced template

#1 User is offline   Olexiy Danylevskyi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 20-July 13

Posted 18 January 2017 - 03:53 PM

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.
0

#2 User is offline   alrazi 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,402
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 19 January 2017 - 07:18 AM

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
0

#3 User is offline   Olexiy Danylevskyi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 20-July 13

Posted 19 January 2017 - 03:27 PM

View Postalirz23, on 19 January 2017 - 07:18 AM, said:

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


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)?
0

#4 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 19 January 2017 - 04:04 PM

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').
"Less noise - more signal"
0

#5 User is offline   alrazi 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,402
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 20 January 2017 - 10:38 AM

what I am referring to is the assets directory, not the vendor path how did you install codeception is it installed globally
0

#6 User is offline   Gauttam Kevadia 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 22-April 16

Posted 24 January 2017 - 06:19 AM

I have the same problem, any luck?

Just installed fresh yii2 and try that running and getting same error ./advance not exist.
0

#7 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 24 January 2017 - 07:37 AM

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=*" 

"Less noise - more signal"
0

#8 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 24 January 2017 - 07:56 AM

Also, make sure that you've read the testing readme for the advanced app:
https://github.com/y...tart-testing.md
"Less noise - more signal"
0

#9 User is offline   Olexiy Danylevskyi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 20-July 13

Posted 24 January 2017 - 04:51 PM

View PostGauttam Kevadia, on 24 January 2017 - 06:19 AM, said:

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.
0

#10 User is offline   Olexiy Danylevskyi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 20-July 13

Posted 24 January 2017 - 04:54 PM

View Postjacmoe, on 24 January 2017 - 07:56 AM, said:

Also, make sure that you've read the testing readme for the advanced app:
https://github.com/y...tart-testing.md


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.
0

#11 User is offline   Olexiy Danylevskyi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 20-July 13

Posted 24 January 2017 - 04:55 PM

View Postalirz23, on 20 January 2017 - 10:38 AM, said:

what I am referring to is the assets directory, not the vendor path how did you install codeception is it installed globally


I have installed it using composer.json as described in yii2-advanced documentation.
0

#12 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,694
  • Joined: 10-October 10
  • Location:Denmark

Posted 24 January 2017 - 05:00 PM

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.
"Less noise - more signal"
0

#13 User is offline   Shy Evsa 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 03-September 10

Posted 01 August 2017 - 03:35 AM

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

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users