Browse Source

189: add the basic mftf setup information
- Update the readme with mftf setup instructions,
- create a wrapper bin/mftf command
- update the docker-compose and docker-compose.dev yml files with the needed docker images

David Manners 5 years ago
parent
commit
fbe252ede7
4 changed files with 45 additions and 0 deletions
  1. 28 0
      README.md
  2. 2 0
      compose/bin/mftf
  3. 12 0
      compose/docker-compose.dev.yml
  4. 3 0
      compose/docker-compose.yml

+ 28 - 0
README.md

@@ -274,6 +274,7 @@ You'll now have an updated `bin/update` helper script, and can run it to update
 - `bin/fixperms`: This will fix filesystem permissions within the container.
 - `bin/grunt`: Run the grunt binary. Ex. `bin/grunt exec`
 - `bin/magento`: Run the Magento CLI. Ex: `bin/magento cache:flush`
+- `bin/mftf`: Run the Magento MFTF. Ex: `bin/mftf build:project`
 - `bin/mysql`: Run the MySQL CLI with database config from env/db.env. Ex `bin/mysql -e "EXPLAIN core_config_data"`
 - `bin/n98-magerun2`: Access the n98 magerun CLI. Ex: `bin/n98-magerun2 dev:console`
 - `bin/node`: Run the node binary. Ex. `bin/node --version`
@@ -414,6 +415,33 @@ Next, open up the `bin/start` helper script and uncomment the line:
 
 Finally, restart the containers with `bin/restart`. After doing so, everything is now configured and you can use a browser extension to profile your Magento store with Blackfire.
 
+### MFTF
+
+To work with MFTF you will need to first enable the `selenium` image in the `docker-compose.dev.yml` file.selenium
+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,
+1. Update the extra host values to match your Magneto URL and IP in `docker-compose.dev.yml`,
+1. Update the values in `src/dev/tests/acceptance/.env`. Including adding the new line `SELENIUM_HOST=selenium` to define for Codeception which host to connect to,
+1. Run a sample test `bin/mftf run:test AdminLoginTest`
+1. Update your nginx.conf 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`
+You can also run `bin/mftf doctor` to validate all sections are setup correctly.
+
 ## Credits
 
 ### M.academy

+ 2 - 0
compose/bin/mftf

@@ -0,0 +1,2 @@
+#!/bin/bash
+bin/clinotty vendor/bin/mftf "$@"

+ 12 - 0
compose/docker-compose.dev.yml

@@ -39,3 +39,15 @@ services:
   # Disabling cron by default as it uses higher CPU, enable if needed
   #cron:
   #  volumes: *appvolumes
+
+  # Disabling selenium by default as it is not required for all use cases
+  #selenium:
+  #  image: selenium/standalone-chrome-debug:3.8.1
+  #  ports:
+  #    - "5900:5900"
+  # Uncomment two lines below & replace IP with result of: docker run --rm alpine ip route | awk 'NR==1 {print $3}'
+  # Replace the "magento2-composer.loc" with the url of your site
+  #  extra_hosts:
+  #    - "magento2.test:172.17.0.1"
+  #  links:
+  #    - app

+ 3 - 0
compose/docker-compose.yml

@@ -63,6 +63,9 @@ services:
   #    - db
   #  volumes: *appvolumes
 
+  #selenium:
+  #  image: selenium/standalone-chrome-debug:3.8.1
+
 volumes:
   appdata:
   dbdata: