Page MenuHomeSoftware Heritage

Add end to end tests for the frontend part of swh-web
Open, NormalPublic

Description

While the backend part of swh-web is properly tested, its frontend part is not.

In order to ensure non regression on the archive browsing features we must implement end to end tests
to check the web UI behaves as expected, using the cypress tool .

Event Timeline

anlambert triaged this task as Normal priority.
shisus added a subscriber: shisus.Sat, Jun 1, 1:14 PM

Hello everyone, I've some questions:

Have you already decided to use Selenium?
Is there a place were I can participate/watch the discussion of that decision?
I'm sorry about these questions, I'm pretty new about on this project.

Have you considered to use cypress?
Is a nodejs based project to create e2e tests, nowadays is gaining a lot of popularity and I think is awesome.

Jesus

Hello @shisus.

Thanks for pointing out the cypress tool, it looks pretty interesting.
Based on my understanding, it could be used to write and run unit tests but also end to end ones.

Last week, I started to bootstrap unit tests for the frontend part of swh-web using the mocha tests runner (see D1524).
I will try to implement those tests using cypress in order to compare both solutions.
Using a single tool for all frontend tests would be indeed of interest.

shisus added a comment.Thu, Jun 6, 7:29 PM

Hi @anlambert ,

No problem, I want to contribute to this project, so I'm looking where I would be able to work with.
Do you plan to add cypress in the web repository or Is it still a POC?
Is there a chance to work with you in setting up the cypress environment?

@shisus , I have tested cypress and the tool is indeed quite awesome !

I am currently working on a Diff (Phabricator PR) setting up the cypress environment
to perform end to end tests on swh-web. I should publish it tomorrow for first reviews.
Regarding those tests, @kalpitk a Google Summer of Code student will work on writing
them as it is part of his deliverables.

But any help is welcomed to improve the Software Heritage web applications.
If you have any ideas or improvements in mind, you can submit us a Phabricator Diff
by following these instructions and we will review it.

anlambert renamed this task from Add tests for the frontend part of swh-web to Add end to end tests for the frontend part of swh-web.
anlambert updated the task description. (Show Details)
anlambert updated the task description. (Show Details)Fri, Jun 7, 6:13 PM

I plan to add the following e2e tests-

  1. Test basic webapp functionalities like 'sidebar', 'back-to-top'
  2. Test home page displays positive stats for directories, authors,...
  3. Test the origin-search with different combinations of checkboxes
  4. Test basic functionality of directory view.
  5. Test file being displayed (for some known format, maybe .txt)
  6. Test error being displayed when invalid sha1 or unknown origin url