Sha256: 741c2cfce2698e8a17d9b9ca03fdd219a85dc7f4b8d2fba1c3202ed520483c76
Contents?: true
Size: 1018 Bytes
Versions: 159
Compression:
Stored size: 1018 Bytes
Contents
package sh.calaba.instrumentationbackend.actions.text; import sh.calaba.instrumentationbackend.Result; import sh.calaba.instrumentationbackend.TestHelpers; import sh.calaba.instrumentationbackend.actions.Action; import android.widget.TextView; /** * Asserts that a TextView with the given content description (args[1]) and that it has the expected text (args[0]) * */ public class AssertTextOfSpecificTextViewByContentDescription implements Action { @Override public Result execute(String... args) { String expectedText = args[0]; TextView view = TestHelpers.getTextViewByDescription(args[1]); if (view == null) { return new Result(false, "No view found with content description: '" + args[1] + "'"); } else if (view.getText().toString().equalsIgnoreCase(expectedText)) { return Result.successResult(); } else { return new Result(false, "Expected: '" + expectedText + "', found:" + view.getText() + "'"); } } @Override public String key() { return "assert_text_in_textview"; } }
Version data entries
159 entries across 159 versions & 2 rubygems