React Native Automation Feasibility using Detox and Cavy | One Pager
React Native Automation Feasibility using Detox and Cavy:
Mobile App Testing Interview Question: Mobile Application Testing Interview |Ministry of Testing Meetup |Testing Android & iOS Apps | Testing Native & Testing React Native
Detox – The most difficult part of automated testing on mobile is the tip of the testing pyramid - E2E. The core problem with E2E tests is flakiness - tests are usually not deterministic. We believe the only way to tackle flakiness head on is by moving from black box testing to gray box testing.
Cavy – Similarly cavy is also specifically developed for React Native mobile automation, but the automation tool is not that mature and it depends on refs to perform tests.
Tool | Detox | Cavy |
Company | By Wix | By Pixielabs |
Maturity Status | More Stable and Mature | Bit Buggy |
What can be automated | Can be used to automate react Native, Native and Hybrid apps | Can be used to automated React Native App.For native apps we need to native JS hooks (Appium). |
Grey,white or black box? | Gray Box not Black Box | White box |
Fast | Uses Async Function i.e.no need to wait for the action to be performed till the element in not available. | Doesn’t uses async funtion |
Under the hood | Uses Earlgrey and Expresso in the hood, therefore we can rely on ID, label and other matchers. | Depends on refs |
Both the Detox and Cavy are open source but the detox community is highly active and they are adding new functionality every now and then.
Detox rather acts as an aggregator (or even a platform) for two Whitebox frameworks that are Earlgrey and (soon) Espresso. It provides higher level APIs in JavaScript that interact with the two libraries to make tests on both platforms by only writing them once.
Automation Detox supports:
- Full native iOS applications
- Full native Android applications (soon)
- Full React Native applications
- Hybrid Native / React Native applications
Detox APIs are based on three:
1. Matchers like
await element(by.id('img')).tap();
2. Actions
await element(by.text('For rent')).tap();
3. Expectations
await expect(element(by.text('For rent'))).toBeVisible();
POC link for Detox:https://github.com/saifsms91/DetoxAutomationPoc
Comments
Post a Comment