Skip to content

[🐛 Bug]: Appium service is not starting against local emulator using latest versions. #12094

@lararojasmr

Description

@lararojasmr

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

latest

Mode

WDIO Testrunner

Which capabilities are you using?

{
  "platformName": "Android",
  "port": 4723,
  "appium:automationName": "UiAutomator2",
  "appium:deviceName": "Android",
  "appium:appPackage": "com.cimobileapp",
  "appium:appActivity": ".MainActivity"
}

What happened?

The problem is that the test runner start but the appium service is stuck in some place that i'm not able to log. I was seeing the @christian-bromann changes in the latest versions and I saw that there was a changes in this part related to the port, etc. Also, this spawn process that not have a timeout so the wdio could be hanging out for hours, becuase the failure occur in the OnPrepare in the appium service, so the wdio timeout is not working in that level.

I have my app running in local, using android studio, i tried removing the port, the hostname, adding it to the capabilities, configuration.

Some log:

`2024-01-25T23:59:39.345Z INFO @wdio/appium-service: Will spawn Appium process: node /Users/mlara/intive/sony/qa-automation/node_modules/appium/index.js --base-path / --allow-insecure get_server_logs
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2024-01-26T00:01:59.928Z INFO @wdio/local-runner: Shutting down spawned worker
2024-01-26T00:01:59.948Z ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
Error: Appium exited before timeout (exit code: 0)
dbug
at ChildProcess. (file:///Users/mlara/intive/sony/qa-automation/packages/e2e-ci-automation/node_modules/@wdio/appium-service/build/launcher.js:151:24)
at Object.onceWrapper (node:events:634:26)
at ChildProcess.emit (node:events:519:28)
at ChildProcess.emit (node:domain:488:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12)

Continue...
2024-01-26T00:01:59.948Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 140609ms
2024-01-26T00:01:59.951Z INFO @wdio/cli:launcher: Run onComplete hook
2024-01-26T00:01:59.951Z DEBUG @wdio/cli:utils: Finished to run "onComplete" hook in 0ms`

Note: If i take this command: node /Users/mlara/intive/sony/qa-automation/node_modules/appium/index.js --base-path / --allow-insecure get_server_logs and execute from a terminal, the appium is started as expected.

Service Configuration:

defaultConfig.port = 4723; // default appium port
defaultConfig.hostname = 'localhost';
defaultConfig.logLevel = 'debug';

defaultConfig.services = defaultConfig.services || [];
defaultConfig.services.push([
  'appium',
  {
    logPath: './results/logs',
    args: {
      'allow-insecure': 'get_server_logs',
    },
  },
]);

What is your expected behavior?

The service started and the test is executed.

How to reproduce the bug.

has a apk running in UAutomatior2 in android studio, appium and execute a mobile test case using testrunner against this emulated apk.

i'm not able to share with you my apk because is from my work.

Relevant log output

The console show only:
mlara@Manuels-MacBook-Pro e2e-ci-automation % AUT_CAPS=android node ./bin/automation.js run -c mobile-local

Execution of 1 workers started at 2024-01-25T23:59:39.224Z
^C

Ended WebDriver sessions gracefully after a SIGINT signal was received!

mlara@Manuels-MacBook-Pro e2e-ci-automation % 
Spec Files:      0 passed, 1 total (0% completed) in 00:02:20

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

Labels

Bug 🐛help wantedIssues that are free to take by anyone interested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions