Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add assertStateDescriptionContains #67

Open
Darocs opened this issue Jun 19, 2024 · 3 comments
Open

Add assertStateDescriptionContains #67

Darocs opened this issue Jun 19, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Darocs
Copy link
Contributor

Darocs commented Jun 19, 2024

I think adding a assertStateDescriptionContains would not be unreasonable

@alex-tiurin
Copy link
Collaborator

Could you extend the description and provide some samples.

@Darocs
Copy link
Contributor Author

Darocs commented Jun 19, 2024

For example, in compose I have a validation for OutlinedTextField, and when the validation works through, it sets isError to either true or false.
In the code, I would like to change the stateDescription depending on the isError received.
For example stateDescription = if (isError) "invalid" else "valid"
In the test, I find the text field via contentDescription and check its validity via assertStateDescriptionContains("valid") or assertStateDescriptionContains("invalid")

I'm new to Ultron, so I don't know if this is the right idea

@Darocs Darocs changed the title Add assertStateDescriptionContains Add assertStateDescriptionContains Jun 20, 2024
@Darocs
Copy link
Contributor Author

Darocs commented Jun 20, 2024

You can also see how I solved this Issue in my Validation_Etude repository at this path: app/src/androidTest/java/en/polescanner/validation_etude/ui/reusable/components/Assertions.kt

@alex-tiurin alex-tiurin added the enhancement New feature or request label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants