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
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PDF
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
PDF
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
PDF
intro_to_cpp_namespace_robotics_corner.pdf
MohamedSaied877003
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PPTX
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
Is Framer the Future of AI Powered No-Code Development?
Isla Pandora
 
PPTX
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PPTX
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
Salesforce Experience Cloud Consultant.pdf
VALiNTRY360
 
intro_to_cpp_namespace_robotics_corner.pdf
MohamedSaied877003
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
prodad heroglyph crack 2.0.214.2 Full Free Download
cracked shares
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
Is Framer the Future of AI Powered No-Code Development?
Isla Pandora
 
Get Started with Maestro: Agent, Robot, and Human in Action – Session 5 of 5
klpathrudu
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
BB FlashBack Pro 5.61.0.4843 With Crack Free Download
cracked shares
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Ad

Introduction to Magento Functional Testing Framework