GithubHelp home page GithubHelp logo

android-ui-testing's Issues

New typing implementation doesn't work on API 28

EditTextTest

at com.avito.android.ui.test.EditTextTest.writesCyrillicText(EditTextTest.kt:33)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:527)
    ...
     Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchFieldException: No field mIInputContext in class Landroid/view/inputmethod/InputMethodManager; (declaration of 'android.view.inputmethod.InputMethodManager' appears in /system/framework/framework.jar!classes2.dex)


Improve ListElement interface

The current implementation has several disadvantages:

  • There is no default implementation for indexed access to list elements like operator fun get(position: Int): T, first(): T, last(): T, etc.
  • childFactory creates only PageObjectElements, there is no way to create custom children for list item
  • In most cases we have to manually pass the same actions/checks params to PageObjectElement constructor
  • #7

Also, ListActions class has a few members that are not actions (like items, translationY, verticalOffset, horizontalOffset), we can make them private

Consider improving ListElement methods signatures?

val view: PageObjectElement = typedItemByMatcher(withId(R.id.payment_loading_view)) will actually find item by position:

Check descendant view with id: com.avito.android.dev:id/payment_loading_view on 0-th item matching: holder with view

because it calls the overload typedItemByMatcher( matcher: Matcher<View>, position: Int = 0 )

Might be confusing.

Silent clicks on non-clickable views

Click on non-clickable view performs silently without any errors.
It's difficult to find a bug when it happens accidentally and it's better to check it manually.

Add useful runner impl

DoD: user can compose the best runner for own needs, based on AndroidJUnitRunner

Useful hacks are not obvious, one has to know the internals of AndroidJUnitRunner to create a custom testing experience.

Here we introduce samples of what one can get.

Setup CI

Travis? circleCI?
We need best choice for instrumentation tests

Assertions redesign

problems with current design:

  • not easy to expand/reuse, checks tightly coupled
  • no group assertions (run all group, composite report)
  • probably syntax

"what i don't like in espresso assertions" (already fixed):

  • not typed, you can assert anything on every element
  • recyclerView assertions are hacked actions in espresso-contrib library
  • you can't add obligatory action before assertion (it makes sense in recyclerView with scroll at least)
  • unable to customize error messages

Synax proposal:

assertJ Like:

assertThat([description], element).<autocomplete with typed assertions>

for grouped (not sure if it's possible just like that):

assertThat([description]) {
       element.<assertion>
       element2.<assertion>
}

Open top level function

https://github.com/robstoll/atrium has brilliant idea to leave top-level function naming and config open for library user, we should consider it too

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.