fleet/cypress
Lucas Manuel Rodriguez da171d3b8d
Merge pull request from GHSA-pr2g-j78h-84cr
* Fix access control issues with users

* Fix access control issues with packs

* Fix access control issues with software

* Changes suggested by Martin

* All users can access the global schedule

* Restrict access to activities

* Add explicit test for team admin escalation vuln

* All global users should be able to read all software

* Handbook editor pass - Security - GitHub Security (#5108)

* Update security.md

All edits are recorded by line:

395 replaced “open-source” with “open source”
411 replaced “open-source” with “open source”
439 added “the” before “comment”; replaced “repositories,” with “repositories”
445 deleted “being” before “located”
458 added “and” after “PR”
489 replaced “on” with “in”
493 replaced “open-source” with “open source”; Replaced “privileges,” with “privileges”

* Update security.md

line 479

* Update security.md

added (static analysis tools used to identify problems in code) to line 479

* Fix UI

* Fix UI

* revert api v1 to latest in documentation (#5149)

* revert api v1 to latest in documentation

* Update fleetctl doc page

Co-authored-by: Noah Talerman <noahtal@umich.edu>

* Add team admin team policy automation; fix e2e

* Update to company page of the handbook (#5164)

Updated "Why do we use a wireframe-first approach?" section of company.md

* removed extra data on smaller screens (#5154)

* Update for team automations; e2e

* Jira Integration: Cypress e2e tests only (#5055)

* Update company.md (#5170)

This is to update the formatting under "empathy" and to fix the spelling of "help text."
This was done as per @mikermcneil .
This is related to #https://github.com/fleetdm/fleet/pull/4941 and https://github.com/fleetdm/fleet/issues/4902

* fix update updated_at for aggregated_stats (#5112)

Update the updated_at column when using ON DUPLICATE UPDATE so that
the counts_updated_at is up to date

* basic sql formatting in code ie whitespace around operators

* Fix e2e test

* Fix tests in server/authz

Co-authored-by: gillespi314 <73313222+gillespi314@users.noreply.github.com>
Co-authored-by: Desmi-Dizney <99777687+Desmi-Dizney@users.noreply.github.com>
Co-authored-by: Michal Nicpon <39177923+michalnicp@users.noreply.github.com>
Co-authored-by: Noah Talerman <noahtal@umich.edu>
Co-authored-by: Mike Thomas <78363703+mike-j-thomas@users.noreply.github.com>
Co-authored-by: Martavis Parker <47053705+martavis@users.noreply.github.com>
Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com>
2022-04-18 10:27:30 -07:00
..
fixtures Merge master into teams 2021-04-14 17:52:15 +01:00
integration Merge pull request from GHSA-pr2g-j78h-84cr 2022-04-18 10:27:30 -07:00
plugins Refactor cypress tests and expand testing (#450) 2021-03-12 11:49:28 -08:00
support Updated API routes to use current format for frontend use (#5018) 2022-04-11 13:04:38 -07:00
cypress-free.json E2e refactor: integration/all/app (#3785) 2022-01-28 11:48:51 -05:00
cypress-premium.json Refactor e2e premium observer spec (#3817) 2022-01-24 15:21:05 -06:00
README.md Remove numbers from documentation filenames in Fleet repo (#4313) 2022-02-23 12:17:55 -06:00
tsconfig.json Add commands for enrolling hosts in E2E tests (#1089) 2021-06-15 10:14:57 -07:00

Cypress Testing

Cypress tests are designed solely for end-to-end testing. If this is your first time developing or running end-to-end tests, Fleet testing documentation includes git instructions for test preparation and running tests.

Fleet Cypress directories

Integration directory

Cypress tests the integration of entire features of the app.

With the roll out of teams, Cypress tests the user interface of each role of a user on the Premium Tier (Fleet Premium Documentation) and Free Tier (Fleet Free Documentation).

Support directory

Commands that are shared across tests are located in the support directory.

Opening Cypress locally

To open simply run:

yarn cypress:open

This will open up cypress locally and allow you to view the current test suite, as well as start writing new tests.

Building best practices

As much as possible, build from a user's perspective. Use .within cypress command as needed to scope a command within a specific element (e.g. table, nav).

As much as possible, assert that the code is only selecting 1 item or that the final assertion is the appropriate count.

Prioritization of selecting elements

  1. By element tag using elements (e.g. buttons), we can target text within. Confirm what the user is seeing with target text. If this is not specific enough, add on Role.
  2. By role using default or explicitly assigned roles of elements. If this is not specific enough, add on element class.
  3. By element class is least preferred as it does not follow a user's perspective. Occasionally this may be the only option. If that is the case, prioritize using the class name that specifies what the element is doing.

Resources