paypal / SeLion

Enabling Test Automation in Java
http://selion.io
Apache License 2.0
281 stars 233 forks source link

code-generator does not work for PageYaml with "android" platform #184

Closed mach6 closed 9 years ago

mach6 commented 9 years ago

From http://paypal.github.io/SeLion/html/documentation.html#android-native-page-yaml

This (corrected with ending " on locators) example PageYaml does not work

baseClass: "com.paypal.selion.testcomponents.BasicPageImpl"
platform: "android"
defaultLocale: "US"
elements:
  shortPressButtonUiObject:
    locators:
      FR: "//TintButton[@value='Short Press']"
      US: "//TintButton[@value='Short Press']"
  shortPressLabelUiObject:
    locators:
      FR: "//TextView[contains(@value, ', short press')]"
      US: "//TextView[contains(@value, ', short press')]"

the resulting error is

[ERROR] SeLion code generator failed when generating code for {file}
[ERROR] Root Cause :
[ERROR] java.lang.IllegalArgumentException: Detected an invalid key [shortPressLabelUiObject] in data file {file} for Platform Android
mach6 commented 9 years ago

@ysecaran FYI

mach6 commented 9 years ago

The workaround for this is to add the SeLion supported elements as custom elements in the code-generator plugin config of your project pom -- See section "Configuration Parameters for Customizing the Code Generator Maven Plugin" in http://paypal.github.io/SeLion/html/documentation.html#what-is-code-generator

               <configuration>
                    <androidCustomElements>
                        <androidCustomElement>
                            com.paypal.selion.platform.mobile.android.UiObject
                        </androidCustomElement>
                        <androidCustomElement>
                            com.paypal.selion.platform.mobile.android.UiButton
                        </androidCustomElement>
                        <androidCustomElement>
                            com.paypal.selion.platform.mobile.android.UiOTextView
                        </androidCustomElement>
                    </androidCustomElements>
                </configuration>
mach6 commented 9 years ago

this is fixed with 78c88f2