Fixed
Status Update
Comments
pe...@google.com <pe...@google.com>
je...@google.com <je...@google.com> #2
So IIUC, you're looking for something like assertDoesNotExistOrIsNotDisplayed()
.
I think this could be solved by providing matchers to express "exists" and "isDisplayed", so you can write assert(not(isDisplayed()) or not(exists()))
. I'll have to look back in time to see why we didn't provide those matchers in the first place.
am...@google.com <am...@google.com> #3
In the ideal world I would only need to write
`assert(not(isDisplayed())`
as isDisplayed is true when it is displayed. and I want a negation of it. but current IsNotDisplayed() != !isDisplayed() as it fails if the node does not exist. but I don't care why exactly it is not displayed
`assert(not(isDisplayed())`
as isDisplayed is true when it is displayed. and I want a negation of it. but current IsNotDisplayed() != !isDisplayed() as it fails if the node does not exist. but I don't care why exactly it is not displayed
an...@google.com <an...@google.com> #4
I found a way to do this using public API. It is not elegant, but users could use this while we come up with a better fix:
fun SemanticsNodeInteraction.assertNotDisplayed() {
try {
// If the node does not exist, it implies that it is also not displayed.
assertDoesNotExist()
} catch (e: AssertionError) {
// If the node exists, we need to assert that it is not displayed
assertIsNotDisplayed()
}
}
We can similarly use assertNotPlaced to determine if the node is composed but not placed:
fun SemanticsNodeInteraction.assertNotPlaced() {
try {
// If the node does not exist, it implies that it is also not placed.
assertDoesNotExist()
} catch (e: AssertionError) {
// If the node exists, we need to assert that it is not placed.
val errorMessageOnFail = "Assert failed: The component is placed!"
if (fetchSemanticsNode().layoutInfo.isPlaced) {
throw AssertionError(errorMessageOnFail)
}
}
}
Description
DESCRIBE THE ISSUE IN DETAIL:
Here'e another issue where you didn't put enough effort in reviewing public api.
VariantOutput.enable
has aand again, I expect clear migration guide with explanation what is wrong with old property and why it has changed? What are possible side effects of the replacement? 🤷♂️ Current comment is so useless for a consumer I don't even know where to start...
I initially thought such issues are accidental, but now, seeing that many mistakes in documentation I'm quite sure you did this on purpose - why?
STEPS TO REPRODUCE:
com.android.build.api.variant.VariantOutput
enable
propertyATTACH SCREENSHOTS/RECORDINGS OF THE ISSUE I can't inline images on IssueTracker
ATTACH LOG FILES (Select Help > Show Log in Files, or Show Log in Finder on a Mac)
IMPORTANT: Please readhttps://developer.android.com/studio/report-bugs.html carefully and supply
all required information.
Studio Build: doesn't matter Version of Gradle Plugin: which plugin? Android Gradle Plugin? 7.0.1 Version of Gradle: doesn't matter Version of Java: doesn't matter OS: doesn't matter