minor changes
This commit is contained in:
parent
edf961b490
commit
7be7ebdfb6
4 changed files with 12 additions and 4 deletions
|
|
@ -140,11 +140,18 @@ export class BasePage {
|
||||||
let loaderElements = await this.page.locator('button .loader, .buy-loader, timeout, .modal-loader').all();
|
let loaderElements = await this.page.locator('button .loader, .buy-loader, timeout, .modal-loader').all();
|
||||||
return !(await Promise.any(loaderElements.map(el => el.isVisible())).catch(() => false));
|
return !(await Promise.any(loaderElements.map(el => el.isVisible())).catch(() => false));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Take a screenshot of the page before validating the progress bar
|
||||||
|
await this.page.screenshot({ path: `test-results\\ortoni-data\\progress-bar-${Date.now()}.png`, fullPage: true });
|
||||||
|
// Wait until the progress bar element is attached and visible
|
||||||
|
|
||||||
const actualProgressPercentage = await this.progressBar.evaluate(
|
const actualProgressPercentage = await this.progressBar.evaluate(
|
||||||
(element) => element.style.width || "Not Found"
|
async (element) => {
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 200));
|
||||||
|
return element.style.width || "Not Found";
|
||||||
|
}
|
||||||
);
|
);
|
||||||
Soft.expect(actualProgressPercentage).toBe(progressPercentage);
|
Soft.expect(actualProgressPercentage).toBe(progressPercentage);
|
||||||
console.log(`Progress Bar Percentage: Actual - ${actualProgressPercentage} vs Expected - ${progressPercentage}`);
|
console.log(`Progress Bar Percentage: Actual - ${actualProgressPercentage} vs Expected - ${progressPercentage}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -69,7 +69,7 @@ export class OrderConfirmationPage extends BasePage {
|
||||||
expect.soft(servicePackageValue).toContain('New wiper blades');
|
expect.soft(servicePackageValue).toContain('New wiper blades');
|
||||||
}
|
}
|
||||||
if (servicePackage === ServicePackage.Premium) {
|
if (servicePackage === ServicePackage.Premium) {
|
||||||
expect.soft(servicePackageValue).toContain('Rain Defense™');
|
expect.soft(servicePackageValue).toContain('Rain Repel Treatment');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Promo Code Validation
|
// Promo Code Validation
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ export class PaymentMethodPage extends BasePage {
|
||||||
expect.soft(servicePackageValue).toContain('New wiper blades');
|
expect.soft(servicePackageValue).toContain('New wiper blades');
|
||||||
}
|
}
|
||||||
if (servicePackage === ServicePackage.Premium) {
|
if (servicePackage === ServicePackage.Premium) {
|
||||||
expect.soft(servicePackageValue).toContain('Rain repel treatment');
|
expect.soft(servicePackageValue).toContain('Rain Repel Treatment');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Promo Code Validation
|
// Promo Code Validation
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ 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: 'ArrowDown' });
|
await this.streetAddressTextBox.dispatchEvent('keydown', { key: 'ArrowDown' });
|
||||||
await this.streetAddressTextBox.dispatchEvent('keyup', { key: 'ArrowDown' });
|
await this.streetAddressTextBox.dispatchEvent('keyup', { key: 'ArrowDown' });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue