Skip to content

test(datetime): migrate tests to playwright #25400

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

Merged
merged 53 commits into from
Jun 7, 2022
Merged

test(datetime): migrate tests to playwright #25400

merged 53 commits into from
Jun 7, 2022

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Jun 3, 2022

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
    • Some docs updates need to be made in the ionic-docs repo, in a separate PR. See the contributing guide for details.
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue URL: N/A

What is the new behavior?

  • Sean mentioned that he would migrate the locale tests in feat(datetime): localize am/pm labels in time picker #25389, so I did not migrate them in mine.
  • I removed the isDateEnabled test that checks to see if the console.error is logged as it was flaky across browsers (the listener was being added after the error was already logged). If you have alternative testing thoughts let me know!
  • I removed the "values" tests as they were redundant.
  • The datetimeMonthDidChange event is now dispatched on the window instead of the document. Our custom spyOnEvent only listens on the window at the moment. The effort to update this does not seem worth it at the moment.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Jun 3, 2022
@liamdebeasi liamdebeasi marked this pull request as ready for review June 3, 2022 18:10
@liamdebeasi liamdebeasi requested a review from a team June 3, 2022 18:10
@averyjohnston
Copy link
Contributor

I think you'll need to set the values to be something in May or sooner, so the datetimes show that month instead of the current one. Otherwise, the circle around today's date will change from day to day and cause screenshot mismatches.

@liamdebeasi
Copy link
Contributor Author

Fixed, thanks!

@averyjohnston
Copy link
Contributor

Looks like some of the screenshots are still showing June, core/src/components/datetime/test/basic/datetime.e2e.ts-snapshots/datetime-footer-clear-button-ios-ltr-Mobile-Chrome-linux.png at least 🤔

@liamdebeasi
Copy link
Contributor Author

Ok now it should be good. When I re-ran screenshots, I did not delete the old screenshots first. There may not have been a high enough pixel difference for certain screenshots causing them to not get updated.

@averyjohnston
Copy link
Contributor

The screenshots for the footer tests are still showing June; maybe the screenshot job isn't looking at the right commit? 🤔 There might be other tests like that, I haven't looked.

@liamdebeasi
Copy link
Contributor Author

🤦 I only deleted screenshots for the color test. Let me try this again...

Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

Nice work! 👍

@liamdebeasi liamdebeasi merged commit 5a606de into main Jun 7, 2022
@liamdebeasi liamdebeasi deleted the FW-1202 branch June 7, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants