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

Allow search for regular expression in expected condition #11668

Closed
wants to merge 1 commit into from

Conversation

robertschulze
Copy link

This also returns the match(es) to be used further e.g. by evaluating match groups.

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

This allows to work with regular expressions in matching expected conditions, specifically the text within an element. It could clearly be extended to further cases.

Motivation and Context

By allowing to use regular expressions, 1. the matching of text becomes much more versatile and 2. it allows to work with the content of the matched groups after the match was successful. In this way e.g. status messages on websites can be matched and checked.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This also returns the match(es) to be used further e.g. by evaluating match groups.
@CLAassistant
Copy link

CLAassistant commented Feb 17, 2023

CLA assistant check
All committers have signed the CLA.

@diemol
Copy link
Member

diemol commented Feb 19, 2023

Thank you for this PR, however we tend to not add new logic to the expected conditions class, rather we recommend to add those to a framework built on top. #10589 is an example of this case. Exceptions of this is when we accept PRs extending existing logic or implementing a condition that exists in another language binding already.

@diemol diemol closed this Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants