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

test(all): add await to relevant assertions #25527

Merged
merged 15 commits into from
Jun 24, 2022
Merged

Conversation

liamdebeasi
Copy link
Contributor

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?

Many of our assertions do not have the appropriate await causing certain test to be flaky. This is most often seen with focus tests where we need to test focus multiple times in a single test.

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the package: core @ionic/core package label Jun 23, 2022
@liamdebeasi liamdebeasi marked this pull request as ready for review June 23, 2022 19:40
@liamdebeasi liamdebeasi requested a review from a team as a code owner June 23, 2022 19:40
@@ -3,40 +3,36 @@ import { test, Viewports } from '@utils/test/playwright';
import type { E2EPage } from '@utils/test/playwright';

test.describe('modal: focus trapping', () => {
test.beforeEach(async ({ browserName }, testInfo) => {
test.skip(testInfo.project.metadata.rtl === true, 'This does not test LTR vs. RTL layout.');
test.skip(browserName === 'firefox', 'Firefox incorrectly allows keyboard focus to move to ion-content');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was flaky before, but now that we have the await in place it was failing more often. This appears to be a Firefox bug

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.

Great discovery that these needed to be awaited.

@averyjohnston
Copy link
Contributor

Was the empty file at core/src/components/action-sheet/test/action-sheet.fixture.e2e.ts an intentional add? Should something be there?

@liamdebeasi
Copy link
Contributor Author

That was for something I was testing, but I forgot to remove the file. It's been removed now.

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.

3 participants