FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
85 stars 47 forks source link

Have MDK specify alternate Behat browsers #163

Open andrewnicols opened 6 years ago

andrewnicols commented 6 years ago

It would be handy if we could more easily allow for selection of a different browser.

In terms of config, we just need something like:

$CFG->behat_profiles = [
    'chrome' => [
        'browser' => 'chrome',
    ],
    'firefox' => [
        'browser' => 'firefox',
    ],
];

$CFG->behat_profiles['default'] = $CFG->behat_profiles['chrome'];

And then to run, we need to specify an additional argument when running behat:

--profile chrome

The existing behat addConfig commands in MDK only deal with a line at a time. I'd like to suggest we perhaps add a line to require_once another config file (stored within MDK somewhere) to help with this.

FMCorz commented 6 years ago

I agree, I've ran into that as well.

nwp90 commented 3 years ago

Would be particularly nice if this could allow us to avoid selenium completely & use ChromeDriver (ideally by default).

andrewnicols commented 3 years ago

I'm working on improving his in Moodle more generally to improve support. When I get that over the line (i.e. when I have some time) I also intend to consider shipping some defaults, and to consider how these fit into MDK.

nwp90 commented 3 years ago

Oh, hi :) That was quick! Yeah, I've just been looking at it and it does rather look like https://tracker.moodle.org/browse/MDL-58948 doesn't quite go far enough for this to be done "nicely" with MDK, and https://tracker.moodle.org/browse/MDL-59479 probably needs some love. I can probably justify spending some time on this at the moment, so if there's anything I can do now to help, let me know.

andrewnicols commented 3 years ago

Yup - take a look at MDL-66979 instead. I'm trying to migrate to W3C WebDriver so we can ditch the JsonWire webdriver we currently use. That opens things up massively for other browsers (Edge, Firefox, Safari).

nwp90 commented 3 years ago

A quick look at that looks like you've got the basics working and now going through all the tests to fix up anything that needs updating to make sure they still pass?

nwp90 commented 3 years ago

In fact it looks like you're nearly done - is there any particular area that it would be helpful to try out/look at/beat into submission?