Code Duplication    Length = 8-11 lines in 2 locations

src/Context/BrowserContext.php 2 locations

@@ 126-133 (lines=8) @@
123
     *
124
     * @When (I )hover :element
125
     */
126
    public function iHoverIShouldSeeIn($element)
127
    {
128
        $node = $this->getSession()->getPage()->find('css', $element);
129
        if ($node === null) {
130
            throw new \Exception("The hovered element '$element' was not found anywhere in the page");
131
        }
132
        $node->mouseOver();
133
    }
134
135
    /**
136
     * Save value of the field in parameters array
@@ 318-328 (lines=11) @@
315
     *
316
     * @Then the element :element should be enabled
317
     */
318
    public function theElementShouldBeEnabled($element)
319
    {
320
        $node = $this->getSession()->getPage()->find('css', $element);
321
        if ($node === null) {
322
            throw new \Exception("There is no '$element' element");
323
        }
324
325
        if ($node->hasAttribute('disabled')) {
326
            throw new \Exception("The element '$element' is not enabled");
327
        }
328
    }
329
330
    /**
331
     * Checks, that element with given CSS is disabled