Skip to content

Commit 09a2ea4

Browse files
committed
MTA-576: Re-factor Test for Create Customer on Backend
- Fixed bug with customer
1 parent 53c7145 commit 09a2ea4

File tree

7 files changed

+16
-80
lines changed

7 files changed

+16
-80
lines changed

dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerTitle.php renamed to dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendFormTitle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Assert that edit page of customer account contains correct title.
1515
*/
16-
class AssertCustomerTitle extends AbstractConstraint
16+
class AssertCustomerBackendFormTitle extends AbstractConstraint
1717
{
1818
/* tags */
1919
const SEVERITY = 'middle';
@@ -42,6 +42,6 @@ public function processAssert(CustomerAccountIndex $pageCustomerIndex, Customer
4242
*/
4343
public function toString()
4444
{
45-
return 'Assert that title is correct.';
45+
return 'Customer backend edit form title is correct.';
4646
}
4747
}

dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/AddressBook.php

Lines changed: 0 additions & 62 deletions
This file was deleted.

dev/tests/functional/tests/app/Magento/Customer/Test/Fixture/Customer/Address.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Magento\Customer\Test\Fixture\Customer;
88

9-
use Magento\Customer\Test\Fixture\Address as AddressInjectable;
9+
use Magento\Customer\Test\Fixture\Address as AddressFixture;
1010
use Magento\Mtf\Fixture\FixtureFactory;
1111
use Magento\Mtf\Fixture\FixtureInterface;
1212

@@ -51,14 +51,14 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array
5151
if (isset($data['presets'])) {
5252
$data['presets'] = explode(',', $data['presets']);
5353
foreach ($data['presets'] as $value) {
54-
/** @var AddressInjectable $addresses*/
54+
/** @var AddressFixture $addresses*/
5555
$addresses = $fixtureFactory->createByCode('address', ['dataSet' => $value]);
5656
$this->data[] = $addresses->getData();
5757
$this->addressesFixture[] = $addresses;
5858
}
5959
} elseif (empty($data['presets']) && !empty($data['addresses'])) {
6060
foreach ($data['addresses'] as $addresses) {
61-
/** @var AddressInjectable $addresses */
61+
/** @var AddressFixture $addresses */
6262
$this->data[] = $addresses->getData();
6363
$this->addressesFixture[] = $addresses;
6464
}

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
use Magento\Customer\Test\Page\Adminhtml\CustomerIndexNew;
1414

1515
/**
16-
* Test Coverage for CreateCustomerBackendEntityTest.
17-
*
18-
* General Flow:
16+
* Steps:
1917
* 1. Log in as default admin user.
2018
* 2. Go to Customers > All Customers.
2119
* 3. Press "Add New Customer" button.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"customerAction";"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue";"tag"
2-
"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";""
3-
"save";"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-31689";""
4-
"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";""
5-
"save";"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"";""
6-
"save";"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";""
7-
"saveAndContinue";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerTitle";"";"test_type:acceptance_test"
1+
"description";"customerAction";"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue";"tag"
2+
"General customer without address";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";""
3+
"Customer with prefix";"save";"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"03/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-31689";""
4+
"General customer from USA";"save";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";""
5+
"Retailer customer without address";"save";"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"";""
6+
"General customer from Poland";"save";"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"";""
7+
"MAGETWO-12516: Create New Customer on Backend";"saveAndContinue";"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerBackendFormTitle";"";"test_type:acceptance_test"

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ForgotPasswordOnFrontendTest extends Functional
2020
public function testForgotPassword()
2121
{
2222
// Create Customer
23-
$customer = ObjectManager::getInstance()->create(
23+
$customer = $this->objectManager->getInstance()->create(
2424
'Magento\Customer\Test\Fixture\Customer',
2525
['dataSet' => 'customer_US_1']
2626
);

dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
<pageCustomerIndexEdit class="Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit" />
4747
</require>
4848
</assertCustomerForm>
49-
<assertCustomerTitle module="Magento_Customer">
49+
<assertCustomerBackendFormTitle module="Magento_Customer">
5050
<severity>middle</severity>
51-
</assertCustomerTitle>
51+
</assertCustomerBackendFormTitle>
5252
<assertCustomerInvalidEmail module="Magento_Customer">
5353
<severity>middle</severity>
5454
<require>

0 commit comments

Comments
 (0)