Skip to content

Is there a way to see a partial string? (question) #3570

@jrodriguez-sch

Description

@jrodriguez-sch

What are you trying to achieve?

We are testing a UI which has dates and times being displayed to the user. The values are being displayed locally, so for folks in different time zones the values will show different times and zones though the actual date is always the same (we're all in the US).

I'd like to be able to have a method like see() but where it doesn't break if there is more text there than is expected. Maybe some way to specify a partial string either with a flag or a regex or a different method or something.

What do you get instead?

For example, if the value being displayed to me is "Jan 19, 2023 at 10:34am PST", I'd like to use see('Jan 19, 2023') and have that pass without failing and telling me that there is also 'at 10:34am PST' in there too. That part is guaranteed not to be the same for every engineer or on the servers (also US based) where these tests will run for real.

Kind of like a "just tell me if the text I'm asking you to check for is there, don't worry about other stuff I didn't ask about" method.

(I tried to add a label of Question to this "issue" but that's not a thing I guess)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions