drupalextension icon indicating copy to clipboard operation
drupalextension copied to clipboard

Status Code & Selenium2Driver

Open L0rD59 opened this issue 6 years ago • 1 comments

Hi,

I've problem with some features when i use Selenium2Driver.

As far i know with this Driver we can't get status code.

Some some assert fail like this one : https://github.com/jhedstrom/drupalextension/blob/master/src/Drupal/DrupalExtension/Context/DrupalContext.php#L339

Can we change this assert or remove this ?

Thx

L0rD59 avatar Oct 16 '19 08:10 L0rD59

We could change this to be more like the one in the Drupal\MinkContext:

        // If available, add extra validation that this is a 200 response.
        try {
            $this->getSession()->getStatusCode();
            $this->assertHttpResponse('200');
        } catch (UnsupportedDriverActionException $e) {
            // Simply continue on, as this driver doesn't support HTTP response codes.
        }

but we couldn't just continue on, we'd need the unsupported drivers to verify the page has actually loaded the edit form and not an access denied page...

jhedstrom avatar Oct 22 '19 00:10 jhedstrom