-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
packages/ontario-frontend-cli/resources/templates/ontario-create-app/package.njk
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Syed!
This is fantastic work, great job capturing all the different kinds of tests (unit, E2E, Integration).
I've left some general feedback that may be helpful. Let me know if you have any questions / want to chat further.
Thanks!
packages/ontario-frontend-cli/resources/templates/ontario-create-app/gitignore.njk
Outdated
Show resolved
Hide resolved
.../ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/localization.spec.njk
Outdated
Show resolved
Hide resolved
...es/ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/nightwatch.conf.njk
Outdated
Show resolved
Hide resolved
packages/ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/search.spec.njk
Outdated
Show resolved
Hide resolved
...ario-frontend-cli/resources/templates/ontario-create-app/tests/integration/packages.spec.njk
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on implementing the tests and configurations! The structure is clear, and the use of helper functions enhances readability and maintainability. Here are some key points and suggestions:
- Environment Variables: Ensure all required environment variables are set and provide clear error messages if they are not.
- Helper Functions: Improve error handling and add detailed logs to assist with debugging.
- Test Cases: Add edge cases and more comprehensive checks to ensure robustness.
- Documentation: Update comments and instructions to guide future updates and changes.
Overall, your implementation is solid, with minor enhancements needed for error handling and edge cases. Keep up the good work!
packages/ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/prompt.spec.njk
Show resolved
Hide resolved
.../ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/localization.spec.njk
Show resolved
Hide resolved
.../ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/localization.spec.njk
Outdated
Show resolved
Hide resolved
.../ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/localization.spec.njk
Outdated
Show resolved
Hide resolved
.../ontario-frontend-cli/resources/templates/ontario-create-app/tests/e2e/localization.spec.njk
Outdated
Show resolved
Hide resolved
...ario-frontend-cli/resources/templates/ontario-create-app/tests/integration/packages.spec.njk
Outdated
Show resolved
Hide resolved
...ario-frontend-cli/resources/templates/ontario-create-app/tests/integration/packages.spec.njk
Outdated
Show resolved
Hide resolved
...ario-frontend-cli/resources/templates/ontario-create-app/tests/integration/packages.spec.njk
Outdated
Show resolved
Hide resolved
packages/ontario-frontend-cli/resources/templates/ontario-create-app/tests/unit/app.spec.njk
Outdated
Show resolved
Hide resolved
packages/ontario-frontend-cli/resources/templates/ontario-create-app/tests/unit/app.spec.njk
Outdated
Show resolved
Hide resolved
@matt-stjean I'm thinking of making Microsoft Edge as the default browsers for e2e tests. That's because I tried uninstalling Chrome and run the tests but Nightwatch was unable to run the tests. I also tried installing specific webdrivers for each browser. It seems like an MVP idea to keep one browser only and mention the details in our developer documentation. |
Chrome is installed on every OPS machine, though, I don’t think we need to handle a case where Chrome is not installed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your work Syed
Please keep this PR open until all tests have been added and approved.
Unit tests:
Integration tests:
ontario-frontend
NPM package exists.E2E tests:
Test Prototypes:
https://github.com/syed-ods/on-frontend-test-prototypes
Acceptance Criteria
Unit Tests "{new-project}/src/tests/_unit/app.spec.js"
ontario-create-app
. They should then be able to runnpm test
ornpm run test
from their project.npm test
should pass these two tests.Integration Tests "{new-project}/src/tests/integration/packages.spec.js"
npm test
from a newly created project should run the integration tests.src/tests/integration/packages.spec.js
should capture the ESLint and Prettier user selection.ontario-frontend
is uninstalled, the test for required packages should fail.E2E Tests "{new-project}/src/tests/e2e"
nightwatch.conf.js
file..env
and a.gitignore
file.npm run test:e2e
should install the required node packages if not installed previously.E2E_URL
in the.env
file.npm run test:e2e
should run the localization e2e test with appropriate CLI feedback.npm run test:e2e
should also be able to run with the--url
flag, where the users can pass a custom URL to test. Example usage =npm run test:e2e --url=https://www.ontario.ca/international-trade-events-calendar
.Next step
src/tests/integration/packages.spec.js
should update accordingly, or the user should be provide appropriate feedback to update those variables.