faker = Factory::create('at_AT'); } /** * Before method. * * @param FunctionalTester $I * @return void */ public function _before(FunctionalTester $I): void { $I->useDefaultTheme(); } /** * Test update customer profile. * * @param FunctionalTester $I * @return void */ public function updateCustomerProfile(FunctionalTester $I): void { $customer = $I->loginAsCustomer(); $customer->first_name = $I->cleanField($customer->first_name); $customer->last_name = $I->cleanField($customer->last_name); $customer->save(); $I->amOnPage('/'); $I->click('Profile'); $I->click('Edit'); $I->selectOption('gender', 'Other'); $I->click('Update Profile'); $I->dontSeeInSource('The old password does not match.'); $I->seeInSource('Profile updated successfully.'); $I->seeRecord(Customer::class, [ 'id' => $customer->id, 'gender' => 'Other', ]); } /** * Update customer address. * * @param FunctionalTester $I * @return void */ public function updateCustomerAddress(FunctionalTester $I): void { $formCssSelector = '#customer-address-form'; $I->loginAsCustomer(); $I->amOnPage('/'); $I->click('Profile'); $I->click('Address'); $I->click('Add Address'); $this->setFields($I); foreach ($this->fields as $key => $value) { /** * The following fields are rendered via javascript so we ignore them. */ if (! in_array($key, [ 'country', 'state', ])) { $selector = 'input[name="' . $key . '"]'; $I->fillField($selector, $value); } } $I->wantTo('Ensure that the `company_name` field is being displayed.'); $I->seeElement('.account-table-content > div:nth-child(2) > input:nth-child(2)'); /** * We need to use this css selector to hit the correct