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

(refactor) e2e: Centralize types and improve type usage #1412

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

denniskigen
Copy link
Member

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

This PR centralizes type annotations used in e2e tests and improves type usage. Key changes include:

  • Adding the Playwright ESLint plugin to enforce best practices in e2e tests.
  • Moving test-specific types to a dedicated types file and importing them where needed.
  • Using consistent type imports in e2e tests.
  • Cleaning up eslint overrides for various test file types.

With these changes, e2e tests should be more consistent and easier to maintain.

Screenshots

Related Issue

Other

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Size Change: 0 B

Total Size: 7.18 MB

ℹ️ View Unchanged
Filename Size
packages/esm-active-visits-app/dist/106.js 8.63 kB
packages/esm-active-visits-app/dist/130.js 395 kB
packages/esm-active-visits-app/dist/136.js 65.6 kB
packages/esm-active-visits-app/dist/233.js 3.37 kB
packages/esm-active-visits-app/dist/236.js 614 B
packages/esm-active-visits-app/dist/240.js 615 B
packages/esm-active-visits-app/dist/261.js 615 B
packages/esm-active-visits-app/dist/271.js 805 B
packages/esm-active-visits-app/dist/272.js 615 B
packages/esm-active-visits-app/dist/316.js 42.9 kB
packages/esm-active-visits-app/dist/319.js 735 B
packages/esm-active-visits-app/dist/325.js 3.09 kB
packages/esm-active-visits-app/dist/336.js 614 B
packages/esm-active-visits-app/dist/378.js 731 B
packages/esm-active-visits-app/dist/443.js 6.98 kB
packages/esm-active-visits-app/dist/460.js 817 B
packages/esm-active-visits-app/dist/539.js 613 B
packages/esm-active-visits-app/dist/574.js 615 B
packages/esm-active-visits-app/dist/6.js 28 kB
packages/esm-active-visits-app/dist/644.js 800 B
packages/esm-active-visits-app/dist/652.js 615 B
packages/esm-active-visits-app/dist/673.js 615 B
packages/esm-active-visits-app/dist/705.js 615 B
packages/esm-active-visits-app/dist/711.js 615 B
packages/esm-active-visits-app/dist/725.js 647 B
packages/esm-active-visits-app/dist/727.js 615 B
packages/esm-active-visits-app/dist/737.js 615 B
packages/esm-active-visits-app/dist/744.js 843 B
packages/esm-active-visits-app/dist/757.js 731 B
packages/esm-active-visits-app/dist/784.js 2.63 kB
packages/esm-active-visits-app/dist/788.js 628 B
packages/esm-active-visits-app/dist/807.js 959 B
packages/esm-active-visits-app/dist/814.js 3.04 kB
packages/esm-active-visits-app/dist/833.js 765 B
packages/esm-active-visits-app/dist/879.js 3.02 kB
packages/esm-active-visits-app/dist/899.js 611 B
packages/esm-active-visits-app/dist/967.js 611 B
packages/esm-active-visits-app/dist/main.js 96 kB
packages/esm-active-visits-app/dist/openmrs-esm-active-visits-app.js 3.5 kB
packages/esm-appointments-app/dist/111.js 10.6 kB
packages/esm-appointments-app/dist/123.js 272 kB
packages/esm-appointments-app/dist/130.js 395 kB
packages/esm-appointments-app/dist/171.js 223 B
packages/esm-appointments-app/dist/2.js 2.23 kB
packages/esm-appointments-app/dist/228.js 2.05 kB
packages/esm-appointments-app/dist/236.js 2.05 kB
packages/esm-appointments-app/dist/240.js 2.05 kB
packages/esm-appointments-app/dist/261.js 2.05 kB
packages/esm-appointments-app/dist/265.js 1.79 kB
packages/esm-appointments-app/dist/269.js 7.66 kB
packages/esm-appointments-app/dist/271.js 2.44 kB
packages/esm-appointments-app/dist/272.js 2.05 kB
packages/esm-appointments-app/dist/319.js 2.32 kB
packages/esm-appointments-app/dist/325.js 3.08 kB
packages/esm-appointments-app/dist/336.js 2.05 kB
packages/esm-appointments-app/dist/372.js 2.57 kB
packages/esm-appointments-app/dist/378.js 2.3 kB
packages/esm-appointments-app/dist/443.js 6.97 kB
packages/esm-appointments-app/dist/460.js 2.49 kB
packages/esm-appointments-app/dist/539.js 2.05 kB
packages/esm-appointments-app/dist/574.js 2.05 kB
packages/esm-appointments-app/dist/581.js 9.03 kB
packages/esm-appointments-app/dist/591.js 16.8 kB
packages/esm-appointments-app/dist/644.js 2.44 kB
packages/esm-appointments-app/dist/652.js 2.05 kB
packages/esm-appointments-app/dist/673.js 2.05 kB
packages/esm-appointments-app/dist/705.js 2.05 kB
packages/esm-appointments-app/dist/711.js 129 kB
packages/esm-appointments-app/dist/727.js 2.05 kB
packages/esm-appointments-app/dist/737.js 2.05 kB
packages/esm-appointments-app/dist/744.js 2.58 kB
packages/esm-appointments-app/dist/757.js 2.44 kB
packages/esm-appointments-app/dist/775.js 36.2 kB
packages/esm-appointments-app/dist/784.js 2.62 kB
packages/esm-appointments-app/dist/788.js 2.05 kB
packages/esm-appointments-app/dist/807.js 2.67 kB
packages/esm-appointments-app/dist/833.js 2.37 kB
packages/esm-appointments-app/dist/899.js 2.04 kB
packages/esm-appointments-app/dist/903.js 864 B
packages/esm-appointments-app/dist/main.js 413 kB
packages/esm-appointments-app/dist/openmrs-esm-appointments-app.js 3.56 kB
packages/esm-bed-management-app/dist/130.js 395 kB
packages/esm-bed-management-app/dist/148.js 1.37 kB
packages/esm-bed-management-app/dist/205.js 50.7 kB
packages/esm-bed-management-app/dist/236.js 793 B
packages/esm-bed-management-app/dist/240.js 793 B
packages/esm-bed-management-app/dist/261.js 794 B
packages/esm-bed-management-app/dist/271.js 793 B
packages/esm-bed-management-app/dist/272.js 794 B
packages/esm-bed-management-app/dist/319.js 908 B
packages/esm-bed-management-app/dist/325.js 3.09 kB
packages/esm-bed-management-app/dist/336.js 794 B
packages/esm-bed-management-app/dist/378.js 937 B
packages/esm-bed-management-app/dist/443.js 6.97 kB
packages/esm-bed-management-app/dist/460.js 892 B
packages/esm-bed-management-app/dist/539.js 793 B
packages/esm-bed-management-app/dist/542.js 396 B
packages/esm-bed-management-app/dist/574.js 794 B
packages/esm-bed-management-app/dist/591.js 16.8 kB
packages/esm-bed-management-app/dist/644.js 794 B
packages/esm-bed-management-app/dist/652.js 794 B
packages/esm-bed-management-app/dist/673.js 795 B
packages/esm-bed-management-app/dist/705.js 794 B
packages/esm-bed-management-app/dist/711.js 794 B
packages/esm-bed-management-app/dist/727.js 794 B
packages/esm-bed-management-app/dist/737.js 794 B
packages/esm-bed-management-app/dist/744.js 1.01 kB
packages/esm-bed-management-app/dist/746.js 125 kB
packages/esm-bed-management-app/dist/757.js 939 B
packages/esm-bed-management-app/dist/768.js 26.5 kB
packages/esm-bed-management-app/dist/784.js 2.63 kB
packages/esm-bed-management-app/dist/788.js 793 B
packages/esm-bed-management-app/dist/807.js 793 B
packages/esm-bed-management-app/dist/833.js 957 B
packages/esm-bed-management-app/dist/899.js 792 B
packages/esm-bed-management-app/dist/main.js 4.19 kB
packages/esm-bed-management-app/dist/openmrs-esm-bed-management-app.js 3.43 kB
packages/esm-patient-list-management-app/dist/130.js 395 kB
packages/esm-patient-list-management-app/dist/233.js 3.38 kB
packages/esm-patient-list-management-app/dist/236.js 1.34 kB
packages/esm-patient-list-management-app/dist/240.js 1.34 kB
packages/esm-patient-list-management-app/dist/261.js 1.34 kB
packages/esm-patient-list-management-app/dist/271.js 1.6 kB
packages/esm-patient-list-management-app/dist/272.js 1.34 kB
packages/esm-patient-list-management-app/dist/319.js 1.52 kB
packages/esm-patient-list-management-app/dist/325.js 3.09 kB
packages/esm-patient-list-management-app/dist/336.js 1.34 kB
packages/esm-patient-list-management-app/dist/37.js 12.5 kB
packages/esm-patient-list-management-app/dist/378.js 1.55 kB
packages/esm-patient-list-management-app/dist/443.js 6.98 kB
packages/esm-patient-list-management-app/dist/460.js 1.71 kB
packages/esm-patient-list-management-app/dist/539.js 1.34 kB
packages/esm-patient-list-management-app/dist/548.js 58.5 kB
packages/esm-patient-list-management-app/dist/574.js 1.34 kB
packages/esm-patient-list-management-app/dist/591.js 16.9 kB
packages/esm-patient-list-management-app/dist/644.js 1.6 kB
packages/esm-patient-list-management-app/dist/652.js 1.34 kB
packages/esm-patient-list-management-app/dist/673.js 1.34 kB
packages/esm-patient-list-management-app/dist/705.js 1.34 kB
packages/esm-patient-list-management-app/dist/711.js 1.34 kB
packages/esm-patient-list-management-app/dist/727.js 1.34 kB
packages/esm-patient-list-management-app/dist/737.js 1.34 kB
packages/esm-patient-list-management-app/dist/744.js 1.72 kB
packages/esm-patient-list-management-app/dist/757.js 1.64 kB
packages/esm-patient-list-management-app/dist/784.js 2.63 kB
packages/esm-patient-list-management-app/dist/788.js 1.34 kB
packages/esm-patient-list-management-app/dist/807.js 1.83 kB
packages/esm-patient-list-management-app/dist/814.js 3.05 kB
packages/esm-patient-list-management-app/dist/833.js 1.6 kB
packages/esm-patient-list-management-app/dist/899.js 1.34 kB
packages/esm-patient-list-management-app/dist/900.js 115 kB
packages/esm-patient-list-management-app/dist/main.js 176 kB
packages/esm-patient-list-management-app/dist/openmrs-esm-patient-list-management-app.js 3.48 kB
packages/esm-patient-registration-app/dist/130.js 395 kB
packages/esm-patient-registration-app/dist/169.js 6.71 kB
packages/esm-patient-registration-app/dist/2.js 2.24 kB
packages/esm-patient-registration-app/dist/236.js 2.12 kB
packages/esm-patient-registration-app/dist/240.js 2.12 kB
packages/esm-patient-registration-app/dist/250.js 526 B
packages/esm-patient-registration-app/dist/261.js 2.12 kB
packages/esm-patient-registration-app/dist/271.js 2.51 kB
packages/esm-patient-registration-app/dist/272.js 2.12 kB
packages/esm-patient-registration-app/dist/319.js 2.43 kB
packages/esm-patient-registration-app/dist/325.js 3.09 kB
packages/esm-patient-registration-app/dist/336.js 2.12 kB
packages/esm-patient-registration-app/dist/371.js 547 B
packages/esm-patient-registration-app/dist/372.js 2.57 kB
packages/esm-patient-registration-app/dist/378.js 2.37 kB
packages/esm-patient-registration-app/dist/46.js 133 kB
packages/esm-patient-registration-app/dist/460.js 2.51 kB
packages/esm-patient-registration-app/dist/501.js 7.03 kB
packages/esm-patient-registration-app/dist/539.js 2.12 kB
packages/esm-patient-registration-app/dist/574.js 2.12 kB
packages/esm-patient-registration-app/dist/591.js 16.8 kB
packages/esm-patient-registration-app/dist/644.js 2.51 kB
packages/esm-patient-registration-app/dist/652.js 2.12 kB
packages/esm-patient-registration-app/dist/662.js 453 B
packages/esm-patient-registration-app/dist/673.js 2.12 kB
packages/esm-patient-registration-app/dist/705.js 2.12 kB
packages/esm-patient-registration-app/dist/711.js 2.12 kB
packages/esm-patient-registration-app/dist/727.js 2.12 kB
packages/esm-patient-registration-app/dist/737.js 2.12 kB
packages/esm-patient-registration-app/dist/744.js 2.56 kB
packages/esm-patient-registration-app/dist/745.js 71.5 kB
packages/esm-patient-registration-app/dist/757.js 2.54 kB
packages/esm-patient-registration-app/dist/784.js 2.63 kB
packages/esm-patient-registration-app/dist/788.js 2.12 kB
packages/esm-patient-registration-app/dist/807.js 2.74 kB
packages/esm-patient-registration-app/dist/833.js 2.39 kB
packages/esm-patient-registration-app/dist/879.js 3.03 kB
packages/esm-patient-registration-app/dist/899.js 2.12 kB
packages/esm-patient-registration-app/dist/main.js 205 kB
packages/esm-patient-registration-app/dist/openmrs-esm-patient-registration-app.js 3.52 kB
packages/esm-patient-search-app/dist/130.js 395 kB
packages/esm-patient-search-app/dist/2.js 2.23 kB
packages/esm-patient-search-app/dist/233.js 3.37 kB
packages/esm-patient-search-app/dist/236.js 936 B
packages/esm-patient-search-app/dist/240.js 937 B
packages/esm-patient-search-app/dist/261.js 937 B
packages/esm-patient-search-app/dist/271.js 1.14 kB
packages/esm-patient-search-app/dist/272.js 937 B
packages/esm-patient-search-app/dist/319.js 1.07 kB
packages/esm-patient-search-app/dist/325.js 3.09 kB
packages/esm-patient-search-app/dist/336.js 936 B
packages/esm-patient-search-app/dist/372.js 2.57 kB
packages/esm-patient-search-app/dist/378.js 1.1 kB
packages/esm-patient-search-app/dist/443.js 6.98 kB
packages/esm-patient-search-app/dist/460.js 1.16 kB
packages/esm-patient-search-app/dist/51.js 105 kB
packages/esm-patient-search-app/dist/539.js 935 B
packages/esm-patient-search-app/dist/574.js 937 B
packages/esm-patient-search-app/dist/591.js 16.8 kB
packages/esm-patient-search-app/dist/644.js 1.14 kB
packages/esm-patient-search-app/dist/652.js 937 B
packages/esm-patient-search-app/dist/673.js 937 B
packages/esm-patient-search-app/dist/705.js 937 B
packages/esm-patient-search-app/dist/711.js 937 B
packages/esm-patient-search-app/dist/727.js 936 B
packages/esm-patient-search-app/dist/737.js 936 B
packages/esm-patient-search-app/dist/744.js 1.17 kB
packages/esm-patient-search-app/dist/750.js 60.8 kB
packages/esm-patient-search-app/dist/757.js 1.15 kB
packages/esm-patient-search-app/dist/784.js 2.63 kB
packages/esm-patient-search-app/dist/788.js 933 B
packages/esm-patient-search-app/dist/807.js 1.23 kB
packages/esm-patient-search-app/dist/814.js 3.05 kB
packages/esm-patient-search-app/dist/833.js 1.1 kB
packages/esm-patient-search-app/dist/899.js 933 B
packages/esm-patient-search-app/dist/main.js 167 kB
packages/esm-patient-search-app/dist/openmrs-esm-patient-search-app.js 3.51 kB
packages/esm-service-queues-app/dist/1006.js 1.75 kB
packages/esm-service-queues-app/dist/1060.js 1.82 kB
packages/esm-service-queues-app/dist/130.js 395 kB
packages/esm-service-queues-app/dist/1325.js 3.09 kB
packages/esm-service-queues-app/dist/1644.js 3.66 kB
packages/esm-service-queues-app/dist/1727.js 8.12 kB
packages/esm-service-queues-app/dist/1800.js 1.68 kB
packages/esm-service-queues-app/dist/2.js 2.23 kB
packages/esm-service-queues-app/dist/236.js 3.05 kB
packages/esm-service-queues-app/dist/2757.js 3.76 kB
packages/esm-service-queues-app/dist/2760.js 7.31 kB
packages/esm-service-queues-app/dist/2784.js 2.62 kB
packages/esm-service-queues-app/dist/3199.js 1.36 kB
packages/esm-service-queues-app/dist/3372.js 2.57 kB
packages/esm-service-queues-app/dist/3574.js 3.03 kB
packages/esm-service-queues-app/dist/3604.js 6.96 kB
packages/esm-service-queues-app/dist/3652.js 3.05 kB
packages/esm-service-queues-app/dist/3818.js 2.56 kB
packages/esm-service-queues-app/dist/3828.js 1.38 kB
packages/esm-service-queues-app/dist/4272.js 3.05 kB
packages/esm-service-queues-app/dist/4378.js 3.5 kB
packages/esm-service-queues-app/dist/443.js 6.98 kB
packages/esm-service-queues-app/dist/4460.js 3.81 kB
packages/esm-service-queues-app/dist/4705.js 3.05 kB
packages/esm-service-queues-app/dist/4911.js 7.76 kB
packages/esm-service-queues-app/dist/5236.js 5.98 kB
packages/esm-service-queues-app/dist/5240.js 3.04 kB
packages/esm-service-queues-app/dist/5282.js 9.12 kB
packages/esm-service-queues-app/dist/5336.js 3.05 kB
packages/esm-service-queues-app/dist/539.js 3.05 kB
packages/esm-service-queues-app/dist/5673.js 3.05 kB
packages/esm-service-queues-app/dist/5711.js 3.05 kB
packages/esm-service-queues-app/dist/5737.js 3.05 kB
packages/esm-service-queues-app/dist/5833.js 3.59 kB
packages/esm-service-queues-app/dist/6578.js 179 kB
packages/esm-service-queues-app/dist/6591.js 16.8 kB
packages/esm-service-queues-app/dist/6670.js 10.1 kB
packages/esm-service-queues-app/dist/6727.js 3.05 kB
packages/esm-service-queues-app/dist/744.js 3.76 kB
packages/esm-service-queues-app/dist/752.js 1.62 kB
packages/esm-service-queues-app/dist/7807.js 4.07 kB
packages/esm-service-queues-app/dist/8271.js 3.66 kB
packages/esm-service-queues-app/dist/8319.js 3.47 kB
packages/esm-service-queues-app/dist/8788.js 3.06 kB
packages/esm-service-queues-app/dist/899.js 3.05 kB
packages/esm-service-queues-app/dist/9261.js 3.05 kB
packages/esm-service-queues-app/dist/9392.js 7.84 kB
packages/esm-service-queues-app/dist/940.js 21.4 kB
packages/esm-service-queues-app/dist/9993.js 96.8 kB
packages/esm-service-queues-app/dist/main.js 277 kB
packages/esm-service-queues-app/dist/openmrs-esm-service-queues-app.js 3.48 kB
packages/esm-ward-app/dist/109.js 350 B
packages/esm-ward-app/dist/124.js 3.68 kB
packages/esm-ward-app/dist/125.js 5.87 kB
packages/esm-ward-app/dist/126.js 9.69 kB
packages/esm-ward-app/dist/130.js 395 kB
packages/esm-ward-app/dist/146.js 2.13 kB
packages/esm-ward-app/dist/15.js 480 B
packages/esm-ward-app/dist/325.js 3.08 kB
packages/esm-ward-app/dist/348.js 349 B
packages/esm-ward-app/dist/362.js 476 B
packages/esm-ward-app/dist/372.js 2.56 kB
packages/esm-ward-app/dist/443.js 6.97 kB
packages/esm-ward-app/dist/471.js 6.86 kB
packages/esm-ward-app/dist/481.js 1.25 kB
packages/esm-ward-app/dist/53.js 12.2 kB
packages/esm-ward-app/dist/55.js 628 B
packages/esm-ward-app/dist/559.js 342 B
packages/esm-ward-app/dist/574.js 1.63 kB
packages/esm-ward-app/dist/576.js 6.03 kB
packages/esm-ward-app/dist/577.js 17.7 kB
packages/esm-ward-app/dist/591.js 16.8 kB
packages/esm-ward-app/dist/598.js 35.7 kB
packages/esm-ward-app/dist/649.js 2.51 kB
packages/esm-ward-app/dist/662.js 11.1 kB
packages/esm-ward-app/dist/767.js 648 B
packages/esm-ward-app/dist/784.js 2.62 kB
packages/esm-ward-app/dist/921.js 6.09 kB
packages/esm-ward-app/dist/922.js 9.04 kB
packages/esm-ward-app/dist/925.js 90.9 kB
packages/esm-ward-app/dist/940.js 21.4 kB
packages/esm-ward-app/dist/969.js 202 B
packages/esm-ward-app/dist/main.js 98.5 kB
packages/esm-ward-app/dist/openmrs-esm-ward-app.js 3.46 kB

compressed-size-action

This PR centralizes type annotations used in e2e tests and improves type usage. Key changes include:

- Adding the Playwright ESLint plugin to enforce best practices in e2e tests.
- Moving test-specific types to a dedicated types file and importing them where needed.
- Using consistent type imports in e2e tests.
- Cleaning up eslint overrides for various test file types.

With these changes, e2e tests should be more consistent and easier to maintain.
Copy link
Contributor

@chibongho chibongho left a comment

Choose a reason for hiding this comment

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

I'm not familiar with the lint stuff, but the type refactoring looks great!

Comment on lines +6 to +16
"overrides": [
{
"files": ["**/*.test.tsx"],
"extends": ["plugin:testing-library/react"]
},
{
"files": ["e2e/**/*.spec.ts"],
"extends": ["plugin:playwright/recommended"],
"rules": {
"testing-library/prefer-screen-queries": "off"
}
Copy link
Member

Choose a reason for hiding this comment

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

Nice!

@ibacher ibacher merged commit 0f398b5 into main Dec 13, 2024
8 checks passed
@ibacher ibacher deleted the refactor/e2e branch December 13, 2024 16:17
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