Code Duplication    Length = 8-9 lines in 4 locations

tests/_support/Page/plan/Create.php 1 location

@@ 54-62 (lines=9) @@
51
        $I->click("//select/option[.='{$this->type}']");
52
    }
53
54
    private function findClient()
55
    {
56
        $I = $this->tester;
57
58
        $I->click("//select[@name='Plan[client]']/../span");
59
        $I->fillField('//input[@class="select2-search__field"]', $this->client);
60
        $I->waitForElementNotVisible('.loading-results', 120);
61
        $I->click('.select2-results__option--highlighted');
62
    }
63
64
    private function chooseCurrency()
65
    {

tests/_support/Page/price/Create.php 3 locations

@@ 28-36 (lines=9) @@
25
        $I->waitForElement('#create-prices');
26
    }
27
28
    public function choosePriceType(string $priceType): void
29
    {
30
        $I = $this->tester;
31
32
        $I->click('//div[contains(@class, "field-type")]/span');
33
        $I->fillField('.select2-search__field', $priceType);
34
        $I->waitForElementNotVisible('.loading-results', 120);
35
        $I->click("//li[contains(text(), '{$priceType}')]");
36
    }
37
38
    public function chooseObject(string $objectName): void
39
    {
@@ 38-46 (lines=9) @@
35
        $I->click("//li[contains(text(), '{$priceType}')]");
36
    }
37
38
    public function chooseObject(string $objectName): void
39
    {
40
        $I = $this->tester;
41
42
        $I->click('//div[contains(@class, "field-object_id")]/span');
43
        $I->fillField('.select2-search__field', $objectName);
44
        $I->waitForElementNotVisible('.loading-results', 120);
45
        $I->click("//li[text()='{$objectName}']");
46
    }
47
48
    public function chooseTemplate(string $templateName): void
49
    {
@@ 48-55 (lines=8) @@
45
        $I->click("//li[text()='{$objectName}']");
46
    }
47
48
    public function chooseTemplate(string $templateName): void
49
    {
50
        $I = $this->tester;
51
52
        $I->fillField('.select2-search__field', $templateName);
53
        $I->waitForElementNotVisible('.loading-results', 120);
54
        $I->click("//li[contains(text(), '{$templateName}')]");
55
    }
56
57
    public function proceedToCreation(): void
58
    {