Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Get Working Setup for Running Acceptance Tests according to README #286

Open
juppwerner opened this issue Feb 27, 2023 · 2 comments
Labels
good first issue Simple enough issue to start with. status:ready for adoption Feel free to implement this issue. type:docs Documentation

Comments

@juppwerner
Copy link

I wanted to understand how testing works with Yii2. I cannot run the acceptance tests.
I am refering to the section Running acceptance tests the READMEof this application template repository.

What steps will reproduce the problem?

Install Yii2 basic app template: composer create-project --prefer-dist yiisoft/yii2-app-basic yii2-app-basic-testing => App and packages are installed OK

Rename tests/acceptance.suite.yml.example to tests/acceptance.suite.yml => done

Install codeception/codeception: The package codeception/codeception is already installed by default composer requirement (so the related line in README seems redundant)

Run Selenium standalone: java -jar -Dwebdriver.chrome.driver=~/chromedriver.exe selenium-server-standalone-3.141.59.jar => app is installed OK

Start web server: tests/bin/yii serve => server is running OK

Run tests: vendor\bin\codecept run => Error, see below

What's expected?

Have all tests run

What do you get instead?

The following error is shown:

In ModuleContainer.php line 115:

Module WebDriver is not installed.
Use Composer to install corresponding package:

composer require codeception/module-webdriver --dev

Install codeception/module-webdriver as per above results in

Your requirements could not be resolved to an installable set of packages.

Also with option --with-all-dependencies (-W)

Additional info

Q A
Yii version Current as per composer file in Yii2 App Basic
PHP version 8.1.6
Operating system Windows 11

Thank you.

@samdark samdark added the status:to be verified Needs to be reproduced and validated. label Feb 27, 2023
@particleflux
Copy link
Contributor

Can confirm, the info in the README is a bit outdated.
Due to the current hard-wiring of phpunit (see #308), the webdriver needs to be installed with a version constrained to 3.x

composer require --dev codeception/module-webdriver:^3.0

I suggest updating the README as such:

diff --git a/README.md b/README.md
index 981a7f9..5067770 100644
--- a/README.md
+++ b/README.md
@@ -155,8 +155,11 @@ To execute acceptance tests do the following:
 
 1. Rename `tests/acceptance.suite.yml.example` to `tests/acceptance.suite.yml` to enable suite configuration
 
-2. Replace `codeception/base` package in `composer.json` with `codeception/codeception` to install full-featured
-   version of Codeception
+2. Install `codeception/module-webdriver`:
+
+   ```
+   composer require --dev codeception/module-webdriver:^3.0
+   ```
 
 3. Update dependencies with Composer 
 

(or without the version constraint once the phpunit explicit dep is gone)

@samdark samdark added type:docs Documentation status:ready for adoption Feel free to implement this issue. good first issue Simple enough issue to start with. and removed status:to be verified Needs to be reproduced and validated. labels Oct 19, 2023
@thelizardreborn
Copy link

Would it make more sense to add codeception/module-webdriver to the composer.json directly (in require-dev? Then step 2 could be omitted entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Simple enough issue to start with. status:ready for adoption Feel free to implement this issue. type:docs Documentation
Projects
None yet
Development

No branches or pull requests

4 participants