MageTest / BehatMage

Behat for Magento
MIT License
85 stars 31 forks source link

Direct magento driver proof of concept #83

Open jon-acker opened 9 years ago

jon-acker commented 9 years ago

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 commented 9 years ago

The inspection completed: No new issues

ciaranmcnulty commented 9 years ago

This looks great.

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

jon-acker commented 9 years ago

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

ciaranmcnulty commented 9 years ago

e.g using with StackPHP.

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