Completed
Push — 3.8.x ( 9319bd...9386e4 )
by Tim
61:18 queued 59:29
created

ProductFeatureContext   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 30
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A thePageShouldBeAvailable() 0 6 1
A thePageShouldContainThePrice() 0 13 2
1
<?php
2
3
/**
4
 * Defines application features from the specific context.
5
 */
6
class ProductFeatureContext extends FeatureContext
7
{
8
9
  /**
10
    * @Then the page :arg1 should be available
11
    */
12
    public function thePageShouldBeAvailable($arg1)
13
    {
14
15
        $this->visitPath($arg1);
16
        PHPUnit_Framework_Assert::assertSame(200, $this->getSession()->getStatusCode());
17
    }
18
19
    /**
20
     * @Then the page :arg1 should contain the price :arg2
21
     */
22
    public function thePageShouldContainThePrice($arg1, $arg2)
23
    {
24
25
        $this->visitPath($arg1);
26
27
        /** @var \Behat\Mink\Element\NodeElement $price */
28
        $prices = $this->getSession()->getPage()->findAll('xpath', '//*[@id="product-price-21606"]/span');
29
30
        foreach ($prices as $price) {
31
            echo "Found value: " . $price->getValue() . PHP_EOL;
32
            PHPUnit_Framework_Assert::assertSame($arg2, $price->getValue());
33
        }
34
    }
35
}
36