adding a change to handle addresslookup page
This commit is contained in:
parent
8ff1615ce1
commit
b10ec1f608
1 changed files with 14 additions and 5 deletions
|
|
@ -43,9 +43,8 @@ export class AddressForm extends BasePage {
|
||||||
// await this.forceAddressFormToAppear();
|
// await this.forceAddressFormToAppear();
|
||||||
await this.streetAddressTextBox.click();
|
await this.streetAddressTextBox.click();
|
||||||
await this.streetAddressTextBox.pressSequentially(`${customerDetails.address.street}, ${customerDetails.address.city}, ${customerDetails.address.state} ${customerDetails.address.postalCode}`).then( async() => {
|
await this.streetAddressTextBox.pressSequentially(`${customerDetails.address.street}, ${customerDetails.address.city}, ${customerDetails.address.state} ${customerDetails.address.postalCode}`).then( async() => {
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
await this.streetAddressTextBox.dispatchEvent('keydown', { key: 'ArrowLeft' } );
|
||||||
await this.streetAddressTextBox.dispatchEvent('keydown', { key: 'ArrowDown' });
|
await this.streetAddressTextBox.dispatchEvent('keyup', { key: 'ArrowLeft' });
|
||||||
await this.streetAddressTextBox.dispatchEvent('keyup', { key: 'ArrowDown' });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
await waitUntil(async () => {
|
await waitUntil(async () => {
|
||||||
|
|
@ -57,10 +56,20 @@ export class AddressForm extends BasePage {
|
||||||
text.includes(customerDetails.address!.state)
|
text.includes(customerDetails.address!.state)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
await this.addressSuggestionList.dispatchEvent('mouseover');
|
|
||||||
await this.addressSuggestionList.click();
|
await this.page.hover(".pac-container .pac-item");
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
|
await this.addressSuggestionList.click(); // Select the first suggestion
|
||||||
|
//await this.streetAddressTextBox.press('Tab'); // Move focus to ZIP code field
|
||||||
|
|
||||||
// Fill address
|
// Fill address
|
||||||
|
await this.stateDrpDwn.waitFor({ state: 'visible', timeout: 5000 }).then(async () => {
|
||||||
|
const selectedState = await this.stateDrpDwn.inputValue();
|
||||||
|
if (selectedState !== customerDetails.address!.state) {
|
||||||
|
await this.stateDrpDwn.selectOption(customerDetails.address!.state);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
await this.fillAndValidate(this.streetAddressTextBox, customerDetails.address.street);
|
await this.fillAndValidate(this.streetAddressTextBox, customerDetails.address.street);
|
||||||
await this.fillAndValidate(this.zipCodeTextBox, customerDetails.address.postalCode)
|
await this.fillAndValidate(this.zipCodeTextBox, customerDetails.address.postalCode)
|
||||||
await this.fillAndValidate(this.cityTextBox, customerDetails.address.city);
|
await this.fillAndValidate(this.cityTextBox, customerDetails.address.city);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue