#846 and #742 FIX by TikhomirovSergey · Pull Request #863 · appium/java-client

@TikhomirovSergey

@TikhomirovSergey

@TikhomirovSergey

@TikhomirovSergey

@TikhomirovSergey

@TikhomirovSergey

- DurationBuilder was added
- some changes in WithTimeout to provide backward compatibility
- refactoring of page object tools

@TikhomirovSergey

@TikhomirovSergey

mykola-mokhnach

private static final List<Class<? extends WebElement>> availableElementClasses = ImmutableList.of(WebElement.class,
RemoteWebElement.class, MobileElement.class, AndroidElement.class,
IOSElement.class, WindowsElement.class);
public static Duration DEFAULT_WAITING_TIMEOUT = ofSeconds(1);

Choose a reason for hiding this comment

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

final?

mykola-mokhnach

return Duration.of(withTimeout.time(), withTimeout.chronoUnit());
}

return Duration.of(MILLISECONDS.convert(withTimeout.time(), withTimeout.unit()), MILLIS);

Choose a reason for hiding this comment

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

is FOREVER the same as milliseconds?

Choose a reason for hiding this comment

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

I was forced to add defalt values (FOREVER and NANOSECONDS) for bacward compatibility (temporary). Comilation problems will occure otherewise. User will be forced to set both time units.

Choose a reason for hiding this comment

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

@mykola-mokhnach However
Can we consider FOREVER illegal value? I think it has some sense.

Choose a reason for hiding this comment

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

I don't know, but it for sure does not help to read and understand the code.

mykola-mokhnach

File app = new File(appDir, "ApiDemos-debug.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.APPIUM);

Choose a reason for hiding this comment

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

why this is changed?

Choose a reason for hiding this comment

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

It was for local debugging. Will revert it

SrinivasanTarget

@TikhomirovSergey

mykola-mokhnach