Skip to content

(@wdio/appium-service): make Appium start on a random port#11757

Merged
christian-bromann merged 2 commits intomainfrom
cb/appium-random-port
Nov 28, 2023
Merged

(@wdio/appium-service): make Appium start on a random port#11757
christian-bromann merged 2 commits intomainfrom
cb/appium-random-port

Conversation

@christian-bromann
Copy link
Member

Proposed changes

This patch makes the Appium service start on a random port instead of always the same default port. This makes using the service a bit simpler as the user might have other Appium processes running unrelated to their test run with the service.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Nov 28, 2023
@christian-bromann christian-bromann merged commit 1f75511 into main Nov 28, 2023
@christian-bromann christian-bromann deleted the cb/appium-random-port branch November 28, 2023 19:49
Comment on lines +132 to +138
/**
* Get port from service option or use a random port
*/
const port = typeof this._args.port === 'number'
? this._args.port
: await getPort({ port: DEFAULT_APPIUM_PORT })
this._setCapabilities(port)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christian-bromann it feels like you missed adding the new port value to the _appiumCliArgs arr...

this._appiumCliArgs.push(...formatCliArgs({ port }))

Without the line above, it tries to start the appium on port 4723, even logs say different port value...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind raising a PR with a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Polish 💅 PRs that contain improvements on existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants