Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Adds Cypress E2E tests and GitHub Action Cypress workflow #161

Merged
merged 74 commits into from
Jan 12, 2021

Conversation

ftianli-amzn
Copy link

@ftianli-amzn ftianli-amzn commented Jun 17, 2020

Issue #, if available:

Description of changes:

  1. Adds Cypress E2E tests, which contains the following test cases:
  • Monitor:
    • Create a monitor
    • Update a monitor by changing the name
    • Delete a monitor
    • Search a monitor
    • Add a trigger to the monitor
    • Add an action to the trigger
  • Destination:
    • Create a destination
    • Update a destination by changing the name
    • Delete a destination
    • Search a destination
  • Alert:
    • Alert can be in Active state
    • Alert can be in Acknowledged state
    • Alert can be in Completed state
    • Alert can be in Error state
    • Alert can be in Deleted state
  1. Adds GitHub Action workflow to run E2E tests on every push into master branch

References of the code changes:

  1. Adds cypress e2e tests and github action cypress workflow index-management-kibana-plugin#80
  2. https://github.com/opendistro-for-elasticsearch/security-kibana-plugin/pull/172
  3. Updates to github action workflows and some bug fix after upgrading to Kibana 7.10 index-management-kibana-plugin#139

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ftianli-amzn ftianli-amzn marked this pull request as ready for review June 19, 2020 05:04
@ftianli-amzn ftianli-amzn changed the title Adds Cypress E2E tests and GitHub Action Cypress workflow (from a temp branch within the repo) Adds Cypress E2E tests and GitHub Action Cypress workflow Aug 25, 2020
ftianli-amzn and others added 4 commits August 24, 2020 23:03
* install cypress module

* Add Cypress test cases of basic Monitor CRUD operations

* Add Cypress test cases of Destination CRUD operations and add destination to monitors

* Add Cypress test cases of different Alert states

* Clean up cypress example files

* Add GitHub Action workflow file for Cypress test

* Update README file
* Adds support for Kibana 7.8.0 (#163)

* Bump version number of ES, ODFE, and node

* update Jest snapshots

* update release notes with Kibana 7.8.0 support

* Move plugin entry into Kibana app category in sidebar

(cherry picked from commit bf9a91c)

* Update the unit-test workflow script to get Kibana version from package.json (#165)

* Get Kibana version from the package.json file in unit-test workflow

(cherry picked from commit 6d82e56)

* Fix the unit-test workflow by checking out the repo first

(cherry picked from commit cc9fc0c)

* Bump lodash from 4.17.15 to 4.17.19 (#169)

* Bump lodash from 4.17.15 to 4.17.19

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <[email protected]>

* update yarn.lock by running 'yarn kbn bootstrap'

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tianli Feng <[email protected]>

(cherry picked from commit 8b0dd58)

* Adds support for Kibana 7.9.0 (#171)

* keyCode to key

* fix UT

* remove used dependency

(cherry picked from commit 5d3ff53)

* Release note automate (#172)

* release note automation

* python script fix

* compatibale with Kibana

(cherry picked from commit c72d37e)

* upgrade cypress verison to 5.0.0

* ingonre an uncaught error and add some copyright notice

* change a wording back

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bowen Lan <[email protected]>
bowenlan-amzn and others added 18 commits December 23, 2020 09:36
#174)

* Update opendistro-for-elasticsearch-alerting-kibana-plugin.release-notes-1.10.0.0.md

* paranthesis

* time

* paranthesis
* release workflow
* Add Mail destination
  * Support SSL/TLS
  * Authentification
  * Message's body is html by dedault

* Rework mail destination :
- all mail server settings are in elasticsearch.yml
- remove html support for now

* Changed references to 'Mail' to 'Email'

* Add routes and services for EmailAccount and EmailGroup APIs

* Add styles for accordion-separator and 'Manage senders' modal

* Add 'Email sender' selection and 'Manage senders' modal to 'Create destination' page for Email destinations

* Add 'Email recipients' and 'Manage email groups' modal to 'Create destination' page for Email destinations

* Load senders in ManageSenders to decouple modal from EmailSender

* Fix bug that nested options in EmailGroup emails combo box

* Load email groups in ManageEmailGroups to decouple modal from EmailRecipients

* Move 'onClickSave' processing logic from EmailSender to ManageSender

* Move 'onClickSave' processing logic from EmailRecipients to ManageEmailGroups

* Add 'Actions' dropdown for managing email senders and email groups from the Destinations page

* Fix styling on manage email sender and email group modals

* Prevent ManageSenders and ManageEmailGroups modals from closing with ESCAPE key

* Move state changing anonymous arrow functions to component functions

* Pass httpClient to getSenders() and getEmailGroups()

* Show invalid emails entered in Email Group form and fix issue with duplicate options appearing

* Update help text for Sender 'method' selection

* Update formikToDestination for Email type

* Move email_accounts and email_groups APIs under 'destinations' namespace

* Update destinationToFormik for Email type

* Update validateEmailRecipients to return all invalid email entries

* Increase width for Email modals empty prompts for better text wrapping

* Fix text misalignment for Sender form when there is validation text

* Add toast messages on success and failure for Sender and EmailGroup modals

* Hide modal footers for Sender and EmailGroup modals when there is nothing to save

* Make email verification RFC 5322 compliant

* Comma separate invalid emails in validation text

* Add initial tests for ManageSenders and ManageEmailGroups

* Update destinationToFormik tests to await on asynchronous parts

* Update snapshots

* Add updated yarn.lock

Co-authored-by: David Chauvière <[email protected]>
Co-authored-by: David Chauviere <David Chauviere [email protected]>
…nation (#189)

* Remove dashes from valid sender name requirements

* Add additional tests for email changes
* Update MonitorService handler to use rest apis instead of calling config index

* Use HTTPS for Monitor api calls

* Revert MonitorService changes and add support to call getDestination(s) rest API

* add support for calling getAlerts api

* fix pagination and sorting, also call rest api for getMonitor(s)

* fix sorting, filtering, and searching for getAlerts and getDestinations

* Call Alerting Rest APIs instead of alerting/config index

* minor fixes
…rd and Detail page (#187)

* Showing monitor creator in monitor overview and dashboard

* Display 'N/A' as the user name when there is no 'user' field in a monitor

* add comments to explain all the cases of the user object

* update jest snapshot files and a unit test for 'getOverviewStats'
…d to create/update a monitor or destination (#168)

* Add a toast error message if the form validation fails when user attempts to create or edit a monitor.
* Auto scroll the page to the first field with error, and focus the field.
* Add a toast error message to show the REST API errors when user attempts to create or edit a monitor.
* Add utility function to get destination ALLOW_LIST

* Hide 'Actions' on Destination page if email is disallowed and prevent 'Edit' on disallowed Destinations

* Filter on allowed destinations in ConfigureActions and CreateDestination

* Disable 'Edit' button for disallowed Destinations

* Don't load initialValues for Email modals when Email is disallowed

* Add validation for disallowed destinations during Create/Edit Destination page

* Show message in modals when Email destination is disallowed

* Update Email modal tests

* Filter out disallowed destinations in DestinationsControls

* Update tests for DestinationsList, DestinationsActions and DestinationsControls

* Update snapshots

* Fix bug in AlertService

* Refactor getAllowList() function and setting resolution order

* Reload modals when isEmailAllowed property changes
* Update version to 1.11.0.0

* fix notes
* Fix Monitor Details Page

* fix tests and others
@ftianli-amzn
Copy link
Author

Last run before changing the trigger of the workflow from pull request event to push:
https://github.com/opendistro-for-elasticsearch/alerting-kibana-plugin/runs/1665755508

@ftianli-amzn ftianli-amzn merged commit 6571e5b into master Jan 12, 2021
@ftianli-amzn ftianli-amzn deleted the cypress_od1.8 branch January 12, 2021 22:12
@tlfeng tlfeng added the testing adds or improves tests label Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testing adds or improves tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet