Giter VIP home page Giter VIP logo

behat-magento2-extension's Introduction

Behat Magento2 Extension

License Latest Stable Version Build Status

This is a fork of the BehatMagentoExtension, which is compatible with PHP8.1 and greater. This should ensure successful end-to-end testing of Magento 2 projects.

The BehatMagento2Extension provides a custom service container for Behat which allows to inject Magento services into Behat Contexts and Behat helper services.

Installation

The recommended installation method is through Composer:

composer require seec/behat-magento2-extension

Usage

In order to bootstrap Magento2 into your Behat suite, some modifications to the used behat.yml are required.

Note: If you use the Hooks provided by this package, your Magento Database will be purged and refilled with your fixtures after each individual test. This adds extra time to the execution but leaves your database also with DUMMY data. Do not use the hooks if you want to keep your database intact. Do not use it on a production server if you don't know what you are doing.

Testing

If you want to contribute to this module, make sure to run tests locally before committing. Docker Compose Containers are set-up to run all tests for all PHP versions automatically, so testing is very easy.

$ cp .env.dist .env // make sure to add your keys to the .env file otherwise testing will not work!
$ docker compose build
$ docker compose up -d
$ docker compose exec php sh
$ install-magento
$ install-extension
$ cd /var/www/html/vendor/seec/behat-magento2-extension
$ php vendor/bin/behat

Code Quality

We aim for a unified code style; thus we enforce ECS and PHPStan onto our code. Make sure to run the following commands before committing:

$ php vendor/bin/ecs check src/ tests/ features/ --fix
$ php vendor/bin/phpstan analyse src/ --level=8
$ php vendor/bin/phpstan analyse features/ --level=8
$ php vendor/bin/phpstan analyse tests/ --level=5

Documentation

The official documentation is available here.

behat-magento2-extension's People

Contributors

nopenopenope avatar sprabhakar96 avatar tkotosz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.