cavy-extension
Cavy is a cross-platform integration test framework for React Native.
Cavy-extension extends the functionality of cavy.
- It simplied the steps in component testing and enable user only need to be focused only on authoring test spec and test pages.
- User only need to provides a testpage, a key which associate swith the testpage. And toTestPage would help to navigate directly to the test page.
- Allow user to extend the functionality of TestScope and provides IntelliSense when authoring spec.
Steps to authoring test case
- Write a simple UI test page.
const ExampleTestPage1 = { const generateTestHook = ; const text setText = ; return <TextInput placeholder="ExampleTestpage 1" onChangeText= value=text ref= />;};
- Aggregate the testpages with keys. For example: Example1
const TestPages: Array<ITestPage> = key: 'Example1' title: 'TestExample by import {ExampleTestPage1}' page: ExampleTestPage1 key: 'Example2' title: 'TestExample by import ExampleTestPage' page: ExaExampleTestPage2
- Write the spec. toTestPage('Example1') helps to navigate to test page.
await spec2;
Functionality of this extension
-
Provides a simple testapp, test main page, back button on subpage. and toTestPage to help the navigation.
- Test main page
![testcaselist](https://user-images.githubusercontent.com/6290692/59141800-3af13080-8968-1 1e9-9b27-dfd7b9e130ea.png)
- Test sub page
-
Add your own functionality to spec and inject it to spec. like Spec2
{ spec;
Or
{ let spec2: SpecHelper = spec; spec;
- A typescript project IntelliSense for spec or spec2 in IDE.
Test Example