|
6 | 6 | namespace Magento\Signifyd\Test\Block\Sandbox;
|
7 | 7 |
|
8 | 8 | use Magento\Mtf\Block\Block;
|
9 |
| -use Magento\Mtf\Client\Locator; |
10 | 9 |
|
11 | 10 | /**
|
12 |
| - * Block with case information. |
| 11 | + * Case information block. |
13 | 12 | */
|
14 | 13 | class CaseInfo extends Block
|
15 | 14 | {
|
16 | 15 | /**
|
| 16 | + * Css selector of "Flag Case As Good" button. |
| 17 | + * |
17 | 18 | * @var string
|
18 | 19 | */
|
19 |
| - private $flagGoodButton = '.flag-case-good'; |
| 20 | + private $flagCaseAsGoodButton = '[class*="flag-case-good"]'; |
20 | 21 |
|
21 | 22 | /**
|
| 23 | + * Css selector of guarantee status. |
| 24 | + * |
22 | 25 | * @var string
|
23 | 26 | */
|
24 |
| - private $guaranteeDisposition = '.guarantee-status'; |
| 27 | + private $guaranteeDisposition = '[class*="guarantee-status"]'; |
25 | 28 |
|
26 | 29 | /**
|
| 30 | + * Css selector of CVV response description. |
| 31 | + * |
27 | 32 | * @var string
|
28 | 33 | */
|
29 |
| - private $cvvResponseDescription = '//span[contains(@ng-bind, "caseOrderSummary.cvvResponseDescription")]'; |
| 34 | + private $cvvResponseDescription = '[ng-bind="caseOrderSummary.cvvResponseDescription"]'; |
30 | 35 |
|
31 | 36 | /**
|
| 37 | + * Css selector of CVV response code. |
| 38 | + * |
32 | 39 | * @var string
|
33 | 40 | */
|
34 |
| - private $cvvResponseCode = '//span[contains(@ng-bind, "caseOrderSummary.cvvResponseCode")]'; |
| 41 | + private $cvvResponseCode = '[ng-bind="caseOrderSummary.cvvResponseCode"]'; |
35 | 42 |
|
36 | 43 | /**
|
| 44 | + * Css selector of AVS response description. |
| 45 | + * |
37 | 46 | * @var string
|
38 | 47 | */
|
39 |
| - private $avsResponseDescription = '//span[contains(@ng-bind, "caseOrderSummary.avsResponseDescription")]'; |
| 48 | + private $avsResponseDescription = '[ng-bind="caseOrderSummary.avsResponseDescription"]'; |
40 | 49 |
|
41 | 50 | /**
|
| 51 | + * Css selector of AVS response code. |
| 52 | + * |
42 | 53 | * @var string
|
43 | 54 | */
|
44 |
| - private $avsResponseCode = '//span[contains(@ng-bind, "caseOrderSummary.avsResponseCode")]'; |
| 55 | + private $avsResponseCode = '[ng-bind="caseOrderSummary.avsResponseCode"]'; |
45 | 56 |
|
46 | 57 | /**
|
| 58 | + * Css selector of displayed case order id. |
| 59 | + * |
47 | 60 | * @var string
|
48 | 61 | */
|
49 |
| - private $orderId = '//span[contains(@ng-bind, "currentCase.caseIdDisplay")]'; |
| 62 | + private $orderId = '[ng-bind="currentCase.caseIdDisplay"]'; |
50 | 63 |
|
51 | 64 | /**
|
| 65 | + * Css selector of displayed order amount. |
| 66 | + * |
52 | 67 | * @var string
|
53 | 68 | */
|
54 |
| - private $orderAmount = '//span[contains(@ng-bind, "currentCase.orderAmount")]'; |
| 69 | + private $orderAmount = '[ng-bind*="currentCase.orderAmount"]'; |
55 | 70 |
|
56 | 71 | /**
|
| 72 | + * Css selector of displayed card holder name. |
| 73 | + * |
57 | 74 | * @var string
|
58 | 75 | */
|
59 |
| - private $cardHolder = '//a[contains(@data-dropdown, "peopleLinks0")]//span'; |
| 76 | + private $cardHolder = '[data-dropdown="peopleLinks0"] span'; |
60 | 77 |
|
61 | 78 | /**
|
| 79 | + * Css selector of displayed billing address. |
| 80 | + * |
62 | 81 | * @var string
|
63 | 82 | */
|
64 |
| - private $billingAddress = '//a[contains(@data-dropdown, "streetLinks0")]'; |
| 83 | + private $billingAddress = '[data-dropdown="streetLinks0"]'; |
65 | 84 |
|
66 | 85 | /**
|
| 86 | + * Flags case as good. |
| 87 | + * |
67 | 88 | * @return void
|
68 | 89 | */
|
69 |
| - public function flagCaseGood() |
| 90 | + public function flagCaseAsGood() |
70 | 91 | {
|
71 |
| - $this->_rootElement->find($this->flagGoodButton)->click(); |
| 92 | + $this->_rootElement->find($this->flagCaseAsGoodButton)->click(); |
72 | 93 | }
|
73 | 94 |
|
74 | 95 | /**
|
75 |
| - * @return array|string |
| 96 | + * Gets guarantee disposition. |
| 97 | + * |
| 98 | + * @return string |
76 | 99 | */
|
77 | 100 | public function getGuaranteeDisposition()
|
78 | 101 | {
|
79 | 102 | return $this->_rootElement->find($this->guaranteeDisposition)->getText();
|
80 | 103 | }
|
81 | 104 |
|
82 | 105 | /**
|
| 106 | + * Gets CVV response. |
| 107 | + * |
83 | 108 | * @return string
|
84 | 109 | */
|
85 | 110 | public function getCvvResponse()
|
86 | 111 | {
|
87 | 112 | return sprintf(
|
88 | 113 | '%s (%s)',
|
89 |
| - $this->_rootElement->find($this->cvvResponseDescription, Locator::SELECTOR_XPATH)->getText(), |
90 |
| - $this->_rootElement->find($this->cvvResponseCode, Locator::SELECTOR_XPATH)->getText() |
| 114 | + $this->_rootElement->find($this->cvvResponseDescription)->getText(), |
| 115 | + $this->_rootElement->find($this->cvvResponseCode)->getText() |
91 | 116 | );
|
92 | 117 | }
|
93 | 118 |
|
94 | 119 | /**
|
| 120 | + * Gets AVS response. |
| 121 | + * |
95 | 122 | * @return string
|
96 | 123 | */
|
97 | 124 | public function getAvsResponse()
|
98 | 125 | {
|
99 | 126 | return sprintf(
|
100 | 127 | '%s (%s)',
|
101 |
| - $this->_rootElement->find($this->avsResponseDescription, Locator::SELECTOR_XPATH)->getText(), |
102 |
| - $this->_rootElement->find($this->avsResponseCode, Locator::SELECTOR_XPATH)->getText() |
| 128 | + $this->_rootElement->find($this->avsResponseDescription)->getText(), |
| 129 | + $this->_rootElement->find($this->avsResponseCode)->getText() |
103 | 130 | );
|
104 | 131 | }
|
105 | 132 |
|
106 | 133 | /**
|
107 |
| - * @return array|string |
| 134 | + * Gets displayed order id. |
| 135 | + * |
| 136 | + * @return string |
108 | 137 | */
|
109 | 138 | public function getOrderId()
|
110 | 139 | {
|
111 |
| - return $this->_rootElement->find($this->orderId, Locator::SELECTOR_XPATH)->getText(); |
| 140 | + return $this->_rootElement->find($this->orderId)->getText(); |
112 | 141 | }
|
113 | 142 |
|
114 | 143 | /**
|
115 |
| - * @return array|string |
| 144 | + * Gets displayed order amount. |
| 145 | + * |
| 146 | + * @return string |
116 | 147 | */
|
117 | 148 | public function getOrderAmount()
|
118 | 149 | {
|
119 |
| - return $this->_rootElement->find($this->orderAmount, Locator::SELECTOR_XPATH)->getText(); |
| 150 | + return $this->_rootElement->find($this->orderAmount)->getText(); |
120 | 151 | }
|
121 | 152 |
|
122 | 153 | /**
|
123 |
| - * @return array|string |
| 154 | + * Gets displayed card holder name. |
| 155 | + * |
| 156 | + * @return string |
124 | 157 | */
|
125 | 158 | public function getCardHolder()
|
126 | 159 | {
|
127 |
| - return $this->_rootElement->find($this->cardHolder, Locator::SELECTOR_XPATH)->getText(); |
| 160 | + return $this->_rootElement->find($this->cardHolder)->getText(); |
128 | 161 | }
|
129 | 162 |
|
130 | 163 | /**
|
131 |
| - * @return array|string |
| 164 | + * Gets displayed billing address. |
| 165 | + * |
| 166 | + * @return string |
132 | 167 | */
|
133 | 168 | public function getBillingAddress()
|
134 | 169 | {
|
135 |
| - return $this->_rootElement->find($this->billingAddress, Locator::SELECTOR_XPATH)->getText(); |
| 170 | + return $this->_rootElement->find($this->billingAddress)->getText(); |
136 | 171 | }
|
137 | 172 | }
|
0 commit comments