-
-
Notifications
You must be signed in to change notification settings - Fork 758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalization of the Widget feature #669
Conversation
…t were added also old tests were removed
…get are handled now
…essionDetails#isBrowser now and the order of imports was improved
…app was added ...also some improvements
- all test were added - checkstyle issues were fixed
@SrinivasanTarget @mykola-mokhnach could you take a look at this PR? |
It's huge O_O. Probably, this will take some time |
@mykola-mokhnach. Ok. Don't hurry and be watchful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The review is still in progress...
@@ -83,10 +86,19 @@ | |||
return getConvenientClass(declaredClass, annotatedElement, ANDROID_UI_AUTOMATOR); | |||
} | |||
|
|||
if (IOS.equalsIgnoreCase(transformedPlatform) && AutomationName.IOS_XCUI_TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather added this condition under single IOS.equalsIgnoreCase(transformedPlatform)
condition. One might forget about the fact, that conditions order matters here, having the current implementation.
.orElse(getByFromDeclaredClass(WhatIsNeeded.DEFAULT_OR_HTML)); | ||
} | ||
|
||
@Override protected By buildMobileNativeBy() { | ||
return Optional.ofNullable(super.buildMobileNativeBy()) | ||
return ofNullable(super.buildMobileNativeBy()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the super.buildMobileNativeBy
marked as Nullable?
} | ||
|
||
@Override | ||
public void get(String url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably, such empty method tucbs should also have some comment in the body to make linter happy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mykola-mokhnach FIXED
} | ||
|
||
public <T extends Widget> List<T> getSubWidgets() { | ||
return of(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot say this is very readable %)
} | ||
|
||
public String toString() { | ||
return getWrappedElement().toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can getWrappedElement return null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
|
||
@Override | ||
public String toString() { | ||
return by.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can by be equal to null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mykola-mokhnach I have fixed the code. Please take a look at the
https://github.com/appium/java-client/pull/669/files/0db6a3093c6bb64f07e4f85c907da22452c293b1#diff-8d9d46cd20efb5a5c8a11fef4fc8e5e4R22
Also this situation is not possible in production code
|
||
@Override | ||
public void checkACommonWidget() { | ||
defaultTest(app.getWidget(), app.getWidgets(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a better name for this method?
*/ | ||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return asList(new Object[][] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Arrays.asList also supports simple objects (T... item
) as parameters
.map(widget -> widget.getSelfReference().getClass()).collect(toList()))); | ||
|
||
assertThat(classes, | ||
contains(widgetClass, widgetClass, widgetClass, widgetClass)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please explain what is being verified here?
@iOSXCUITFindBy(iOSNsPredicate = "SOME_XCUIT_DEFAULT_LOCATOR") | ||
private List<DefaultIosWidget> multipleIosWidgets; | ||
|
||
private AnnotatedIosWidget singleAnnotatedIosWidget; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these properties be annotated as well?
|
||
public static String WINDOWS_SUB_WIDGET_LOCATOR = "SOME_SUB_LOCATOR"; | ||
|
||
@WindowsFindBy(windowsAutomation = "SOME_SUB_LOCATOR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: format
@iOSXCUITFindBy(iOSNsPredicate = "SOME_XCUIT_DEFAULT_LOCATOR") | ||
private List<DefaultWindowsWidget> multipleIosWidgets; | ||
|
||
private AnnotatedWindowsWidget singleAnnotatedIosWidget; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing annotations?
return APPIUM; | ||
} | ||
|
||
public boolean isBrowser() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Override?
@mykola-mokhnach Ok. I'm working on you remarks. |
- comments for stub void methods - method and classes were renamed.
public void checkACommonWidget() { | ||
defaultTest(app.getWidget(), app.getWidgets(), | ||
public void commonTestCase() { | ||
testLogigByDefault(app.getWidget(), app.getWidgets(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is "Logig"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is typo :)
protected WidgetTest(AbstractApp app, WebDriver driver) { | ||
this.app = app; | ||
initElements(new AppiumFieldDecorator(driver), app); | ||
} | ||
|
||
@Test | ||
public abstract void checkACommonWidget(); | ||
public abstract void commonTestCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is recommended having a verb in method names
IosUIAutomation(IOS_DEFAULT_WIDGET_LOCATOR), IosUIAutomation(IOS_SUB_WIDGET_LOCATOR)); | ||
} | ||
|
||
@Override | ||
public void checkAnAnnotatedWidget() { | ||
defaultTest(((ExtendedApp) app).getAnnotatedWidget(), ((ExtendedApp) app).getAnnotatedWidgets(), | ||
public void checkCaseWhenWidgetClassHasDeclaredLocatorAnnotation() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Change list
missed parameters of the
OverrideWidget
were addedsome improvements which are related to latest API changes were made.
tests were refactored. Now it is supposed to use unit test for this feature
Types of changes