Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct magento driver proof of concept #83

Open
wants to merge 3 commits into
base: feature/Behat3
Choose a base branch
from

Conversation

jon-acker
Copy link

This is an attempt to integrate magento more directly, similarly to the way the Symfony2 driver does with symfony. It adds a new driver definition called "magento" and it can be used in place of goutte, e.g. in the behat.yml file you would have:

        Behat\MinkExtension:
            base_url: 'http://local.dev'
            magento: ~

From my initial tests, with a basic magento installation, this works, although it doesn't seem to work with all magento installations I've tried (perhaps differences with Enterprise version etc.)

The main point is, for scenarios that do not require javascript (i.e. those that currently use only the mink:goutte driver) this can speed up execution by 70-80%! (because we'd not making a real HTTP request)

I've included a sample context for creating an admin user, although this should clearly form part of the behat-mage core, its here for demo purposes.

@scrutinizer-notifier
Copy link

The inspection completed: No new issues

@ciaranmcnulty
Copy link

This looks great.

I suspect Driver/MageApp.php might be useful in other contexts - have you considered a separate lib?

@jon-acker
Copy link
Author

@ciaranmcnulty didn't consider a separate lib because couldn't imagine other contexts, give me an example.

@ciaranmcnulty
Copy link

e.g using with StackPHP.

It would be useful to use the CORS middleware for Mage, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants