selenium-webdriverwebdriver-iowdio-v5

Way to implement resetApp for React Native with wdio-cli/? - webdriverio


Hellow there! I am using the wdio/cli so I created the wdio.conf.js with this command, then I start doing the test. But the issues is when have more than one test in a single or multiple test files.

In the test file I have something like this:

 beforeEach(async function() {
    $('~home').waitForDisplayed(81000, false);
  });

Where home tag is a tag in the first view when the app runs in first screen. And appear this error:

 element ("~home") still not displayed after 10000ms

So need to do kind of driver.resetApp()/ But dont know how to do it, what import do I need to do etc.


Solution

  • Did you try resetApp? You can't user driver as "main object" - Everything is under browser variable. Try this

    //async
    await browser.resetApp(); 
    
    //sync
    browser.resetApp();
    

    Check Appium doc + wdio documentation.