docker-magento
docker-magento copied to clipboard
Issue running MFTF
Description
While I run:
bin/mftf doctor
or
bin/mftf run:test -k AdminLoginSuccessfulTest
It fails due to a selenium issue.
Checking the selenium logs:
All seems ok, but:
magento2-selenium-1 | Only local connections are allowed.
Selenium is configured like:
And running
I can access from my laptop browser:
But I can't create a session:
This is my .env
Thanks in advance
Hi @jcuerdo,
Did you make the changed in the nginx config from the setup document?
MFTF
To work with MFTF you will need to first enable the selenium
image in the docker-compose.dev.yml
file. Then, you will need to run the following.
- Run mftf build process
bin/mftf build:project
. This should build the basic setup for mftf in your project. - Update the
extra_host
values to match your Magento URL and IP indocker-compose.dev.yml
. - Update the values in
src/dev/tests/acceptance/.env
, including adding the new lineSELENIUM_HOST=selenium
to define the host Codeception should connect to. - Run a sample test
bin/mftf run:test AdminLoginTest
. - Update your
nginx.conf
file to allow access to the dev section with the following, before the finaldeny all
section:
location ~* ^/dev/tests/acceptance/utils($|/) {
root $MAGE_ROOT;
location ~ ^/dev/tests/acceptance/utils/command.php {
fastcgi_pass fastcgi_backend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
For debugging, you can connect to the selenium image using a VCN client.
- Connect with the VCN option and
127.0.0.1:5900
- Run
bin/mftf doctor
to validate all sections are setup correctly.