Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
LoginOnFrontendFailTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Page\CustomerAccountLogin;
10 use Magento\Mtf\Fixture\FixtureFactory;
11 use Magento\Mtf\TestCase\Injectable;
13 
28 class LoginOnFrontendFailTest extends Injectable
29 {
30  /* tags */
31  const MVP = 'yes';
32  /* end tags */
33 
42  public function test(Customer $customer, CustomerAccountLogin $loginPage, FixtureFactory $fixtureFactory)
43  {
44  // Precondition
45  $customer->persist();
46  $customerData = $customer->getData();
47  $customerData['password'] = 'fail';
48  $customerData['group_id'] = ['dataset' => 'default'];
49  $failCustomer = $fixtureFactory->createByCode('customer', ['data' => $customerData]);
50 
51  // Steps
52  $loginPage->open();
53  $loginPage->getLoginBlock()->fill($failCustomer);
54  $loginPage->getLoginBlock()->submit();
55  }
56 }
$customerData
$customer
Definition: customers.php:11
test(Customer $customer, CustomerAccountLogin $loginPage, FixtureFactory $fixtureFactory)