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

O3-2413: (test) Setup playwright for automated tests in Fast Data Entry App #88

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

dilankavishka
Copy link
Contributor

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide.
  • My work includes tests or is validated by existing tests.

Summary

This PR is for setting up the fast data entry app for end-to-end testing.

Screenshots

Related Issue

https://openmrs.atlassian.net/browse/O3-2413

Other

@dilankavishka
Copy link
Contributor Author

@jayasanka-sack , @NethmiRodrigo Can you review this please?

Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

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

Found this in the failed build:

➤ YN0028: The lockfile would have been modified by this install, which is explicitly forbidden.

Run yarn install locally and push changes to avoid the error message

Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @dilankavishka ! I've left some comments, have a look when you are free. Also you need to update the jest config file as well, check this PR: openmrs/openmrs-esm-stock-management#231

e2e/README.md Outdated Show resolved Hide resolved
.github/workflows/e2e.yml Outdated Show resolved Hide resolved
tests-examples/demo-todo-app.spec.ts Outdated Show resolved Hide resolved
@dilankavishka
Copy link
Contributor Author

@jayasanka-sack made the changes and need to write a small test for this.

Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

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

Great! Include a very basic test for this PR and that would be enough. Ex the fast data entry app loads properly (just check only the title)

await requestContext.dispose();
}

export default globalSetup;
Copy link
Member

Choose a reason for hiding this comment

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

package.json Outdated Show resolved Hide resolved
Comment on lines 14 to +22
"moduleNameMapper": {
"\\.(s?css)$": "identity-obj-proxy",
"@openmrs/esm-framework": "@openmrs/esm-framework/mock",
"\\.(s?css)$": "identity-obj-proxy",
"^lodash-es/(.*)$": "lodash/$1",
"^uuid$": "<rootDir>/node_modules/uuid/dist/index.js",
"^lodash-es$": "lodash",
"^dexie$": "<rootDir>/node_modules/dexie",
"lodash-es": "lodash"
"^react-i18next$": "<rootDir>/__mocks__/react-i18next.js"
},
"setupFilesAfterEnv": [
"<rootDir>/src/setup-tests.ts"
],
"setupFilesAfterEnv": ["<rootDir>/src/setup-tests.ts"],
Copy link
Member

Choose a reason for hiding this comment

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

Include changes that are only relevant to E2E tests.

@dilankavishka
Copy link
Contributor Author

@jayasanka-sack , while i'm trying to write an example test i have some challenges:

Screenshot 2024-12-31 at 12 07 55

after give yarn test-e2e --headed it's shows an error like this.

  1. here is the page.ts
Screenshot 2024-12-31 at 12 08 11
  1. here is the specs.ts
Screenshot 2024-12-31 at 12 08 15

Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

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

@dilankavishka Seems like you are not running the server or haven't copied the environment variables file (or both). Check this doc:
https://openmrs.atlassian.net/wiki/spaces/docs/pages/150962731/Testing+Frontend+Modules+O3#Running-tests

Copy link
Member

@jayasanka-sack jayasanka-sack left a comment

Choose a reason for hiding this comment

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

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.

2 participants