Releases: open-tool/ultron
Improved framework extensions
2.0.4
Update build tools version to 33.0.1
Add Espresso TextView color assertions:
fun hasCurrentTextColor(@ColorRes colorRes: Int)
fun hasCurrentHintTextColor(@ColorRes colorRes: Int)
fun hasShadowColor(@ColorRes colorRes: Int)
fun hasHighlightColor(@ColorRes colorRes: Int)
For example:
<TextView
android:id="@+id/last_event_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorPrimary"
android:textColorHint="@color/colorHint"
android:shadowColor="@color/colorShadow"
android:textColorHighlight="@color/colorHighlight"
android:text="@string/button_text" />
Could be asserted by
fun assertTextViewColors() {
withId(R.id.last_event_status)
.hasCurrentTextColor(R.color.colorPrimary)
.hasCurrentHintTextColor(R.color.colorHint)
.hasShadowColor(R.color.colorShadow)
.hasHighlightColor(R.color.colorHighlight)
}
2.0.3
New cool feature:
- Custom assertion of any operation - read wiki
New cool exception message.
- It contains a full history of exceptions that happened during operation performance
- It provides a detailed an clear information of that's going on wrong.
(feedback is appreciated)
Simplified Ultron extensions:
If you already have custom operations, you are going to find deprecated methods. Custom operation assertion is not working with deprecated extensions. Please modify your extensions.
It's really easy to support, just delete several lines and use new methods as it's described in samples.
Deleted - EspressoActionType.CUSTOM. In case you use it just delete the line. By default will be used CommonOperationType.DEFAULT.
Compose rule factory methods
Add new methods to create compose rule:
fun createDefaultUltronComposeRule(): ComposeContentTestRule
fun createEmptyUltronComposeRule(): ComposeTestRule
Compose support
An amazing support of compose UI testing.
Read wike to know how it works
Espresso 3.4.0
Upd Espresso libs versions to 3.4.0 and also some other libs.
Upd javaCompatibility version to JavaVersion.VERSION_1_8
1.0.18
#17 Add click actions on different view points:.
- clickTopLeft(offsetX: Int = 0, offsetY: Int = 0)
- clickTopCenter(offsetY: Int)
- clickTopRight(offsetX: Int = 0, offsetY: Int = 0)
- clickCenterRight(offsetX: Int = 0)
- clickBottomRight(offsetX: Int = 0, offsetY: Int = 0)
- clickBottomCenter(offsetY: Int = 0)
- clickBottomLeft(offsetX: Int = 0, offsetY: Int = 0)
- clickCenterLeft(offsetX: Int = 0)
Thanks to @flotnik
1.0.17
1.0.16
Features:
- #14 Add scroll offset param for UltronRecyclerView item providers
scrollOffset: Int = 0
specifies an amount of items that are scrolled from target one.
//affected methods
item(..., scrollOffset: Int = 0): UltronRecyclerViewItem
firstItemMatched(..., scrollOffset: Int = 0): UltronRecyclerViewItem
itemMatched(..., scrollOffset: Int = 0): UltronRecyclerViewItem
lastItemMatched(..., scrollOffset: Int = 0): UltronRecyclerViewItem
getItem(..., scrollOffset: Int = 0): T
getFirstItemMatched(..., scrollOffset: Int = 0): T
getItemMatched(..., scrollOffset: Int = 0): T
getLastItemMatched(..., scrollOffset: Int = 0): T
You don't need to worry about out of range error. In case item position + scrollOffset
is greater then RecyclerView size it is scrolled to the last item.
- #14 Add method for UltronRecyclerView:
assertNotEmpty()
throws an exception if RecyclerVIew is empty.
1.0.15
Features:
-
#12 Add
exists()
assertion for espresso.
It throws an exception if view doesn't exist in hierarchy.
Add this method forMatcher<View>, ViewInteraction, DataInteraction
-
#12 Add the name of the rule as description param of
ConditionsExecutor.execute
method
Read Add your SetUps and TearDowns to Allure report for details.
Fix:
- #13 modified item search to avoid
Can't create handler inside thread that has not called Looper.prepare()
This error come from espresso-contrib:3.3.0
.