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

Command to check the text of an element with expected #2321

Open
er-anupamkumar opened this issue Feb 18, 2025 · 4 comments
Open

Command to check the text of an element with expected #2321

er-anupamkumar opened this issue Feb 18, 2025 · 4 comments
Labels
enhancement New feature request or improvement of an existing feature

Comments

@er-anupamkumar
Copy link

Use case

If we want to assert that an element has an expected test , currenlty we need to do below :

  • copyTextFrom: View A
  • evalScript: ${output.viewA = maestro.copiedText}

it does not make sense

Proposal

May be we can have
assertEquals
id:
expected:

assertNotEquals
id:
expected:

assertContains
id:
expected:

assertNotContains
id:
expected:

Anything else?

No response

Copy link

linear bot commented Feb 18, 2025

@Fishbowler
Copy link
Contributor

You can do this with the existing assertVisible command.

- assertVisible:
    id: ViewA
    text: ${output.viewA}

This would assert that an element is visible with both the ID and the expected text. It's not an explicit text matcher, but under the hood, it'd be the identical operation.

@er-anupamkumar
Copy link
Author

@Fishbowler yes but it is not as comprehensive. If I want to have assertion that the particular element in the screen should not have a particular text then I cannot do that with above approach. Some basic assertions we can do with above approach but not all.

@Fishbowler
Copy link
Contributor

I think you can do all the things, but like in your original post, they're all slightly long winded and indirect.

I wonder if this is something a community member would pick up? It's a nice full stack feature, but all of the mechanics are already present as prior art.

@Fishbowler Fishbowler added the enhancement New feature request or improvement of an existing feature label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request or improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants