Switching context from native to webview chrome incognito and how to wait long enough

Hi,

I just started using this automation and I need your advise as I am not sure what I am missing and on which channel I can ask for help.

The automation I have to do is switching between our app for android the apk and switching the context to web site change some stuff, switch back to app and check and so on.

Now I manage to drive the app check what I have to do, switching to the web and login
I have the following problems:

  1. to land on the home page takes quite long, I do not know how to tell to wait long enough until the dashboard is visible and it looks that the test is moving forward closing
  2. if i. try to run the tests again it looks like when i go to my website url I am already logged in so I have to go manually to logout. How can we switch the context to an incognito browser so I don’t want to be logged in when I re run the tests

here is what i try, is commented out and note the url and and credentials are wrong h=just to pass sensitife info

        await driver.switchContext('WEBVIEW_chrome')
        //await driver.pause(3000)

        //await $('android.widget.EditText').addValue("[email protected]");
        await $('//*[@id="username"]').click();
        await $('//*[@id="username"]').addValue("[email protected]" +"\n");
        await $('//*[@id="password"]').addValue("Test1234!"+"\n");
        //driver.setTimeouts(70000
        await driver.pause(10000)
        //await browser.setTimeout({ 'pageLoad': 90000 })
        //await driver.pause(10000);
        //await driver.pause(2000)
        //browser.refresh();
        //await browser.setTimeout({ 'pageLoad': 80000 })
        //await driver.pause(4000)
        //await $('//*[@text="DevCycle"]').waitForVisible(3000)

//switch back context to app
        
        await driver.switchContext('NATIVE_APP')
        await driver.back();
        await driver.pause(3000)
        
        //continue with the app

Thank you.

Please tell me on which channel is the best to communicate.
Cristina