SlideShare a Scribd company logo
Hi!
I’m Stan
https://twitter.com/st4nsm
MFTF
Introduction to

Magento Functional Testing Framework
Why perform
functional testing?
MFTF
• Reliable

• Maintainable

• Easy to use

• Performant.
Why write tests in XML?
• Fabian Schmangler’s thoughts on this topic:

https://www.schmengler-se.de/en/2017/06/my-opinion-on-xml-based-testing-in-magento/
Why MFTF?
• Based on a well-established framework: Codeception

• Built for Magento

• Scalability

• Automatic XML processing by custom tools

• Widely supported (browserstack.com, etc)
Flow
XML PHP
Codeception tests
Codeception/
Robo
Selenium
Driver
Environment Setup
Follow instructions from the official documentation:
http://devdocs.magento.com/guides/v2.2/magento-functional-testing-framework/release-1/getting-started.html

Install Selenium, Chrome driver and Allure CLI

Don’t forget to modify dev/tests/acceptance/.env:
MAGENTO_BASE_URL=http://msi.hom/

MAGENTO_BACKEND_NAME=admin

MAGENTO_ADMIN_USERNAME=admin

MAGENTO_ADMIN_PASSWORD=admin123
Basic Concepts
• Cest

• Page

• Section

• Data
Magento Search test
• Create a simple product

• Check that we can find this product

• Delete the product
Introduction to Magento Functional Testing Framework
Creating a product
<before>
<createData entity="SearchableProduct" stepKey="searchableProduct"/>
<amOnPage url="{{HomePage.url}}" stepKey="amOnPage"/>
</before>
Annotate the test
<annotations>
<title value="Simple Search Test"/>
<description value="Creates a simple product, checks that it displays
in the search results"/>
<group value="search"/>
</annotations>
Actual test
<fillField stepKey="enterSearchQuery"
selector="{{SearchFormSection.query}}" userInput="$$searchableProduct.name$
$"/>
<click stepKey="clickSearchButton"
selector="{{SearchFormSection.searchButton}}"/>
<waitForPageLoad stepKey="waitPageLoad"/>
<see stepKey="checkFirstProductTitle"
selector="{{SearchResultsSection.firstProductTitle}}" userInput="$
$searchableProduct.name$$"/>
<see stepKey="checkPageTitle" selector="{{SearchResultsSection.pageTitle}}"
userInput=“Search results for: '$$searchableProduct.name$$'"/>
Remove the product
<after>
<deleteData createDataKey="searchableProduct" stepKey="deleteProduct"/>
</after>
<section name="SearchFormSection">
<element name="query" type="input" selector="#search"/>
<element name="searchButton" type="button" selector="#search_mini_form button[type=submit]"/>
</section>
<section name="SearchResultsSection">
<element name="pageTitle" type="text" selector="h1.page-title"/>
<element name="firstProductTitle" type="text" selector=".product-items>.product-item:first-child a.product-item-link"/>
</section>
Sections
<entity name="SearchableProduct" type="product">
<data key="sku" unique="suffix">SearchableProduct</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="name" unique="suffix">SearchableProduct</data>
<data key="price">123.00</data>
<data key="visibility">4</data>
<data key="status">1</data>
<data key="qty">123</data>
<required-entity type="product_extension_attribute">EavStockItem</required-entity>
</entity>
Example type definitions:
CatalogMetadata
Data
Generate the tests
$ robo generate:tests
Let’s run it!
Ways to run tests
• Using Robo:



robo group search

• Using Codeception:



./vendor/bin/codecept run functional --verbose --steps --skip-group skip --group
search
Test Reports
• vendor/bin/robo allure2:generate

• vendor/bin/robo allure2:open
Generated Allure Report
Try it yourself
• Link to GitHub repo:

https://github.com/stansm/mftf-introduction
References
• http://devdocs.magento.com/guides/v2.2/magento-functional-testing-framework/release-1/introduction.html

• http://codeception.com/

• https://github.com/allure-framework/allure2

• https://www.schmengler-se.de/en/2017/06/my-opinion-on-xml-based-testing-in-magento/

• http://codeception.com/docs/reference/Locator

More Related Content

Similar to Introduction to Magento Functional Testing Framework (20)

PDF
Magento's MFTF for Agencies and Extension Developers
Łukasz Bajsarowicz
 
PPTX
Magento Function Testing Framework - Intro and Overview
Tom Erskine
 
PPTX
Magento2.3 API Functional Testing
Vishwas Bhatnagar
 
PPTX
Introduction to Integration Tests in Magento / Adobe Commerce
Bartosz Górski
 
PPTX
Introduction to Integration Tests in Magento / Adobe Commerce
Bartosz Górski
 
PDF
Automated Testing Talk from Meet Magento New York 2014
Joshua Warren
 
PDF
Automated tests types on Magento 2 example
Sergii Ivashchenko
 
PPTX
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic
 
PDF
Max Yekaterinenko - Magento 2 & Quality
Meet Magento Italy
 
PPTX
Automated tests in Magento
Yevhen Sentiabov
 
PDF
Testing Magento 2
vinaikopp
 
PPTX
Magento applications and modules functional testing
Neklo
 
PDF
Magento 2 integration tests
Dusan Lukic
 
PPTX
Automated Testing in Magento 2
Magecom UK Limited
 
PPTX
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Igor Miniailo
 
PPTX
Testing in Magento 2
Igor Miniailo
 
PDF
Vitalyi Golomoziy - Integration tests in Magento 2
Meet Magento Italy
 
PDF
Faster Magento Integration Tests
Yireo
 
PPTX
Ecommerce testing
badurkar
 
PPTX
Ecommerce testing
badurkar
 
Magento's MFTF for Agencies and Extension Developers
Łukasz Bajsarowicz
 
Magento Function Testing Framework - Intro and Overview
Tom Erskine
 
Magento2.3 API Functional Testing
Vishwas Bhatnagar
 
Introduction to Integration Tests in Magento / Adobe Commerce
Bartosz Górski
 
Introduction to Integration Tests in Magento / Adobe Commerce
Bartosz Górski
 
Automated Testing Talk from Meet Magento New York 2014
Joshua Warren
 
Automated tests types on Magento 2 example
Sergii Ivashchenko
 
Dusan Lukic Magento 2 Integration Tests Meet Magento Serbia 2016
Dusan Lukic
 
Max Yekaterinenko - Magento 2 & Quality
Meet Magento Italy
 
Automated tests in Magento
Yevhen Sentiabov
 
Testing Magento 2
vinaikopp
 
Magento applications and modules functional testing
Neklo
 
Magento 2 integration tests
Dusan Lukic
 
Automated Testing in Magento 2
Magecom UK Limited
 
Magento 2 Automated Testing via examples of Multi-Source Inventory (MSI)
Igor Miniailo
 
Testing in Magento 2
Igor Miniailo
 
Vitalyi Golomoziy - Integration tests in Magento 2
Meet Magento Italy
 
Faster Magento Integration Tests
Yireo
 
Ecommerce testing
badurkar
 
Ecommerce testing
badurkar
 

Recently uploaded (20)

PPTX
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
PPTX
Lec 2 Compiler, Interpreter, linker, loader.pptx
javidmiakhil63
 
PPTX
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
PPTX
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
PPTX
Operations Profile SPDX_Update_20250711_Example_05_03.pptx
Shane Coughlan
 
PPTX
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
 
PDF
How Attendance Management Software is Revolutionizing Education.pdf
Pikmykid
 
PDF
custom development enhancement | Togglenow.pdf
aswinisuhu
 
PPTX
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
PDF
Simplify React app login with asgardeo-sdk
vaibhav289687
 
PDF
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
PPTX
Transforming Lending with IntelliGrow – Advanced Loan Software Solutions
Intelli grow
 
PPTX
API DOCUMENTATION | API INTEGRATION PLATFORM
philipnathen82
 
PPTX
UI5con_2025_Accessibility_Ever_Evolving_
gerganakremenska1
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PDF
ESUG 2025: Pharo 13 and Beyond (Stephane Ducasse)
ESUG
 
PPTX
How Odoo ERP Enhances Operational Visibility Across Your Organization.pptx
zidanakhtar874
 
PDF
NSF Converter Simplified: From Complexity to Clarity
Johnsena Crook
 
PDF
Notification System for Construction Logistics Application
Safe Software
 
PDF
Show Which Projects Support Your Strategy and Deliver Results with OnePlan df
OnePlan Solutions
 
iaas vs paas vs saas :choosing your cloud strategy
CloudlayaTechnology
 
Lec 2 Compiler, Interpreter, linker, loader.pptx
javidmiakhil63
 
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
Operations Profile SPDX_Update_20250711_Example_05_03.pptx
Shane Coughlan
 
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
 
How Attendance Management Software is Revolutionizing Education.pdf
Pikmykid
 
custom development enhancement | Togglenow.pdf
aswinisuhu
 
Smart Doctor Appointment Booking option in odoo.pptx
AxisTechnolabs
 
Simplify React app login with asgardeo-sdk
vaibhav289687
 
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
Transforming Lending with IntelliGrow – Advanced Loan Software Solutions
Intelli grow
 
API DOCUMENTATION | API INTEGRATION PLATFORM
philipnathen82
 
UI5con_2025_Accessibility_Ever_Evolving_
gerganakremenska1
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
ESUG 2025: Pharo 13 and Beyond (Stephane Ducasse)
ESUG
 
How Odoo ERP Enhances Operational Visibility Across Your Organization.pptx
zidanakhtar874
 
NSF Converter Simplified: From Complexity to Clarity
Johnsena Crook
 
Notification System for Construction Logistics Application
Safe Software
 
Show Which Projects Support Your Strategy and Deliver Results with OnePlan df
OnePlan Solutions
 
Ad

Introduction to Magento Functional Testing Framework