I have a slider library with name react-native-slider i am using this library to render movable slider on my screen. So Now I want to write it’s detox test I am trying this but i am not getting any successful attempts.
I have attached the below code.
My Code Slider UI code
<View style={{paddingHorizontal: 25}} testID={Test.sliderThumbDrag}>
<Slider
thumbStyle={{ backgroundColor: colors.white, borderWidth: 2, borderColor: colors.black }}
minimumTrackTintColor={colors.black}
maximumTrackTintColor={colors.border}
trackStyle={{ height: 2 }}
minimumValue={1}
maximumValue={250}
value={requestData ? requestData.max_distance : null}
step={1}
style={{ marginTop: 12 }}
onValueChange={(value) => {
let newRequestData
if (requestData) {
newRequestData = { ...requestData, max_distance: value }
}
setRequestData(newRequestData);
}}
/>
</View>
My UserFlowDating.e2e.js file
it('Discovery Filter should render', async () => {
await waitFor(element(by.id(Test.discoveryFilterDatingView))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id(Test.headerDiscoveryView))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id(Test.discoveryScrollView))).toBeVisible().withTimeout(5000);
await waitFor(element(by.id(Test.sliderThumbDrag))).toBeVisible().withTimeout(5000);
await element(by.id('Animated')).longPressAndDrag(2000, NaN, NaN, element(by.id('Animated')), NaN, NaN);
await waitFor(element(by.id(Test.discoveryScrollView))).toBeVisible().withTimeout(5000);
});
I am trying to silde it with detox but it’s not working for me. Anyone can please help me with this thanks 🙏