Finalization of the Widget feature#669
Finalization of the Widget feature#669TikhomirovSergey merged 13 commits intoappium:masterappium/java-client:masterfrom TikhomirovSergey:masterCopy head branch name to clipboard
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. |
mykola-mokhnach
left a comment
There was a problem hiding this comment.
The review is still in progress...
| return getConvenientClass(declaredClass, annotatedElement, ANDROID_UI_AUTOMATOR); | ||
| } | ||
|
|
||
| if (IOS.equalsIgnoreCase(transformedPlatform) && AutomationName.IOS_XCUI_TEST |
There was a problem hiding this comment.
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.
|
|
||
| @Override protected By buildMobileNativeBy() { | ||
| return Optional.ofNullable(super.buildMobileNativeBy()) | ||
| return ofNullable(super.buildMobileNativeBy()) |
There was a problem hiding this comment.
is the super.buildMobileNativeBy marked as Nullable?
| } | ||
|
|
||
| @Override | ||
| public void get(String url) { |
There was a problem hiding this comment.
probably, such empty method tucbs should also have some comment in the body to make linter happy
| } | ||
|
|
||
| public <T extends Widget> List<T> getSubWidgets() { | ||
| return of(); |
There was a problem hiding this comment.
I cannot say this is very readable %)
| } | ||
|
|
||
| public String toString() { | ||
| return getWrappedElement().toString(); |
There was a problem hiding this comment.
can getWrappedElement return null?
|
|
||
| @Override | ||
| public String toString() { | ||
| return by.toString(); |
There was a problem hiding this comment.
can by be equal to null?
There was a problem hiding this comment.
@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.
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.
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.
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.
should these properties be annotated as well?
|
|
||
| public static String WINDOWS_SUB_WIDGET_LOCATOR = "SOME_SUB_LOCATOR"; | ||
|
|
||
| @WindowsFindBy(windowsAutomation = "SOME_SUB_LOCATOR") |
| @iOSXCUITFindBy(iOSNsPredicate = "SOME_XCUIT_DEFAULT_LOCATOR") | ||
| private List<DefaultWindowsWidget> multipleIosWidgets; | ||
|
|
||
| private AnnotatedWindowsWidget singleAnnotatedIosWidget; |
There was a problem hiding this comment.
missing annotations?
| return APPIUM; | ||
| } | ||
|
|
||
| public boolean isBrowser() { |
|
@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.
It is typo :)
|
|
||
| @Test | ||
| public abstract void checkACommonWidget(); | ||
| public abstract void commonTestCase(); |
There was a problem hiding this comment.
it is recommended having a verb in method names
| @Override | ||
| public void checkAnAnnotatedWidget() { | ||
| defaultTest(((ExtendedApp) app).getAnnotatedWidget(), ((ExtendedApp) app).getAnnotatedWidgets(), | ||
| public void checkCaseWhenWidgetClassHasDeclaredLocatorAnnotation() { |
Change list
missed parameters of the
OverrideWidgetwere 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