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

CWU CRUD Gov User Cypress Test #126

Merged
merged 32 commits into from
Jan 17, 2022
Merged

CWU CRUD Gov User Cypress Test #126

merged 32 commits into from
Jan 17, 2022

Conversation

BCerki
Copy link
Collaborator

@BCerki BCerki commented Jan 12, 2022

This PR addresses issue: #125 (test script I refer to below is in this issue)

Includes tests? y
Rebased on main address to conflicts? y
Updated docs? n/a

Proposed changes:

  • add test for the creation and reading of a cwu by a gov user
  • add test for the update and delete of cwu by a gov user
  • switch sonarcloud from autoanalysis to CI analysis so that we have more control over the scanning of test files

Additional notes:

  • I adapted the previous existing test into a test that creates and publishes (instead of saving a draft)
  • Testing cwu opportunity suspension wasn't on the script--I think we forgot it, so I included here as part of delete
  • You'll see this error in the github action logs: [mailer] Unable to send email subject="A Code With Us Opportunity Has Been Cancelled" . This happens because in development, the site uses gmail to test transactional emails in development. I gave it some fake gmail credentials because we don't care about the emails here.

@BCerki BCerki force-pushed the 125-CWU-gov branch 2 times, most recently from 2cfca31 to 8878b77 Compare January 12, 2022 23:52
@BCerki BCerki marked this pull request as ready for review January 13, 2022 19:00
@wenzowski
Copy link

wenzowski commented Jan 13, 2022

in development, the site uses gmail to test transactional emails in development

Highly recommend using Mailhog in ci/dev/test to create a fully functional smtp endpoint. Here's a good helm chart for Mailhog.

@wenzowski
Copy link

wenzowski commented Jan 14, 2022

In order to exclude Cypress tests from the Quality Gate on Sonar (a good idea because by definition end-to-end tests are verbose imperative code with a lot of repeated calls) we should follow the documentation to exclude these files. Once excluded I'd advocate for our Quality Gate to be in a passing state on the remaining code before we merge.

@wenzowski
Copy link

wenzowski commented Jan 14, 2022

Any chance we could get the Cypress Dashboard permissions set to public? When I click the link in the CI output I am not able to see the recorded run. Here's how to make a cypress Project public.

.sonarcloud.properties Outdated Show resolved Hide resolved
@BCerki
Copy link
Collaborator Author

BCerki commented Jan 14, 2022

Any chance we could get the Cypress Dashboard permissions set to public? When I click the link in the CI output I am not able to see the recorded run. Here's how to make a cypress Project public.

Issue for this here: https://github.com/bcgov/digital_marketplace/pulls

@BCerki
Copy link
Collaborator Author

BCerki commented Jan 17, 2022

[10:55] Matthieu Foucault
Brianna an update you should make to your cypress commands file:
https://github.com/bcgov/cas-cif/pull/227/files#diff-372fef444099a68788e29e5b0d799d71238f39b57d61681e33641fb2e10c2ddd

Comment on lines +22 to +26
Cypress.on('uncaught:exception', (err, runnable) => {
// returning false here prevents Cypress from
// failing the test
return false
})
Copy link
Collaborator Author

@BCerki BCerki Jan 17, 2022

Choose a reason for hiding this comment

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

I grabbed this straight from the Cypress docs. This is to avoid app errors failing the tests, e.g.:
image
I've added a tech debt issue: bcgov#131

@BCerki
Copy link
Collaborator Author

BCerki commented Jan 17, 2022

in development, the site uses gmail to test transactional emails in development

Highly recommend using Mailhog in ci/dev/test to create a fully functional smtp endpoint. Here's a good helm chart for Mailhog.

Tech debt issue here: https://github.com/button-inc/digital_marketplace/issues/133

Copy link
Collaborator

@mikevespi mikevespi left a comment

Choose a reason for hiding this comment

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

This is great! love the sonar cloud update 🚢

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.

None yet

3 participants