Giveth / giveth-dapps-v2

This project is the aggregation of GIVeconomy and Giveth.io DApps in a single repo
https://staging.giveth.io
GNU General Public License v3.0
61 stars 34 forks source link

Front-end Test #901

Closed MohammadPCh closed 2 years ago

MohammadPCh commented 2 years ago

We always read about writing tests for applications. and all of us agree that it a necessary for the back-end. but shall we have it for the front-end? what are its advantages? we need to think about it. maybe it help us to have an application with fewer bugs. God knows! What's your idea @MoeNick?

MoeNick commented 2 years ago

Yeah functional tests works but needs lots of bandwidth to get benefited from. Let's have QA specialist first, then we can complete it after

mateodaza commented 2 years ago

Let's share in this thread some ideas on which framework should we use!

@alireza-sharifpour did I hear in some call that you had some implementations before?

cc @MohammadPCh @RamRamez

mateodaza commented 2 years ago

In this article from the nextjs docs they have some examples for cypress, playwright, jest and vitest

alireza-sharifpour commented 2 years ago

@mateodaza

Yes I did some implementations and read lots of documents before. The PR for our project's configuration is here: https://github.com/Giveth/giveth-dapps-v2/pull/1074 I'm going to share some resources in the next comment

alireza-sharifpour commented 2 years ago

I investigated Big projects' code bases, read some docs, and watched some courses and implemented some tests. We can use Jest + React Testing Library for Unit testing and integration testing and Mocking and ... React Testing Library is a great tool that provides many React and DOM-related utilities. https://testing-library.com/docs/react-testing-library/intro/ https://chrome.google.com/webstore/detail/testing-playground/hejbmebodbijjdhflfknehhcgaklhano?hl=en Best course i found for testing: https://testingjavascript.com/

Kent C dodds has great articles about testing on his website.

Also, for E2E tests and Integration tests, we can use Cypress, which I've not used it before, but I see that some repos like Uniswap are using it, and it seems perfect. https://www.cypress.io/ Uniswap Repo Pancakeswap Repo

@mateodaza @MohammadPCh @RamRamez

MohammadPCh commented 2 years ago

Wow, thanks @alireza-sharifpour and @mateodaza It's great. I suggest that each of you undertakes a part of this research and demo it for the team( dev team + POs + testers) what do you think?

alireza-sharifpour commented 2 years ago

Wow, thanks @alireza-sharifpour and @mateodaza It's great. I suggest that each of you undertakes a part of this research and demo it for the team( dev team + POs + testers) what do you think?

I think it's a good idea đź‘Ť

MoeNick commented 2 years ago

@alireza-sharifpour @MohammadPCh would you please update the issue the latest plan? can we create another issue then after this one?

alireza-sharifpour commented 2 years ago

I think it doesn’t need an issue anymore, because it would be a part of our workflow, but before that, we all need to get on the same page. I think this issue was mainly for Research and configuration of the tools, and it's done. @MoeNick

MohammadPCh commented 2 years ago

@MoeNick writing test is not an easy task. we need all team members to be ready for writing and also, need to have the additional time budget for each job. for example consider all team members know how to write tests because we don't have experience in the team, a task with 5 story points maybe takes 8 or 13 story points.

MoeNick commented 2 years ago

@MoeNick writing test is not an easy task. we need all team members to be ready for writing and also, need to have the additional time budget for each job. for example consider all team members know how to write tests because we don't have experience in the team, a task with 5 story points maybe takes 8 or 13 story points.

Im with it! Let's make it happen. I think we have to close this and create another for the test plan, guidelines, milestones, and monitoring of the test coverage. what do you think? @MohammadPCh @alireza-sharifpour

MohammadPCh commented 2 years ago

I'm totally agree with you