Code Duplication    Length = 14-14 lines in 2 locations

src/Context/BrowserContext.php 2 locations

@@ 76-89 (lines=14) @@
73
     *
74
     * @When (I )follow the :index :link link
75
     */
76
    public function iFollowTheNthLink($index, $link)
77
    {
78
        $page = $this->getSession()->getPage();
79
80
        $links = $page->findAll('named', [
81
            'link', $this->getSession()->getSelectorsHandler()->xpathLiteral($link)
82
        ]);
83
84
        if (!isset($links[$index - 1])) {
85
            throw new \Exception("The $index link '$link' was not found anywhere in the page");
86
        }
87
88
        $links[$index - 1]->click();
89
    }
90
91
    /**
92
     * Presses the nth specified button
@@ 96-109 (lines=14) @@
93
     *
94
     * @When (I )press the :index :button
95
     */
96
    public function pressTheNthButton($index, $button)
97
    {
98
        $page = $this->getSession()->getPage();
99
100
        $buttons = $page->findAll('named', [
101
            'button', $this->getSession()->getSelectorsHandler()->xpathLiteral($button)
102
        ]);
103
104
        if (!isset($buttons[$index - 1])) {
105
            throw new \Exception("The $index button '$button' was not found anywhere in the page");
106
        }
107
108
        $buttons[$index - 1]->press();
109
    }
110
111
    /**
112
     * Fills in form field with current date