jeudi 8 avril 2021

Appium setTimeout end to end testing in React Native

I'm using the following code for a timeout in React Native

const [__, setIsActive] = useState(true)

setTimer(previousTimer => {
            clearTimeout(previousTimer)
            return setTimeout(handleTimeout, timeout)
        })

const handleTimeout = useCallback(() => {
        setIsActive(false)

        handleInactive()
    }, [setIsActive])

The timeout is set for 5 min, in the end to end testing I want to test the code that should executed once the timeout finishes, how can I accomplish that in Appium? Do I really need to wait for those 5 min?

Aucun commentaire:

Enregistrer un commentaire