Code Duplication    Length = 8-11 lines in 2 locations

src/Context/BrowserContext.php 2 locations

@@ 138-145 (lines=8) @@
135
     *
136
     * @When (I )hover :element
137
     */
138
    public function iHoverIShouldSeeIn($element)
139
    {
140
        $node = $this->getSession()->getPage()->find('css', $element);
141
        if ($node === null) {
142
            throw new \Exception("The hovered element '$element' was not found anywhere in the page");
143
        }
144
        $node->mouseOver();
145
    }
146
147
    /**
148
     * Save value of the field in parameters array
@@ 293-303 (lines=11) @@
290
     *
291
     * @Then the element :element should be enabled
292
     */
293
    public function theElementShouldBeEnabled($element)
294
    {
295
        $node = $this->getSession()->getPage()->find('css', $element);
296
        if ($node === null) {
297
            throw new \Exception("There is no '$element' element");
298
        }
299
300
        if ($node->hasAttribute('disabled')) {
301
            throw new \Exception("The element '$element' is not enabled");
302
        }
303
    }
304
305
    /**
306
     * Checks, that element with given CSS is disabled