Giter Site home page Giter Site logo

barista's People

Contributors

adrielcafe avatar ahmedgamal92 avatar alorma avatar crgarridos avatar danieldisu avatar deanpike avatar esteveaguilera avatar etorralbo avatar g00m avatar glureau-betclic avatar handstandsam avatar jamesbluecrow avatar laggedhero avatar minibugdev avatar moutyque avatar onivas avatar ozmium avatar rocboronat avatar rohitkaradkar avatar rubikovitch avatar sarn0ld avatar serchinastico avatar sergiandreplace avatar sergiocastilloscmspain avatar sloy avatar smassive avatar stavares843 avatar tiagoalmeida92 avatar vykintas avatar zhenleiji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

barista's Issues

Perform scrolls before all actions to avoid issues when changing phones

A test could pass on your phone, and crash in the C.I. emulator because it's smaller than yours. That makes development phase slower. If Barista just tries to scroll to a View before writing into it or doing whatever action, tests will be less Flaky.

It just happened on the InfoJobs app, trying to open a Spinner that was only 90% visible ๐Ÿ˜ข

Swipe a ViewPager N times

Right now, if you want to swipe forward a ViewPager 10 times, you have to call swipeViewPagerForward ten times. It could be great if you can delegate this ugly for to Barista.

Create a rule to delete files

Some apps (like Fotocasa one) save things on the disk. So, to isolate tests, we need to remove it before running the test.

Let's write a lovely Rule that removes the app files before running the test.

Change the ViewPager methods to apply only on displayed widgets

In one case, we have a ViewPager inside a ViewPager. Then, the ViewPager that we want to move is repeated over lots of times inside another ViewPager. That makes Espresso to launch a "multiple ViewPagers match that ID". But well, obviously, we want to interact with the ViewPager that is visible.

So:

onView(allOf(ViewMatchers.withId(R.id.the_id), ViewMatchers.isDisplayed())).perform( new ViewAction[] { ViewActions.swipeLeft() });

Avoid asking for an ID if there is only one ViewPager

If I'm in a screen with only one ViewPager, why do I need to say swipePagerForward(viewId)? I just want to say swipePagerForward(). In addition, it will prevent the test of breaking if someone refactors the layout.xml while using a gradle flavor different than the test one.

assertDisplayed doesn't work when multiple views matches the text

We found a case that I think Barista should handle.
In an Activity we had multiple views with the same text "Banana", and we were doing assertDisplayed("Banana") to verify that the data had been loaded and displayed.

Espresso fails because multiple views match the condition withText().

From the perspective of someone using Barista and reading the method assertDisplayed, I think it should work. What do you guys think???

Migrate to Kotlin

Well it's obvious, isn't it?

There's too much Java in this project.

Move internal classes to an internal package

We have many classes in Barista. Visible ones.

I think it would be a good idea to use packages to separate the public API and the internal classes. I've seen this in many libraries.
It means moving all classes intended for internal usage to an internal subpackage.

What do you think @rocboronat?

RecyclerView click actions don't work on wrapped views

The method BaristaRecyclerViewActions.performClick() only works when the itemView of the ViewHolder has the clickListener for the row.
If the clickListener is setted on a children view, the click is not dispatched to it.

For example, when the ItemView contains the clickable row AND a separator/shadow below. Or when using custom Adapters that wrap your view inside another one (like https://github.com/emilsjolander/StickyListHeaders).

The problem seems to be with clickUsingPerformClick() method, which calls performClick() on the specific ItemView, and doesn't let the click pass through its children.

click(id) doesn't work when multiple views in the hierarchy

When I click close_button:

1495025046092

I get error android.support.test.espresso.AmbiguousViewMatcherException: 'with id: com.schibsted.android.rocket.kufar.debug:id/close_button' matches multiple views in the hierarchy. Problem views are marked with '****MATCHES****' below.

screen shot 2017-05-17 at 5 38 45 am

Permission Error

@Test
public void validateInputText() {
	PermissionGranter.allowPermissionsIfNeeded(Manifest.permission.WRITE_EXTERNAL_STORAGE);
	onView(withId(R.id.fragment_input_id_number)).perform(typeText(SIMPLE_INT)).check(matches(withText(SIMPLE_INT)));
}

description

I setting app to request permission first the first time running, I saw the dialog is out, But this code didn't click allow, and I cause NoActivityResumedException

Image

screen shot 2560-05-21 at 2 25 38 pm

Run task :library:mavenAndroidJavadocs on PRs

To avoid failures while deploying because of JavaDoc, we should also run the task :library:mavenAndroidJavadocs on PRs. Otherwise it will only run when we try to make a release, and fail miserably.

Assert No Duplicate Menu

Hi.

I had a situation today where some menu options were duplicated after refreshing view (tl&dr; using swipe to refresh)

Is there any way to use Barista to check this case? (That view is not duplicate)

Assertion for EditText errors

We could have an assertion for EditText error field, that handles both the native "setError" and the pretty one from TextInputLayout.

Add the download section in the readme

The library is missing the most important thing:

How to download!
A short copy&paste of gradle's "compile" line in the readme is the difference between success or failure. Doctors said.

Click() method name conflicts with Espresso's click()

When writing tests with the auto-imports enabled, using the click(id) from Barista becomes a bit painful because Espresso has another static click() method, and Android Studio will automatically import the Espresso one first, forcing you to manually remove the import and use the Barista one.

This is an issue I've faced myself, and also I've been told by others (hi @MarinaTov!).

My proposal is to rename the static click(id) methods to something like clickOn(id) so we don't conflict with Espresso.
The old methods should probably be maintained to avoid breaking the public API, but at least deprecate them.

Disable unwanted PR merging options

By default the three merging options are enabled (merge, squash&merge, rebase&merge).
We should always merge PRs the same way, so leaving only the prefered option could avoid mistakes.

We've been using the squash&merge option, so we should disable the other two.

Same Id matches multiple views in the hierarchy

Having a view pager with multiple fragments, we are not able to click on one of the items because they have both the same id.
When trying to get the item by id ViewMatchers.withId(R.id.offer_list_recyclerview) we get the following exception from espresso:
android.support.test.espresso.AmbiguousViewMatcherException:

The solution that we found is:

    sleep(1000);
    Espresso.onView(allOf(ViewMatchers.withId(R.id.offer_list_recyclerview), isDisplayed())).perform(new ViewAction[] {
        RecyclerViewActions.actionOnItemAtPosition(0, PerformClickAction
            .clickUsingPerformClick())
    });

With the isDisplayed() we filter the views to match only the ones that are on the screen, so other fragments doesnt influence.
Since we are doing a swipe just before clicking, we need to wait until the swipe finish so there is only one visibile (thats why we put the sleep)

Enjoy.

Click on a OverFlow hidden Menu

In order to click on a Menu that is hidden by a Overflow i need to do:

        onView(withClassName(endsWith("OverflowMenuButton"))).perform(ViewActions.click());
        click(R.id.profile_logout_action);

It would be great to have a simple click(R.id.profile_logout_action)or maybe better: clickMenu(R.id.profile_logout_action)

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.