CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

I.waitForElement() not Working after last Update in Android

Open eduardofinotti opened this issue 7 years ago • 4 comments

What are you trying to achieve?

I.waitForElement() not Working after last Update in Android. I'm trying: I.waitForElement("#com.gastro.dev:id/next").

What do you get instead?

Before update "I.waitForElement()" in Android was waiting until I see the element in screen. But now I have this problem in execute the same command:


-- FAILURES:

  1) Login
       Login with e-mail and password on first use:
     Promise was rejected with the following reason: Error: Locator Strategy 'css selector' is not supported for this session

  Scenario Steps:

  - I.runOnAndroid(() => {
        I.waitForElement(this.android.initialBoard.continue, 10);
        //I.waitForText('PULAR', 10);
        I.tap(this.android.initialBoard.continue);

        //I.waitForElement(this.android.initialBoard.letsGo, 10);
        I.waitForText('INICIAR', 10);
        I.tap(this.android.initialBoard.letsGo);
      }) at Object.accessAndPrepareApp (pages/home_page.js:75:7)
  - I.wait(1) at Test.Scenario (step_definition/login_test.js:9:5)

Provide test source code if related

// paste test

Details

  • CodeceptJS version: 2.0.2
  • NodeJS Version: v10.14.2
  • Operating System: macOS Mojave
  • Protractor || WebDriverIO 5.2.4 || Nightmare version (if related)
  • Configuration file:
{
  "tests": "../step_definition/login_test.js",
  "timeout": 10000,
  "output": "../output",
  "helpers": {
    "Appium": {
      "host": "127.0.0.1",
      "port": 4723,
      "app": "/Users/xxxxxxx/Desktop/app-dev.apk",
      "platform": "Android",
      "restart": "true",
      "useNewWDA": true,
      "wdaLaunchTimeout": "999999999",
      "wdaConnectionTimeout": "999999999",
      "newCommandTimeout": "5000",
      "desiredCapabilities": {
        "useNewWDA": true,
        "appPackage": "com.xxxxxxx.xxxxx.dev",
        "appActivity": "com.xxxxxx.xxxxx.modules.xxxxx",
        "deviceName": "xxxxxxx",
        "platformVersion": "x.x",
        "newCommandTimeout": "5000"

      }
    }

  },
  "include": {
    "I": "../steps_file.js",
    "homePage": "../pages/home_page.js"
  },
  "bootstrap": false,
  "mocha": {},
  "name": "codeceptjs-mobile"
}

I sad this change in code:

screen shot 2019-01-08 at 10 09 20

eduardofinotti avatar Jan 08 '19 11:01 eduardofinotti

Same problem here!

narlei avatar Jan 08 '19 12:01 narlei

Ok, looks like it guessed thius to be a CSS locator because of # I.waitForElement("#com.gastro.dev:id/next").

DavertMik avatar Jan 10 '19 21:01 DavertMik

I hope this can be fixed in #1434

DavertMik avatar Jan 10 '19 21:01 DavertMik

But now, I have this error:

Promise was rejected with the following reason: Error: selector needs to be typeof string or function

Using the same code of this bug

eduardofinotti avatar Jan 11 '19 13:01 eduardofinotti