Skip to content

Commit 688df43

Browse files
MTO-104: [Test] Export Customer Addresses
- Tests fixed.
1 parent 9ec007b commit 688df43

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ public function getFirstName()
107107
{
108108
$mapping = $this->dataMapping();
109109
return $this->_rootElement->find(
110-
$mapping['firstname']['selector'],
111-
$mapping['firstname']['strategy']
110+
$mapping['customer']['value']['firstname']['selector']
112111
)->getValue();
113112
}
114113

@@ -121,8 +120,7 @@ public function getLastName()
121120
{
122121
$mapping = $this->dataMapping();
123122
return $this->_rootElement->find(
124-
$mapping['lastname']['selector'],
125-
$mapping['lastname']['strategy']
123+
$mapping['customer']['value']['lastname']['selector']
126124
)->getValue();
127125
}
128126

@@ -167,8 +165,7 @@ public function isCurrentPasswordVisible()
167165
{
168166
$mapping = $this->dataMapping();
169167
return $this->_rootElement->find(
170-
$mapping['current_password']['selector'],
171-
$mapping['current_password']['strategy']
168+
$mapping['customer']['value']['current_password']['selector']
172169
)->isVisible();
173170
}
174171

@@ -181,8 +178,7 @@ public function isPasswordVisible()
181178
{
182179
$mapping = $this->dataMapping();
183180
return $this->_rootElement->find(
184-
$mapping['password']['selector'],
185-
$mapping['password']['strategy']
181+
$mapping['customer']['value']['password']['selector']
186182
)->isVisible();
187183
}
188184

@@ -209,8 +205,7 @@ public function isEmailVisible()
209205
{
210206
$mapping = $this->dataMapping();
211207
return $this->_rootElement->find(
212-
$mapping['email']['selector'],
213-
$mapping['email']['strategy']
208+
$mapping['customer']['value']['email']['selector']
214209
)->isVisible();
215210
}
216211
}

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.xml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,21 @@
88
<mapping strict="0">
99
<fields>
1010
<customer composite="1">
11-
<firstname />
12-
<lastname />
13-
<email />
14-
<current_password />
15-
<password />
11+
<firstname>
12+
<selector>input[name*=firstname]</selector>
13+
</firstname>
14+
<lastname>
15+
<selector>input[name*=lastname]</selector>
16+
</lastname>
17+
<email>
18+
<selector>input[id=email]</selector>
19+
</email>
20+
<current_password>
21+
<selector>input[name*=current-password]</selector>
22+
</current_password>>
23+
<password>
24+
<selector>input[name*=current-password]</selector>
25+
</password>
1626
</customer>
1727
<change_password>
1828
<input>checkbox</input>

dev/tests/functional/tests/app/Magento/CustomerImportExport/Test/Constraint/AssertImportCustomerAddresses.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ private function getPrepareAddresses()
107107
foreach ($customers as $customer) {
108108
$this->customerIndexEdit->open(['id' => $customer->getId()]);
109109
$customerForm->openTab('addresses');
110-
$address = $customerForm->getTab('addresses')->getDataAddresses($addressTemplate)[0];
110+
$addresses = $customerForm->getTab('addresses')->getDataAddresses($addressTemplate);
111+
$address = array_shift($addresses);
111112
if (!empty($address)) {
112113
$resultAddressesArray[] = $address;
113114
}

0 commit comments

Comments
 (0)