Completed
Push — master ( df9faa...fbbb87 )
by Paweł
55:06 queued 41:50
created

IndexPage::getDefinedElements()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Behat\Page\Admin\Product;
13
14
use Sylius\Behat\Page\Admin\Crud\IndexPage as CrudIndexPage;
15
16
/**
17
 * @author Kamil Kokot <[email protected]>
18
 */
19
final class IndexPage extends CrudIndexPage implements IndexPageInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function filterByTaxon($taxonName)
25
    {
26
        $this->getElement('taxon_filter', ['%taxon%' => $taxonName])->click();
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected function getDefinedElements()
33
    {
34
        return array_merge(parent::getDefinedElements(), [
35
            'taxon_filter' => '.item a:contains("%taxon%")',
36
        ]);
37
    }
38
39
}
40