Code Duplication    Length = 8-12 lines in 11 locations

src/Oro/Bundle/AccountBundle/Tests/Selenium/Pages/Account.php 1 location

@@ 121-128 (lines=8) @@
118
        return $this;
119
    }
120
121
    public function delete()
122
    {
123
        $this->test->byXPath("//div[@class='pull-left btn-group icons-holder']/a[contains(., 'Delete')]")->click();
124
        $this->test->byXPath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
125
        $this->waitPageToLoad();
126
        $this->waitForAjax();
127
        return new Accounts($this->test, false);
128
    }
129
}
130

src/Oro/Bundle/CaseBundle/Tests/Selenium/Pages/CaseEntity.php 1 location

@@ 64-71 (lines=8) @@
61
        return $this;
62
    }
63
64
    public function delete()
65
    {
66
        $this->test->byXpath("//a[@title = 'Delete Case']")->click();
67
        $this->test->byXpath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
68
        $this->waitPageToLoad();
69
        $this->waitForAjax();
70
        return new CaseEntity($this->test, false);
71
    }
72
73
    /**
74
     * @return CaseEntity

src/Oro/Bundle/ContactBundle/Tests/Selenium/Pages/Contact.php 1 location

@@ 434-441 (lines=8) @@
431
        return $this;
432
    }
433
434
    public function delete()
435
    {
436
        $this->test->byXpath("//div[@class='pull-left btn-group icons-holder']/a[contains(., 'Delete')]")->click();
437
        $this->test->byXpath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
438
        $this->waitPageToLoad();
439
        $this->waitForAjax();
440
        return new Contacts($this->test, false);
441
    }
442
443
    /**
444
     * Method checks Contact contacted count status

src/Oro/Bundle/ContactUsBundle/Tests/Selenium/Pages/ContactRequest.php 1 location

@@ 96-103 (lines=8) @@
93
    /**
94
     * @return ContactRequest
95
     */
96
    public function delete()
97
    {
98
        $this->test->byXpath("//div[@class='pull-left btn-group icons-holder']/a[contains(., 'Delete')]")->click();
99
        $this->test->byXpath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
100
        $this->waitPageToLoad();
101
        $this->waitForAjax();
102
        return new ContactRequest($this->test, false);
103
    }
104
105
    /**
106
     * @param string $step

src/Oro/Bundle/SalesBundle/Tests/Selenium/Pages/B2BCustomer.php 1 location

@@ 92-99 (lines=8) @@
89
        return $this;
90
    }
91
92
    public function delete()
93
    {
94
        $this->test->byXpath("//div[@class='pull-left btn-group icons-holder']/a[contains(., 'Delete')]")->click();
95
        $this->test->byXpath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
96
        $this->waitPageToLoad();
97
        $this->waitForAjax();
98
        return new B2BCustomers($this->test, false);
99
    }
100
}
101

src/Oro/Bundle/SalesBundle/Tests/Selenium/Pages/Lead.php 1 location

@@ 471-479 (lines=9) @@
468
        return $this;
469
    }
470
471
    public function delete()
472
    {
473
        $this->test->byXpath("//div[@class='pull-left btn-group icons-holder']/a[contains(., 'Delete')]")->click();
474
        $this->test->byXpath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
475
        $this->waitPageToLoad();
476
        $this->waitForAjax();
477
478
        return new Contacts($this->test, false);
479
    }
480
481
    public function setChannel($channel)
482
    {

src/Oro/Bundle/SalesBundle/Tests/Selenium/Pages/Opportunity.php 1 location

@@ 230-238 (lines=9) @@
227
        return $this;
228
    }
229
230
    public function delete()
231
    {
232
        $this->test->byXpath("//div[@class='pull-left btn-group icons-holder']/a[contains(., 'Delete')]")->click();
233
        $this->test->byXpath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
234
        $this->waitPageToLoad();
235
        $this->waitForAjax();
236
237
        return new Contacts($this->test, false);
238
    }
239
}
240

src/Oro/Bundle/SalesBundle/Tests/Selenium/Pages/SalesFunnel.php 1 location

@@ 123-131 (lines=9) @@
120
        return $this;
121
    }
122
123
    public function delete()
124
    {
125
        $this->test->byXpath("//div[@class='pull-left btn-group icons-holder']/a[contains(., 'Delete')]")->click();
126
        $this->test->byXpath("//div[div[contains(., 'Delete Confirmation')]]//a[text()='Yes, Delete']")->click();
127
        $this->waitPageToLoad();
128
        $this->waitForAjax();
129
130
        return new SalesFunnels($this->test, false);
131
    }
132
}
133

src/Oro/Bundle/SalesBundle/Tests/Selenium/Pages/Workflow.php 3 locations

@@ 150-161 (lines=12) @@
147
        return $this;
148
    }
149
150
    public function qualify()
151
    {
152
        $this->test->byId('transition-b2b_flow_sales_funnel-qualify')->click();
153
        sleep(1);
154
        $this->waitPageToLoad();
155
        $this->waitForAjax();
156
        $this->assertElementPresent(
157
            "//div[@class='ui-dialog-content ui-widget-content']/preceding-sibling::div/span[text()='Qualify']"
158
        );
159
160
        return $this;
161
    }
162
163
    public function disqualify()
164
    {
@@ 183-193 (lines=11) @@
180
        return $this;
181
    }
182
183
    public function reopen()
184
    {
185
        $this->test->byId('transition-b2b_flow_sales_funnel-reopen')->click();
186
        sleep(1);
187
        $this->waitForAjax();
188
        $this->test->byXpath("//div[div[contains(., 'Reopen')]]//a[text()='OK']")->click();
189
        $this->waitPageToLoad();
190
        $this->waitForAjax();
191
192
        return $this;
193
    }
194
195
    public function develop()
196
    {
@@ 195-206 (lines=12) @@
192
        return $this;
193
    }
194
195
    public function develop()
196
    {
197
        $this->test->byId('transition-b2b_flow_sales_funnel-develop')->click();
198
        sleep(1);
199
        $this->waitPageToLoad();
200
        $this->waitForAjax();
201
        $this->assertElementPresent(
202
            "//div[@class='ui-dialog-content ui-widget-content']/preceding-sibling::div/span[text()='Develop']"
203
        );
204
205
        return $this;
206
    }
207
208
    public function closeAsWon()
209
    {