Skip to content

Commit

Permalink
Merge pull request #621 from adobecom/mwpw-144463-geo-ip-phone-number
Browse files Browse the repository at this point in the history
MWPW-144463 Added E2E test geo ip phone number
  • Loading branch information
TsayAdobe authored Apr 9, 2024
2 parents 176727f + 398aed6 commit f9bf73c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/e2e/features/smoke/phoneNumber.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: Phone number test
@MWPW-144460 @smoke @geo-phoneNumber
Scenario Outline: Geo IP phone number
Given I go to the DC page '<urlPath>'
Then I wait for 2 seconds
Then I record phone number on the page
Then I go to the page "<urlPath>" with geo-ip spoof "<countryCode>"
Then I wait for 2 seconds
Then I confirm phone number is different and has geo-ip value "<geoIpPhoneNumber>"


Examples:
| urlPath | countryCode | geoIpPhoneNumber |
| acrobat/business/resources/it-tools.html | fr | +33 (800) 12457-1241 |
| acrobat/business/resources/it-tools.html | de | +49 (800) 12457-1241 |
17 changes: 17 additions & 0 deletions test/e2e/step-definitions/dc.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,20 @@ Then(/^I switch to the new page$/, async function () {
await newPage.bringToFront();
this.page.native = newPage;
})

Then(/^I record phone number on the page$/, async function () {
this.phoneNumber = await this.page.native.locator("a[daa-ll^='Device Phone']").textContent();
console.log("Phone number without geo-ip:", this.phoneNumber);
})

Then(/^I go to the page "([^"]*)" with geo-ip spoof "([^"]*)"$/, async function (pageUrl, akamaiLocale) {
this.page = new DCPage(pageUrl + '?akamaiLocale=' + akamaiLocale);
await this.page.open();
})

Then(/^I confirm phone number is different and has geo-ip value "([^"]*)"$/, async function (geoIpPhoneNumberValue) {
const geoIpPhoneNumber = await this.page.native.locator("a[daa-ll^='Device Phone']").textContent();
console.log("Phone number with geo-ip:", geoIpPhoneNumber);
expect(this.phoneNumber).not.toEqual(geoIpPhoneNumber);
expect(geoIpPhoneNumber).toEqual(geoIpPhoneNumberValue);
})

0 comments on commit f9bf73c

Please sign in to comment.