1 | <?php |
||
23 | class ShowPage extends SymfonyPage implements ShowPageInterface |
||
24 | { |
||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | public function addToCart() |
||
29 | { |
||
30 | $this->getDocument()->pressButton('Add to cart'); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function addToCartWithQuantity($quantity) |
||
37 | { |
||
38 | $this->getDocument()->fillField('Quantity', $quantity); |
||
39 | $this->getDocument()->pressButton('Add to cart'); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function addToCartWithVariant($variant) |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function addToCartWithOption(OptionInterface $option, $optionValue) |
||
59 | { |
||
60 | $select = $this->getDocument()->find('css', sprintf('select#sylius_cart_item_variant_%s', $option->getCode())); |
||
61 | |||
62 | $this->getDocument()->selectFieldOption($select->getAttribute('name'), $optionValue); |
||
63 | $this->getDocument()->pressButton('Add to cart'); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function visit($url) |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function getName() |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function hasAttributeWithValue($name, $value) |
||
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | public function isOutOfStock() |
||
109 | |||
110 | /** |
||
111 | * {@inheritdoc} |
||
112 | */ |
||
113 | public function hasAddToCartButton() |
||
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function getRouteName() |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | protected function getDefinedElements() |
||
137 | } |
||
138 |