agoda-com / Kakao

This repo is no longer supported. Please visit a https://github.com/KakaoCup/Kakao
Apache License 2.0
1.11k stars 102 forks source link

Impossible to check if KAlertDialog isn't on the screen #257

Closed SvitlanaShumilova closed 3 years ago

SvitlanaShumilova commented 3 years ago

Bug report

Describe the bug

When using KAlertDialog it's impossible to check if alert is absent on the screen as the class looks for root elements that are dialogs.

To Reproduce

Steps to reproduce the behavior:

  1. Create an instance of KAlertDialog on the screen.
  2. Address the instance in the test to check if alert is absent on the screen using either doesNotExist()or any suitable method to check element absence.

Expected behavior

It's possible to check if element isn't on the screen.

Exception

androidx.test.espresso.NoMatchingRootException: Matcher '(is dialog)' did not match any of the following roots

Vacxe commented 3 years ago

@MongolianSpy could you please create PR with reproducing issue on sample application? It can help us to recognize a problem.

SvitlanaShumilova commented 3 years ago

@Vacxe You can have a closer look with this test com.iteo.androidcleanuitests.AlertTest#check_alert_does_not_exist https://github.com/MongolianSpy/AndroidCleanUITests

Vacxe commented 3 years ago

Kakao is a wrapper over Espresso framework. I don't think that can be achieved with it because this rule contains isDialog() root matcher. @Unlimity do u have any brave ideas?

Issue: Method works incorrectly Precondition: Dialog does't present

alertDialog {
    doesNotExist()
}