Less strict verification by mykola-mokhnach · Pull Request #795 · appium/java-client

Conversation

@mykola-mokhnach

Change list

moveTo fix is not deployed to Appium yet, so it's OK to allow clients to still use relative coordinates. I've also added a note about the problem into the docstring.

Types of changes

  • 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)

Mykola Mokhnach added 3 commits

December 19, 2017 20:56

TikhomirovSergey

* @return self-reference
*/
public T withCoordinates(int xOffset, int yOffset) {
checkArgument(xOffset >= 0, format(ERROR_MESSAGE_TEMPLATE, "X"));

Choose a reason for hiding this comment

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

Is it temporary change for backward compatibility with older servers versions?
I think it is not necessary to remove it. Just comment it, maybe with the TODO mark.
And before the publishing of the 6.0.0 we can remove //

Choose a reason for hiding this comment

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

There might be a situation when it is necessary to provide negative absolute coordinates. For example, if the device has two screens and the second screen is located on the left side of the main one. That is why I'd consider this restriction as not very useful.

Choose a reason for hiding this comment

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

Also, it is possible that one wants to drag an element to an off-screen area and negative coordinates might also have sense for such case.

Choose a reason for hiding this comment

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

I agree with @mykola-mokhnach. I tried using java-client 6.0.0-BETA1, but I was needed to rollback due to the new limitation: we have cases when actions start at the screen, but end out off screen.

TikhomirovSergey

final List<Runnable> invalidOptions = new ArrayList<>();
invalidOptions.add(() -> waitOptions(ofMillis(-1)));
invalidOptions.add(() -> new ElementOption().withCoordinates(0, 0).withElement(null));
invalidOptions.add(() -> new PointOption().withCoordinates(0, -1));

Choose a reason for hiding this comment

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

Just comment I think

@TikhomirovSergey

@TikhomirovSergey

Will publish it on this weekend

TikhomirovSergey