docker-magento icon indicating copy to clipboard operation
docker-magento copied to clipboard

Issue running MFTF

Open jcuerdo opened this issue 2 years ago • 1 comments

Description While I run: bin/mftf doctor image or bin/mftf run:test -k AdminLoginSuccessfulTest image

It fails due to a selenium issue.

Checking the selenium logs:

image

All seems ok, but:

magento2-selenium-1 | Only local connections are allowed.

Selenium is configured like: image

And running

image

I can access from my laptop browser:

image

But I can't create a session:

image

This is my .env

image

Thanks in advance

jcuerdo avatar Jul 22 '22 15:07 jcuerdo

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.

  1. Run mftf build process bin/mftf build:project. This should build the basic setup for mftf in your project.
  2. Update the extra_host values to match your Magento URL and IP in docker-compose.dev.yml.
  3. Update the values in src/dev/tests/acceptance/.env, including adding the new line SELENIUM_HOST=selenium to define the host Codeception should connect to.
  4. Run a sample test bin/mftf run:test AdminLoginTest.
  5. Update your nginx.conf file to allow access to the dev section with the following, before the final deny 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.

dmanners avatar Oct 10 '22 08:10 dmanners