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

Extend e2e tests to include a modern archive #1042

Closed
Jaifroid opened this issue Aug 7, 2023 · 6 comments · Fixed by #1049
Closed

Extend e2e tests to include a modern archive #1042

Jaifroid opened this issue Aug 7, 2023 · 6 comments · Fixed by #1049
Assignees
Labels
build Code relating to building, publishing, or maintaining the app tests user interface
Milestone

Comments

@Jaifroid
Copy link
Member

Jaifroid commented Aug 7, 2023

Currently the E2E tests enabled in #1038 are done on the legacy split Ray Charles ZIM with XZ compression, in both SW mode and JQuery mode. However, we should add a non-legacy ZIM, and ideally one that uses some dynamic features in SW mode, and test these.

@Jaifroid Jaifroid added tests build Code relating to building, publishing, or maintaining the app user interface labels Aug 7, 2023
@Jaifroid Jaifroid added this to the v4.1 milestone Aug 7, 2023
@Rishabhg71
Copy link
Collaborator

@Jaifroid I will take this issue Before I start on this issue could you point out some resources to learn more about Ray Charles ZIM, non-legacy ZIM, and general docs

@Jaifroid Jaifroid modified the milestones: v4.1, v4.0 Aug 9, 2023
@Jaifroid
Copy link
Member Author

Jaifroid commented Aug 9, 2023

OK, thanks. The ZIM we are using for tests is in the tests directory, and it's a split ZIM. I suggest adding tests against a modern dynamic ZIM such as a Gutenberg. However, it would have to be a small archive, probably one for an obscure language with very few books... Ideally a ZIM less than 10MB,as we will need to commit the ZIM to this Repo to use for consistent tests.

I will add some documentation about the testing system shortly and will mention it here.

@Jaifroid
Copy link
Member Author

Jaifroid commented Aug 9, 2023

@RG7279805 I've now added the documentation. Please see TESTS.md. Let me know if you have any queries. Just to be clear, it is only the e2e tests you would be extending, not the unit tests.

@Rishabhg71
Copy link
Collaborator

@Jaifroid I have read the TESTS.md. If I am correct I need to create a ZIM file of Project Gutenberg Page and then perform tests using that file. One problem is I am not sure how to create that Zim file. Cloud you point me in the right direction

I have already tried these resources

@Jaifroid
Copy link
Member Author

@RG7279805 No, you don't need to make your own ZIM archive! We just need to choose a good one form the pre-existing archives available from library.kiwix.org, or download.kiwix.org. I'll take a look and make some suggestions. You can't use Zimit, by the way, for Kiwix JS, because this app doesn't yet support the Zimit format (see #644 and #1009).

@Jaifroid
Copy link
Member Author

@RG7279805 Having taken a look, I suggest the following file which is small and has a few books to work with:

https://download.kiwix.org/zim/gutenberg/gutenberg_ro_all_2023-05.zim

You would need to add this to the tests directory (in your PR) and then adapt the existing spec test file to work with it. We want the tests to run in both jQuery mode and in ServiceWorker mode (like the sample spec file).

For jQuery mode, you should test that the active content warning appears correctly on first load of the ZIM. You should also test searching for a book and loading the HTML of the book, possibly also downloading an epub if that's possible to test (I'm not sure we can actually test the downloaded file, but we can test the download action).

For ServiceWorker mode you need to test that the initial list of books appears, that the active content warning does NOT appear, that clicking the AZ button changes the sort order of the books displayed, loading the HTML of a book and also downloading (to the extent that is possible).

Jaifroid pushed a commit that referenced this issue Aug 22, 2023
@Jaifroid Jaifroid modified the milestones: v4.0, v3.10 Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Code relating to building, publishing, or maintaining the app tests user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants