Magento Functional
Testing Framework

Łukasz Bajsarowicz

Trainer at M2.coach, Developer at Strix

Magento Open Source Maintainer

2nd line of Warsaw Underground - Construction Site [facebook.com/metro.warszawa/]

vs

Unit Tests

Verify single units of application to expected results.

Acceptance of Delivery

Delivery / segment comparison against it's specification

Integration Tests

Verify whole functionalities in context of working app.

System tests and geodetic examination

Ongoing verification of construction integrity.

Functional Tests

Perform end-to-end testing of whole store.

Test Runs / Security tests

Fire and communication tests, train test runs...

November 2017

MFTF: Magento Functional Testing Framework

to  HELP with

hub.docker.com/u/selenium

 

standalone-chrome-debug

standalone-firefox-debug

Latest version of Selenium working with MFTF is 3.8.1

Docker setup

Standalone setup

Add to docker-compose.yml
vendor/bin/mftf

Config files are generated in dev/tests/acceptance

vendor/bin/mftf build:project

.env

MAGENTO_BASE_URL=http://magento.local/
MAGENTO_BACKEND_NAME=admin_12346
MAGENTO_ADMIN_USERNAME=admin
MAGENTO_ADMIN_PASSWORD=1234reTyt%$7
SELENIUM_HOST=127.0.0.1
BROWSER=firefox

Connection to Selenium is opened to perform test

vendor/bin/mftf test:run {Test Name}

Generates set of tests in Codeception format

vendor/bin/mftf generate:test

Runs all pre-generated tests in Selenium environment

vendor/bin/codecept run functional 
-c dev/tests/acceptance/codeception.yml

Single test: Captcha on Contact Us page

 

One more test: Validation of e-mail on checkout process

 

Action Group: Login to Admin Panel with custom credentials

 

Data: Admin Data

 

Page: Admin Login 

 

Section: Admin Login Form section

 

Section: Admin Login Message section

 

Allure: Test results reporting

 

Allure: Test results reporting

 

Simply: BDD-like output

 

Competition?

 

+ Typical BDD syntax

+ Need to build own gherkin interpreter

+ Still based on Selenium

+ Easy: low entry threshold

+ Does not need Selenium Driver

+ Based on JS

Complementary solutions

 

+ Cover multiple browsers and platforms

+ Open-source

+ Selenium-compatible

Testing e-mails?

Sure thing!

Is it worth it?

Yes, so...

... and test it efortless!

Questions?

lbajsarowicz

/in/lbajsarowicz

Łukasz Bajsarowicz

Magento Developer / Trainer

mftf.online

Be Superstar, be...

Share your experience,

get the valuable feedback

MageConf 2019 / MFTF - Acceptance functional testing for agencies and extension developers

By Łukasz Bajsarowicz

MageConf 2019 / MFTF - Acceptance functional testing for agencies and extension developers

MFTF - Acceptance functional testing for agencies and extension developers for Meet Magento Poland 2019

  • 604