Page MenuHomeSoftware Heritage

cypress: Add tests for the vault features
ClosedPublic

Authored by kalpitk on Aug 9 2019, 3:15 PM.

Details

Summary

That diff is a first draft of implementing end to end tests for the vault features
of the Software Heritage web application.

Some tests remain to be written and some code factorization should also be performed
to easily implement the revision cooking test.

I'm forwarding future work on this to @kalpitk as I will be in holidays during the
next two weeks but GSoC coding period is still active.

Related T1768

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont added a subscriber: ardumont.

sounds nice

not sure i understand all the implications though ;)

This revision is now accepted and ready to land.Aug 9 2019, 5:01 PM

@ardumont, you can check the effect of that test through the cypress UI.

Execute $ make test-frontend-ui in the root folder of swh-web, a GUI fronted for cypress will be launched.

Then select any test in the displayed list, it will be executed in a Chromium based browser (using Electron as a default fallback)
and you can see the details of each test steps.

This make me think that I need to update the README to explain how to run the tests ;-)

kalpitk added a reviewer: anlambert.
  • Add assertions to directory vault cooking
  • Add tests for localStorage

Cypress test fails because of origin-search.spec.js(fails sometimes). Will try correcting in another diff

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
cypress/integration/vault.spec.js
16–40

These should have a comment explaining they are used to mock an API endpoint (and the name of the endpoint)

76

Rename this to sha1 or just id. object_id has a different meaning in other parts of SWH (it's an integer).

151–152

remove "indicating"

cypress/support/index.js
71

it should be named origin.revisions then.

This revision now requires changes to proceed.Aug 19 2019, 11:28 AM

And you'll need to squash your commits (but not with @anlambert's initial commit, to preserve ownership information)

cypress/integration/vault.spec.js
76

Vault item object is as it is stored in local storage.

cypress/integration/vault.spec.js
76

Meh. Ok then.

  • rebase
  • changes acc to requested changes
  • commit msgs updated
  • revision[0] -> revisions[0]
This revision is now accepted and ready to land.Aug 19 2019, 4:57 PM

Let's wait for the build result first

This revision now requires changes to proceed.Aug 19 2019, 4:58 PM
This revision is now accepted and ready to land.Aug 20 2019, 10:54 AM
This revision was automatically updated to reflect the committed changes.