Page MenuHomeSoftware Heritage

Add end to end tests for the frontend part of swh-web
Closed, MigratedEdits Locked

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 .

Current tests results report can be found here.

Current coverage for Javascript code can be found here.

Let's close that task when we reach 80% of code coverage (T1411).

Event Timeline

anlambert triaged this task as Normal priority.May 28 2019, 1:28 PM
anlambert created this task.

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.

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.Jun 7 2019, 6:08 PM
anlambert updated the task description. (Show Details)

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

Let's close that task when we reach 80% of code coverage

This is now the case so closing this (unfortunately coverage report is broken on Jenkins so I can not point to the latest one).

gitlab-migration changed the status of subtask T1770: Add end to end tests from Duplicate to Migrated.