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

anlambert created this revision.Aug 9 2019, 3:15 PM
ardumont accepted this revision.Aug 9 2019, 5:01 PM
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 commandeered this revision.Aug 12 2019, 1:27 PM
kalpitk added a reviewer: anlambert.
kalpitk updated this revision to Diff 6217.Aug 13 2019, 4:18 PM
  • Add assertions to directory vault cooking
kalpitk updated this revision to Diff 6233.Aug 14 2019, 9:52 PM
  • Add tests
kalpitk updated this revision to Diff 6234.Aug 14 2019, 9:56 PM
  • fix typo
kalpitk updated this revision to Diff 6237.Aug 15 2019, 7:18 PM
  • Add tests for localStorage

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

kalpitk updated this revision to Diff 6239.Aug 16 2019, 3:49 PM

retrigger build

vlorentz requested changes to this revision.Aug 19 2019, 11:28 AM
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
cypress/integration/vault.spec.js
17–41

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

77

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

152–153

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)

kalpitk added inline comments.Aug 19 2019, 2:11 PM
cypress/integration/vault.spec.js
77

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

vlorentz added inline comments.Aug 19 2019, 2:36 PM
cypress/integration/vault.spec.js
77

Meh. Ok then.

kalpitk updated this revision to Diff 6272.Aug 19 2019, 4:22 PM
  • rebase
  • changes acc to requested changes
  • commit msgs updated
kalpitk updated this revision to Diff 6278.Aug 19 2019, 4:56 PM
  • revision[0] -> revisions[0]
vlorentz accepted this revision.Aug 19 2019, 4:57 PM
This revision is now accepted and ready to land.Aug 19 2019, 4:57 PM
vlorentz requested changes to this revision.Aug 19 2019, 4:58 PM

Let's wait for the build result first

This revision now requires changes to proceed.Aug 19 2019, 4:58 PM
vlorentz accepted this revision.Aug 20 2019, 10:54 AM
This revision is now accepted and ready to land.Aug 20 2019, 10:54 AM
kalpitk updated this revision to Diff 6288.Aug 20 2019, 11:24 AM
  • rebase
This revision was automatically updated to reflect the committed changes.