KakaoCup / Kakao

Nice and simple DSL for Espresso in Kotlin
https://kakaocup.github.io/Kakao/
Apache License 2.0
325 stars 28 forks source link

hasText not checking escaped "%" character #40

Closed dsuresh-ap closed 3 years ago

dsuresh-ap commented 3 years ago

Steps to reproduce:

  1. Set the text on a TextView to have an escaped %. Ex. <string name="recording_scaling">Scaling (%%)</string>
  2. call hasText on the KTextView with the resource id

Observed Results:

Expected: with string from resource id: <2131821564>[recording_scaling] value: Scaling (%%)
     Got: "AppCompatTextView{id=2131362820, res-name=titleTextView, visibility=VISIBLE, width=220, height=48, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@e829a5e, tag=null, root-is-layout-requested=false, has-input-connection=false, x=16.0, y=0.0, text=Scaling (%), input-type=0, ime-target=false, has-links=false}"

Expected Results:

Relevant Code:

<string name="recording_scaling">Scaling (%%)</string>
title.hasText(R.string.recording_scaling) // Fails
Vacxe commented 3 years ago

Hey @dsuresh-ap As you can see

..., x=16.0, y=0.0, text=Scaling (%), input ...

Kakao is a DSL over Espresso. I definitely sure that you will have the same result with using it.

I can suggest to verify it by

title.hasText("Scaling (%)")
dsuresh-ap commented 3 years ago

@Vacxe Yes, calling title.hasText("Scaling (%)") is how we have it implemented now. Is the string resource method a bug or is it working as intended? If it is not a bug this can be closed.

Vacxe commented 3 years ago

It's not a bug