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

Feature/cypress testing #121

Open
wants to merge 91 commits into
base: develop
Choose a base branch
from
Open

Feature/cypress testing #121

wants to merge 91 commits into from

Conversation

cschwinderg
Copy link
Contributor

Adds cypress automated tests and code coverage.

Notes:

  • Added /* istanbul ignore next: cannot test */ flags before some instances of code that cannot be tested (i.e., reportWebVitals and unhandled exceptions). This improves the code coverage numbers.
  • Added a retries flag to the cypress config. This makes cypress retry a test if it fails.
    • I ran into issues on Step 5 where when the district id is entered sometimes the rest of the form is not auto populated. I also added some waits around entering the district id. I've never encountered this issue when manually filling out the form, so it must be something to do with how fast cypress fills out the forms.
    • This flag has also been helpful for other situations where a test randomly fails.
  • Added Cypress.on('uncaught:exception',... to the top of all of our .spec.js files. This makes it so that cypress does not fail tests when there are errors in the chrome developer console. I put a todo comment to remind us to remove this code when the app is more stable. The screenshot below shows the error message that usually causes tests to fail.

image

# Conflicts:
#	app/client/src/components/welcome.tsx
# Conflicts:
#	app/client/src/components/welcome.tsx
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@cschwinderg
Copy link
Contributor Author

cschwinderg commented May 10, 2022

@courtneymyers I think I am done making the switch to findByRole. Below is a list of items that findByRole would not work for because they are not accessible. I'm not sure if you want to send something to the formio team about these items.

  • Docker Sign In Page (not really important since it is only accessible when running locally)
    • Password
  • Application Step 4
    • National Center for Education Statistics (NCES) District ID
    • State or Territory
  • Application Step 5
    • Model
    • Average Annual Fuel Consumption (gallons)
    • Replacement Bus GVWR (lbs.)
    • Manufacture - Uses a dropdown component that has search functionality. So this isn't a normal select input. I'm not really sure if there is anything they can do to fix this.
    • Fuel Type - Uses a dropdown component that has search functionality. So this isn't a normal select input. I'm not really sure if there is anything they can do to fix this.
    • Replacement Fuel Type - Uses a dropdown component that has search functionality. So this isn't a normal select input. I'm not really sure if there is anything they can do to fix this.
    • File Upload - Right now I have to select by cy.get("div[ref="fileDrop"]"), which may help pinpoint what element needs to be labeled.
  • Application Step 6
    • Sign Application - Right now I have to select by cy.get("canvas"), which may help pinpoint what element needs to be labeled.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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