/** * @inheritDoc */ public function selectBillingAddressFromAddressBook(AddressInterface $address) { $this->waitForElement(2, sprintf('%s_province', self::TYPE_BILLING)); $addressBookSelect = $this->getElement('billing_address_book'); $addressBookSelect->click(); $addressOption = $addressBookSelect->waitFor(5, function () use($address, $addressBookSelect) { return $addressBookSelect->find('css', sprintf('.item[data-id="%s"]', $address->getId())); }); if (null === $addressOption) { throw new ElementNotFoundException($this->getDriver(), 'option', 'css', sprintf('.item[data-id="%s"]', $address->getId())); } $addressOption->click(); }
/** * @inheritDoc */ public function selectBillingAddressFromAddressBook(AddressInterface $address) { $addressBookSelect = $this->getElement('billing_address_book'); $addressBookSelect->click(); $addressBookSelect->waitFor(5, function () use($address, $addressBookSelect) { return $addressBookSelect->find('css', sprintf('.item[data-value="%s"]', $address->getId())); })->click(); }