Skip to content

Testing SMTP email service with Cypress - #659

Merged
RachelElysia merged 21 commits into
fleetdm:masterfrom
RachelElysia:emailtests
Apr 29, 2021
Merged

Testing SMTP email service with Cypress#659
RachelElysia merged 21 commits into
fleetdm:masterfrom
RachelElysia:emailtests

Conversation

@RachelElysia

@RachelElysia RachelElysia commented Apr 19, 2021

Copy link
Copy Markdown
Member
  • Create email test file
  • Moved Hello from Fleet test after testing setting updates settings.spec.ts

Screen Shot 2021-04-19 at 12 55 10 PM

RachelElysia and others added 16 commits April 19, 2021 12:09
* Add Mia circle, can't overrride Mia letter casing

* Uppercase MIA

Co-authored-by: Rachel Elysia Perkins <rachel@fleetdm.com>
- Moves `isEditLabel` out of `<ManageHostPage />`'s state and into its props. The implementation is now similar to `isAddLabel`.
- Add `selectedFilter` to the URL path when editing or adding labels. This helps navigate the user back to the selected label after they click "Cancel" when editing or adding.
- Use NODE_ENV=development for Webpack in CI.
- Add caching for Webpack modules in development.
- Remove time of day from dates in version string (helps with build caching).
- Use Go cache in CI.

This makes about a 20% savings on the total time for the CI run.
- Add "Count apple applications" to query handbook
- Add supported platforms to query index in `/handbook/queries` README
* Fill out form, pseudocode check updated fields

* Create update assertions

* Update page before assertions

* Start advanced options

* Add advance options

Co-authored-by: Rachel Elysia Perkins <rachel@fleetdm.com>
* Fix key issue
* Fix non-unique hostname selection bug
* Fullscreen mode always an option
* Export Results button iff results && no errors
* Export Errors button added

Suggestion added by: @noahtalerman <noah@fleetdm.com>
Due to Go build caching in fleetdm#687, the dependencies were sometimes not started before the E2E test. This PR reorders startup of the dependencies so that they should almost always have time to finish startup.
* Export Results button iff results && no errors
* Export Errors button functional
* Fullscreen always option
* Fix linting issue
- Add "Get authorized keys" query to `handbook/queries`
- Edit "Get installed ___ software" queries for all platforms to prepare for adding software inventory to the host details API endpoint
@RachelElysia
RachelElysia marked this pull request as ready for review April 21, 2021 16:57
@RachelElysia
RachelElysia requested a review from zwass April 21, 2021 16:57
@RachelElysia

RachelElysia commented Apr 21, 2021

Copy link
Copy Markdown
Member Author

@zwass the email testing should be good to merge in now!

@ghernandez345 helped me find the best place to ignore a jest linting error (cypress uses the same command as jest but in a different way causing an error, so we added to ignore that lint error in the cypress folder)

(I also rebased master and somehow it looks like there are more commits than there actually are!)

@zwass zwass left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Glad to see it getting the job done, and I have some changes to request.

Comment thread cypress/integration/app/email.spec.ts Outdated
Comment thread cypress/integration/app/settingsflow.spec.ts Outdated
cy.findByLabelText(/host expiry window/i).should("have.value", "5");
});

it("if last email is Hello from Fleet", () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this should remain in the same test as where we set up the SMTP configuration. https://docs.cypress.io/guides/references/best-practices#Having-tests-rely-on-the-state-of-previous-tests does a good job of explaining why we would like to do this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@zwass

"remain in the same test as where we set up the SMTP configuration" -- what file is that?

I went ahead and made changes from your last comments, let me know if I've missed the mark on anything!

Comment thread cypress/integration/app/settingsflow.spec.ts Outdated
Comment thread cypress/integration/app/settingsflow.spec.ts Outdated
Comment thread cypress/support/commands.ts Outdated
@RachelElysia
RachelElysia requested a review from zwass April 29, 2021 17:02

@zwass zwass left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit: !

@RachelElysia
RachelElysia merged commit afcd75d into fleetdm:master Apr 29, 2021
@RachelElysia
RachelElysia deleted the emailtests branch April 29, 2021 17:10
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.

4 participants