added CASH-488 changes
This commit is contained in:
parent
088aaa0acc
commit
16949a78a9
6 changed files with 29 additions and 25 deletions
|
|
@ -4,9 +4,13 @@
|
||||||
# Environment type
|
# Environment type
|
||||||
NODE_ENV="qa"
|
NODE_ENV="qa"
|
||||||
|
|
||||||
|
SKIP_CONTENT_SITE=false
|
||||||
|
|
||||||
# Base URLs by environment (uncomment the one you need)
|
# Base URLs by environment (uncomment the one you need)
|
||||||
# qa
|
# qa
|
||||||
BASE_URL="https://www-qa2.safelite.com/"
|
BASE_URL="https://www-qa2.safelite.com/"
|
||||||
|
# qa with skipToInsurance Turned Off
|
||||||
|
# BASE_URL="https://fixmyglassqa.safelite.com/?cns=all&experiments=ConceptFunnel=ConceptFunnel_V1=ConceptFunnel_VinAndEmailOptional=true,NextGen_IGQSkipToInsurance=NextGen_IGQSkipToInsurance_V1=NextGen_IGQSkipToInsurance_CONTROL=true"
|
||||||
# sys
|
# sys
|
||||||
# BASE_URL="https://www-test2.safelite.com/fmg/?fmgPage=vehicle"
|
# BASE_URL="https://www-test2.safelite.com/fmg/?fmgPage=vehicle"
|
||||||
# dev
|
# dev
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,3 @@
|
||||||
schedules:
|
|
||||||
- cron: 0 9 * * MON-FRI
|
|
||||||
always: true
|
|
||||||
displayName: Daily Test Automation Run for FMG-NextGen
|
|
||||||
branches:
|
|
||||||
include:
|
|
||||||
- main
|
|
||||||
|
|
||||||
pool: 'AmazonLinuxPool'
|
pool: 'AmazonLinuxPool'
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
|
|
@ -50,10 +42,10 @@ stages:
|
||||||
container_id=$(docker create \
|
container_id=$(docker create \
|
||||||
--ipc=host \
|
--ipc=host \
|
||||||
-e CCIS_API_AUTH=$(CCIS_API_AUTH) \
|
-e CCIS_API_AUTH=$(CCIS_API_AUTH) \
|
||||||
-e BASE_URL=$(BASE_URL) \
|
-e BASE_URL="$(BASE_URL)" \
|
||||||
-e CCIS_API_URL=$(CCIS_API_URL) \
|
-e CCIS_API_URL=$(CCIS_API_URL) \
|
||||||
-e ADMIN_SERVICE_API_URL=$(ADMIN_SERVICE_API_URL) \
|
-e ADMIN_SERVICE_API_URL=$(ADMIN_SERVICE_API_URL) \
|
||||||
-e SHARD=$(shardNumber) \
|
-e SKIP_CONTENT_SITE=$(SKIP_CONTENT_SITE) \
|
||||||
-e CI=true \
|
-e CI=true \
|
||||||
-e NODE_ENV=$(NODE_ENV) \
|
-e NODE_ENV=$(NODE_ENV) \
|
||||||
$(dockerImageName):$(imageTag) \
|
$(dockerImageName):$(imageTag) \
|
||||||
|
|
@ -131,6 +123,7 @@ stages:
|
||||||
-e REPORT_NAME="$report_name" \
|
-e REPORT_NAME="$report_name" \
|
||||||
-e CURRENT_DAY="$current_day" \
|
-e CURRENT_DAY="$current_day" \
|
||||||
-e NUMERIC_DATE="$numeric_date" \
|
-e NUMERIC_DATE="$numeric_date" \
|
||||||
|
-e NODE_ENV=$(NODE_ENV) \
|
||||||
$(dockerImageName):$(imageTag) \
|
$(dockerImageName):$(imageTag) \
|
||||||
bash -c "chmod +x devops/scripts/jira_writeback.sh
|
bash -c "chmod +x devops/scripts/jira_writeback.sh
|
||||||
echo \"Moving Playwright reports out of subfolders...\"
|
echo \"Moving Playwright reports out of subfolders...\"
|
||||||
|
|
@ -151,7 +144,7 @@ stages:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo \"Writing report to Jira card '$jira_card_number'...\"
|
echo \"Writing report to Jira card '$jira_card_number'...\"
|
||||||
/app/devops/scripts/jira_writeback.sh add_comment \"$jira_card_number\" /app/ortoni-report/\${REPORT_NAME} \"AUTOMATED TEST RUN: $(date) - \${CURRENT_DAY} (\${NUMERIC_DATE})\" ")
|
/app/devops/scripts/jira_writeback.sh add_comment \"$jira_card_number\" /app/ortoni-report/\${REPORT_NAME} \"AUTOMATED TEST RUN: $(date) - \${CURRENT_DAY} (\${NUMERIC_DATE}) - Environment: \${NODE_ENV}\" ")
|
||||||
|
|
||||||
# Start container and stream logs
|
# Start container and stream logs
|
||||||
echo "Starting merge"
|
echo "Starting merge"
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ export function getCustomerDetails(): ICustomerDetails {
|
||||||
street: faker.location.streetAddress(),
|
street: faker.location.streetAddress(),
|
||||||
city: 'Columbus',
|
city: 'Columbus',
|
||||||
state: 'Ohio',
|
state: 'Ohio',
|
||||||
postalCode: '43215',
|
postalCode: '21237',
|
||||||
country: 'United States'
|
country: 'United States'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ export class ServiceLocationPage extends BasePage {
|
||||||
|
|
||||||
// For in-shop and drop off
|
// For in-shop and drop off
|
||||||
this.selectAShopOptions = this.page.locator('[class="shop-question"]');
|
this.selectAShopOptions = this.page.locator('[class="shop-question"]');
|
||||||
this.firstAppointmentButton = this.page.locator('div').filter({ hasText: /Appts/}).first();
|
this.firstAppointmentButton = this.page.locator('fieldset:has(legend#chooseShop)').locator('label').first();
|
||||||
this.changeZipButton = this.page.locator('a:has(span.sr-only:has-text("edit zip code"))');
|
this.changeZipButton = this.page.locator('a:has(span.sr-only:has-text("edit zip code"))');
|
||||||
this.updateZipTextBox = this.page.locator('#serviceZipCode');
|
this.updateZipTextBox = this.page.locator('#serviceZipCode');
|
||||||
this.saveZipButton = this.page.getByText('Save ZIP code', { exact: true });
|
this.saveZipButton = this.page.getByText('Save ZIP code', { exact: true });
|
||||||
|
|
@ -71,7 +71,7 @@ export class ServiceLocationPage extends BasePage {
|
||||||
this.vehicleProtectedYesButton = this.page.locator('label').filter({ hasText: 'Yes' }).locator('div');
|
this.vehicleProtectedYesButton = this.page.locator('label').filter({ hasText: 'Yes' }).locator('div');
|
||||||
this.vehicleProtectedNoButton = this.page.locator('label').filter({ hasText: 'No' }).locator('div');
|
this.vehicleProtectedNoButton = this.page.locator('label').filter({ hasText: 'No' }).locator('div');
|
||||||
this.saveAddressButton = this.page.getByRole('button', { name: 'Continue' })
|
this.saveAddressButton = this.page.getByRole('button', { name: 'Continue' })
|
||||||
this.repeatedClicksModalCloseButton = this.page.getByRole('img').nth(1);
|
this.repeatedClicksModalCloseButton = this.page.locator('.QSISlider').locator('img[src*=\'close\']');
|
||||||
}
|
}
|
||||||
|
|
||||||
async selectLocation(appointmentDetails: IAppointmentDetails){
|
async selectLocation(appointmentDetails: IAppointmentDetails){
|
||||||
|
|
@ -103,9 +103,14 @@ export class ServiceLocationPage extends BasePage {
|
||||||
await this.saveZipButton.click();
|
await this.saveZipButton.click();
|
||||||
}
|
}
|
||||||
await this.inShopButton.click();
|
await this.inShopButton.click();
|
||||||
await this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).check();
|
await this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).scrollIntoViewIfNeeded().then(() => this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).click());
|
||||||
} else {
|
} else {
|
||||||
await this.firstAppointmentButton.click();
|
await this.firstAppointmentButton.scrollIntoViewIfNeeded().then(async () => {
|
||||||
|
await this.firstAppointmentButton.click();
|
||||||
|
if (appointmentDetails) {
|
||||||
|
appointmentDetails.shopAddress = await this.firstAppointmentButton.locator('.row-two').innerText();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,9 +119,6 @@ export class ServiceLocationPage extends BasePage {
|
||||||
await this.mobileButton.click();
|
await this.mobileButton.click();
|
||||||
await this.enterServiceAddressButton.click();
|
await this.enterServiceAddressButton.click();
|
||||||
await this.addressForm.populateAddress({ address: appointmentDetails.serviceAddress! });
|
await this.addressForm.populateAddress({ address: appointmentDetails.serviceAddress! });
|
||||||
if (await this.repeatedClicksModalCloseButton.isVisible()) {
|
|
||||||
await this.repeatedClicksModalCloseButton.click();
|
|
||||||
}
|
|
||||||
if (faker.datatype.boolean()) {
|
if (faker.datatype.boolean()) {
|
||||||
await this.vehicleProtectedYesButton.check();
|
await this.vehicleProtectedYesButton.check();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -133,8 +135,13 @@ export class ServiceLocationPage extends BasePage {
|
||||||
if (appointmentDetails && appointmentDetails.shopAddress) {
|
if (appointmentDetails && appointmentDetails.shopAddress) {
|
||||||
await this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).check();
|
await this.selectAShopOptions.locator(`[buttonbodycopy="${appointmentDetails.shopAddress}"]`).check();
|
||||||
} else {
|
} else {
|
||||||
// await this.firstAppointmentButton.click();
|
/// await this.clickWithRetry(this.firstAppointmentButton, this.page);
|
||||||
await this.clickWithRetry(this.firstAppointmentButton, this.page);
|
await this.firstAppointmentButton.scrollIntoViewIfNeeded().then(async () => {
|
||||||
|
await this.firstAppointmentButton.click();
|
||||||
|
if (appointmentDetails) {
|
||||||
|
appointmentDetails.shopAddress = await this.firstAppointmentButton.locator('.row-two').innerText();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export class ServicePackagesPage extends BasePage {
|
||||||
this.closeButton = this.page. getByRole('dialog').locator('button').filter({ hasText: 'Close' });
|
this.closeButton = this.page. getByRole('dialog').locator('button').filter({ hasText: 'Close' });
|
||||||
this.promoCodeTextbox = this.page.getByLabel('Enter a promo code');
|
this.promoCodeTextbox = this.page.getByLabel('Enter a promo code');
|
||||||
this.applyPromoButton = this.page.getByRole('button', { name: 'Apply promo code' });
|
this.applyPromoButton = this.page.getByRole('button', { name: 'Apply promo code' });
|
||||||
this.repeatedClicksModalCloseButton = this.page.getByRole('img').nth(1);
|
this.repeatedClicksModalCloseButton = this.page.locator('.QSISlider').locator('img[src*=\'close\']');
|
||||||
|
|
||||||
// this.validateURL(this.url);
|
// this.validateURL(this.url);
|
||||||
}
|
}
|
||||||
|
|
@ -76,8 +76,8 @@ export class ServicePackagesPage extends BasePage {
|
||||||
if (await this.repeatedClicksModalCloseButton.isVisible()) {
|
if (await this.repeatedClicksModalCloseButton.isVisible()) {
|
||||||
await this.repeatedClicksModalCloseButton.click();
|
await this.repeatedClicksModalCloseButton.click();
|
||||||
}
|
}
|
||||||
|
await this.page.waitForTimeout(3000);
|
||||||
await this.closeButton.click();
|
await this.closeButton.click();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
await this.skipQuoteEmailButton.click();
|
await this.skipQuoteEmailButton.click();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,8 +192,8 @@ async function runWorkflow(page: Page, testCase: TestCase) {
|
||||||
|
|
||||||
//============================= TEST WORKFLOW STEPS =============================
|
//============================= TEST WORKFLOW STEPS =============================
|
||||||
|
|
||||||
// Execute home page for qa and dev environments (skip for sys)
|
// Use Environment Variable to decide whether or not we want to skip content site aka home page
|
||||||
if (process.env.NODE_ENV !== 'sys') {
|
if (process.env.SKIP_CONTENT_SITE == "false") {
|
||||||
await test.step('HomePage >> Lets Get Started', async () => {
|
await test.step('HomePage >> Lets Get Started', async () => {
|
||||||
let homePage = testCase.pages.homePage;
|
let homePage = testCase.pages.homePage;
|
||||||
console.log(`Customer for this test: ${customerDetails?.firstName} ${customerDetails?.lastName}`);
|
console.log(`Customer for this test: ${customerDetails?.firstName} ${customerDetails?.lastName}`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue