Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mntor-3138-1 - Simple paypal tests fix. Merged with e2e-slack-integration-and-CI-fixes #4646

Merged
merged 5 commits into from
Jun 10, 2024

Conversation

mozilloid
Copy link
Contributor

References:

Jira: -
Figma:

Description

Fixed the paypal tests.

Screenshot (if applicable)

Not applicable.

How to test

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments
  • I've added a unit test to test for potential regressions of this bug.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

Copy link

github-actions bot commented Jun 8, 2024

@@ -82,8 +82,7 @@ export class PurchasePage {
await this.paypalButton.click();
const newPage = await pagePromise;
await newPage.waitForLoadState();
await newPage.waitForURL(/.*paypal\.com.*\/checkout.*/);

await newPage.waitForURL(/.*paypal\.com.*checkout.*/);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change, and do we still need a slash after the domain?

ie: /paypal\.com\/.*checkout/

Also, what is the URL that we need the .* in the middle?
I tried signing up for VPN (in Canada) using SubPlat+PayPal and it gave me something like this URL:

https://www.paypal.com/checkoutnow?sessionID=qwerty

Curious if the domain is very different in staging that we can't simplify the RegExp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for some reason the links are different on firefox vs chrome when testing. I believe for firefox, it has 'intent=checkout' instead of '/checkout' so this regex captures it.

@@ -72,18 +72,15 @@ test.describe(`${process.env.E2E_TEST_ENV} - Breach Scan, Monitor Plus Purchase
// fill out subscription payment
await purchasePage.authorizationCheckbox.check();
await purchasePage.fillOutStripeCardInfo();
await purchasePage.payNowButton.click();
await purchasePage.payNowButton.click({ force: true });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why does this need { force: true }?
https://www.bondaracademy.com/blog/do-not-force-playwright

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is from the code I merged from rafee's pr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into a flaky test once where the button was clicked/selected but nothing happened, thought this might help 🤷

Copy link
Contributor

@rafeerahman rafeerahman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mozilloid mozilloid marked this pull request as ready for review June 10, 2024 16:03
@mozilloid mozilloid merged commit 76af752 into main Jun 10, 2024
14 of 15 checks passed
@mozilloid mozilloid deleted the mntor-3138-1 branch June 10, 2024 16:07
Copy link

Cleanup completed - database 'blurts-server-pr-4646' destroyed, cloud run service 'blurts-server-pr-4646' destroyed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants