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

Breaching cypress best practices and tidying #2046

Closed
jamesbhobbs opened this issue Jun 21, 2019 · 3 comments
Closed

Breaching cypress best practices and tidying #2046

jamesbhobbs opened this issue Jun 21, 2019 · 3 comments
Assignees
Milestone

Comments

@jamesbhobbs
Copy link
Contributor

jamesbhobbs commented Jun 21, 2019

Is your feature request related to a problem? Please describe.
Cypress test in the repo are slightly untidy (subjective), breach many best practices (citations below) and will not scale (related in part to: #1837)

Describe the solution you'd like

  • Folderise the tests e.g.
    -- pagetypeA, pagetypeB, utilities (wrongly in cypress/support), system, application etc.
  • More consistent file naming (e.g. some start with amp, some end with it)
  • e2es don't fast fail (meaning if 1 test fails early they tests will continue to run in their entirety)
  • We should never ned to use let or const, we use them 145 times part of https://docs.cypress.io/guides/references/best-practices.html
  • We have some tiny assertions breach of https://docs.cypress.io/guides/references/best-practices.html
  • We have tests split by feature (not necessarily bad in principle) but this means we're loading and reloading each page we're running e2es on
  • I think we're using config in /support where we should be using /fixtures
  • Aside from duplication we have no way to run this same set of tests across multiple page types in 40 languages that we will need to
  • Some code is written that duplicates native cypress functionality, such as testing for a 200 response
  • Some of the e2e code is written to be as neat and reusable as production code, ironically this higher standard of code has made refactoring these tests harder than simply copying and pasting tests. There is little reason to avoid test duplication, we don't need to optimise the file sizes of tests, we need simpler, better structured tests that are easy for testers to CRUD (Create, Remove, Update, Delete).
  • Tests should ideally be setup in a way that suits cypress parallelism as best as possible (it would work now, but would be inefficient)
  • Some individual tests take 5-10s to run, this seems very long, perhaps there are errors here

Describe alternatives you've considered
n/a these tests need to be simple, clear and scalable

Testing notes
[Tester to complete]

Dev insight: This isn't just something that needs testing it's something that needs all testers to review as each change is made as they'll be the main users of these tests.

Additional context
Add any other context or screenshots about the feature request here.

@jamesbhobbs
Copy link
Contributor Author

Part of #2230

@jamesbhobbs jamesbhobbs removed their assignment Jul 2, 2019
@oluoluoxenfree
Copy link
Contributor

oluoluoxenfree commented Aug 6, 2019

Things left to do:

  • test folderisation (if still wanted)
  • I assume consistent file naming has been superceded by consolidating the tests
  • e2es failing fast
  • down to 62 instances of let/const but could still remove a few more
  • duplication work arounds
  • set up tests for parrellelism
  • quicker running tests
  • checking for native functionality duplication

@jamesbhobbs jamesbhobbs self-assigned this Aug 20, 2019
@jamesbhobbs
Copy link
Contributor Author

This is essentially done

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

No branches or pull requests

2 participants