What is Magento MFTF?
MFTF is the Magento Functional Testing Framework, Adobe’s official end-to-end (E2E) UI test runner for Magento 2 and Adobe Commerce. Tests are written declaratively in XML (no per-test PHP) and executed by Codeception, which drives Selenium / Chromedriver to control a real browser. Tests live in <Module>/Test/Mftf/*.xml. MFTF replaced the older Selenium suite around Magento 2.2 (2018), Adobe runs ~12,000 MFTF tests per Magento release in CI, and MFTF is required for Marketplace EQP certification.
- Test format XML-declarative E2E (no per-test PHP)
- Browser Selenium / Chromedriver via Codeception
- Adoption Required for EQP · 12k+ tests per Magento release
Five steps from first test XML to CI integration
MFTF isn't a black-box runner: it's a documented XML grammar plus Codeception under the hood. Here is the wiring, end to end.
01Write test XML in your module
Drop a new test at <Vendor>/<Module>/Test/Mftf/Test/MyFeatureTest.xml. The XML declares <test> elements with annotations (stories, title, severity, group) and a list of test steps. No PHP class per test: the XML is the test. MFTF parses the XML at run time and generates a Codeception test on the fly.
02Reuse ActionGroups for common flows
ActionGroups live under <Module>/Test/Mftf/ActionGroup/*.xml and are reusable test fragments: e.g. AdminLoginActionGroup logs into the admin, StorefrontAddProductToCartActionGroup adds a product. Reference them from tests with <actionGroup ref="AdminLoginActionGroup" stepKey="login"/>. This is how MFTF keeps a 12k-test suite maintainable.
03Pin selectors in Section files
CSS / XPath selectors live in <Module>/Test/Mftf/Section/MySection.xml: completely separate from test logic. When Adobe rewrites the admin DOM in M2.4.7 you fix the selector in one Section file, not in 50 test files. Pin to data-test attributes where possible: they survive UI refreshes better than CSS class names.
04Run the test from the CLI
Execute with vendor/bin/mftf run:test MyFeatureTest, or run a whole group with vendor/bin/mftf run:group myGroup. MFTF spins up Chromedriver, opens a real browser window (or runs headless with --headless), executes every step, and reports pass/fail. Run from your dev machine, your CI container, or a Selenium Grid worker: same XML, same result.
05Wire JUnit output into CI
MFTF emits JUnit XML to dev/tests/acceptance/tests/_output/ plus screenshots + HTML page dumps on every failure. Plug those into Jenkins, GitHub Actions, GitLab CI, or Bitbucket Pipelines as test artefacts: Magento core uses this exact pattern on Adobe’s internal CI to run ~12,000+ MFTF tests per release. Failures show up as annotated build errors with screenshots inline.
Four situations where MFTF is the obvious answer
MFTF isn't the right tool for every Magento test scenario, but in 2026 these four situations are unambiguous wins.
Magento Marketplace EQP certification
If you’re submitting a paid extension to the Magento Marketplace, MFTF tests are required for Extension Quality Program (EQP) certification. Adobe’s reviewers run your MFTF suite as part of the technical review: no MFTF means a failed submission. Bake at least one happy-path MFTF test per public-facing feature before you submit, and keep coverage above 60% to clear EQP comfortably.
Regression-testing custom modules across upgrades
When Adobe ships Magento 2.4.6 → 2.4.7 your custom modules will silently break in three or four places: observer signatures change, admin form layouts move, GraphQL schemas drift. An MFTF suite running against the upgraded codebase catches those regressions in 10 minutes instead of three weeks of bug reports from production users. Run the suite on every composer update of magento/product-community-edition.
Large team / agency Magento builds
On 5+ developer teams MFTF gives QA non-devs a way to write tests in declarative XML: no PHP knowledge, no Selenium API study. QA writes the test against the staging environment, devs review the XML in PR, the test joins the suite. PHPUnit unit tests stay with devs; MFTF E2E tests are shared with QA. This is how Adobe themselves split responsibility on the Magento core team.
Hardening pre-production releases
Before pushing a major feature to production, run a smoke MFTF suite against staging that covers the critical paths: checkout, account creation, password reset, admin login, product save, order processing. Combine with PHPUnit for unit-level coverage. The two together (MFTF for E2E + PHPUnit for units) is the Adobe-recommended testing stack and gives the highest confidence before a Friday-night deploy.
Three MFTF misconfigs that waste weeks of QA time
Almost every flaky-MFTF-suite I have been called in to fix came from one of these three mistakes. Audit your tests for them today.
Selectors pinned to unstable CSS classes
The Magento admin DOM changes every minor version: .admin__data-grid-header in 2.4.5 becomes .admin-grid-header in 2.4.7, and your entire MFTF suite goes red. Pin selectors to data-test or data-mage-init attributes where they exist, fall back to semantic aria-label matches, and treat raw CSS classes as a last resort. Centralise them all in Section XML so a DOM rewrite is a one-file fix.
Running MFTF against production mode
MFTF needs Magento in developer mode (or at least a fresh setup:static-content:deploy run) so the theme assets are compiled and the test runner can drive the rendered DOM. Running against a production-mode site without static-content deployed gives missing-asset 404s, broken layouts, and false-negative test failures. Run bin/magento deploy:mode:set developer on your CI Magento container before any MFTF run.
Mixing MFTF + PHPUnit + Cypress randomly
Three E2E frameworks in one module is a maintenance nightmare: every selector lives in three places, every fixture is duplicated, every CI run takes 4× as long. Pick one E2E framework per module. MFTF is the Adobe-blessed choice and integrates with Magento Marketplace EQP automatically. PHPUnit stays for unit tests (different layer, different job). Drop Cypress / Playwright unless you have a non-Magento frontend layer that already uses it.
Where MFTF sits in the wider Magento testing stack
Five neighbour concepts most readers want to look at next. Click through for the full deep-dive.
- What is Magento MarketplaceAdobe’s official extension marketplace: where MFTF-tested third-party modules are sold. Understand the submission flow before you write your first MFTF test.
- What is Magento Marketplace EQPExtension Quality Program: Adobe’s technical review gate. MFTF tests are required to pass EQP certification on every paid Marketplace extension.
- What is Magento DI CompileThe compilation step that generates proxies, interceptors, and the object-manager cache. Runs once before MFTF executes so the test runtime has the compiled DI graph available.
- Magento extension developmentBuild, test, and ship a Magento extension: module skeleton, DI wiring, plugins, observers, plus the MFTF test suite the Marketplace expects. Fixed-price or hourly.
- Hire a Magento developerAdobe Certified Magento & Hyvä developer, ten years on platform. MFTF test authoring, EQP-pass extension audits, CI pipeline wiring, fixed-price or hourly.
Magento MFTF: frequently asked questions
MFTF vs PHPUnit: what is the difference?
MFTF vs Cypress or Playwright: why not those?
vendor/bin/mftf is part of the magento/magento2-functional-testing-framework package), and integrates directly with Magento Marketplace EQP: your tests get re-run by Adobe’s reviewers when you submit an extension. MFTF also has built-in support for Magento entities (create a category fixture, create a customer fixture, create an order fixture) without you wiring up the data. For a Magento-only project pick MFTF. For a hybrid project (Magento backend + React storefront), Cypress / Playwright covers the React side and MFTF covers the Magento admin.Can I write MFTF tests in PHP?
/Test/Mftf/Helper/*.php let you call arbitrary PHP from a test step (useful for setting up complex fixtures or hitting external APIs from a test), and Custom Actions let you extend the action vocabulary. Use them sparingly: every PHP escape hatch is a piece of test logic that lives outside the XML and breaks the "QA can read the test" promise. If you find yourself writing 200 lines of PHP per MFTF test, you probably want PHPUnit instead.Does MFTF work on Hyvä storefronts?
How long does an MFTF suite take to run?
Can MFTF run against production?
Want MFTF tests written for your Magento module?
Send your repo and feature list: I will scope an MFTF suite (critical happy paths, EQP-pass coverage, CI wiring) and reply with a written test plan, fixed-price quote, and earliest start date. 24-business-hour turnaround.