Skip to content

Conversation

robinGupta11392
Copy link
Contributor

@robinGupta11392 robinGupta11392 commented Mar 17, 2022

Change list

Fixed the logic of appending basepath to the Hub URL which fixes Issue #1660 - #1660.

AppiumDriverLocalService was not able to start with Appium CLI versions < 2 as the ping() method was not able to get the status URL properly. Fixed the logic of appending basepath to sanitise the user input and appending basepath with "/" in the end, if not provided by user.

Types of changes

What types of changes are you proposing/introducing to Java client?
Put an x in the boxes that apply

  • No changes in production code.
  • 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)

Details

Test Execution logs - https://gist.github.com/robinGupta11392/e8c37c7e10e03cd00a4d44d398402738
Issue fixed - #1660
Changed Classes:

  • ServerBuilderTest
  • AppiumDriverLocalService

Method Added:

  • sanitizeBasePath

Method Modified:

  • withBasePath

Test Added:

  • checkAbilityToStartServiceUsingBasePath

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 17, 2022

CLA Missing ID CLA Not Signed

@robinGupta11392 robinGupta11392 changed the title Fix for Issue #1660 - correction for ping method to get proper status URL in case of a basepath provided Fix: #1660 - correction for ping method to get proper status URL in case of a basepath provided Mar 17, 2022
…LocalService.java


Removing redundant parenthesis

Co-authored-by: Valery Yatsynovich <valfirst@yandex.ru>
@mykola-mokhnach mykola-mokhnach changed the title Fix: #1660 - correction for ping method to get proper status URL in case of a basepath provided fix: #1660 - correction for ping method to get proper status URL in case of a basepath provided Mar 18, 2022
…reviews

- replaced String#isBlank with StringUtils#isBlank for Java language compatibility
- introduced InvalidBasePathException to be thrown for blank/null/empty values of basepath
- basePath validations moved to the step of storing server arguments to give forward compatibility with Appium v2
fix: added extra test cases for more precisely testing basepath validations
@robinGupta11392
Copy link
Contributor Author

https://gist.github.com/robinGupta11392/19cb22749170119d791cbeb8e1a714b3 --> ServerBuilderTest execution logs with Appium V2 Beta 25 post the fix. It seems there is one Log test failing right from the moment i cloned it - maybe you guys can have a look for reference.

removed redundant validation of StringUtils#isBlank() on the basepath
replaced Assert#fail with Assert#assertThrows for the test cases
robinGupta11392 and others added 2 commits March 19, 2022 09:24
…eBuilder.java

Co-authored-by: Valery Yatsynovich <valfirst@yandex.ru>
Removed validations of exception message in the tests
Accepted the change from val to use checkArgument method from Preconditions class

@Test
public void checkAbilityToValidateBasePathForEmptyBasePath() {
assertThrows(IllegalArgumentException.class, () -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: you could add expected exception signature to Test annotations: https://www.guru99.com/junit-exception-test.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted with thanks.

@mykola-mokhnach mykola-mokhnach merged commit f62b9d1 into appium:master Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants