mdk icon indicating copy to clipboard operation
mdk copied to clipboard

Have MDK specify alternate Behat browsers

Open andrewnicols opened this issue 7 years ago • 7 comments

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.

andrewnicols avatar Nov 15 '17 00:11 andrewnicols

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

FMCorz avatar Nov 15 '17 01:11 FMCorz

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

nwp90 avatar Sep 09 '20 23:09 nwp90

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.

andrewnicols avatar Sep 09 '20 23:09 andrewnicols

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.

nwp90 avatar Sep 10 '20 00:09 nwp90

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).

andrewnicols avatar Sep 10 '20 00:09 andrewnicols

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 avatar Sep 10 '20 02:09 nwp90

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?

nwp90 avatar Sep 10 '20 03:09 nwp90