11 use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit;
12 use Magento\Customer\Test\Page\CustomerAccountLogin;
13 use Magento\Mtf\Fixture\FixtureFactory;
14 use Magento\Mtf\Fixture\FixtureInterface;
15 use Magento\Mtf\TestCase\Injectable;
16 use Magento\Mtf\TestStep\TestStepFactory;
48 private $fixtureFactory;
55 private $customerAccountLogin;
62 private $customerIndexEdit;
81 TestStepFactory $stepFactory,
82 FixtureFactory $fixtureFactory,
83 CustomerAccountLogin $customerAccountLogin,
84 CustomerIndexEdit $customerIndexEdit
86 $this->stepFactory = $stepFactory;
87 $this->fixtureFactory = $fixtureFactory;
88 $this->customerAccountLogin = $customerAccountLogin;
89 $this->customerIndexEdit = $customerIndexEdit;
109 $this->configData = $configData;
112 $this->stepFactory->create(
113 \
Magento\Config\Test\TestStep\SetupConfigurationStep::class,
114 [
'configData' => $this->configData]
120 $correctData[
'group_id'] = [
121 'customerGroup' =>
$customer->getDataFieldConfig(
'group_id')[
'source']->getCustomerGroup()
126 $newData[
'group_id'] = [
127 'customerGroup' =>
$customer->getDataFieldConfig(
'group_id')[
'source']->getCustomerGroup()
129 $newData[
'password'] = $incorrectPassword;
131 $incorrectCustomer = $this->fixtureFactory->createByCode(
'customer', [
'data' => $newData]);
134 $this->customerAccountLogin->open();
137 $this->customerLogin($incorrectCustomer, $this->customerAccountLogin->getLoginBlock(), $attempts);
140 $this->customerLogin($incorrectCustomer, $this->customerAccountLogin->getLoginBlockWithCaptcha(), $attempts);
143 $customer = $this->fixtureFactory->createByCode(
'customer', [
'data' => $correctData]);
144 $this->customerLogin(
$customer, $this->customerAccountLogin->getLoginBlockWithCaptcha(), 1);
155 private function customerLogin(FixtureInterface
$customer,
Login $loginForm, $attempts)
157 for (
$i = 0;
$i < $attempts;
$i++) {
170 $this->stepFactory->create(
171 \
Magento\Config\Test\TestStep\SetupConfigurationStep::class,
172 [
'configData' => $this->configData,
'rollback' =>
true]
__inject(TestStepFactory $stepFactory, FixtureFactory $fixtureFactory, CustomerAccountLogin $customerAccountLogin, CustomerIndexEdit $customerIndexEdit)
test(Customer $customer, $configData, $captcha, $incorrectPassword, $attempts)