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

Wait for class testing utilities #2049

Merged
merged 4 commits into from
May 21, 2022

Conversation

MrTeale
Copy link
Contributor

@MrTeale MrTeale commented May 13, 2022

As more and more CSS libraries and frameworks are using utility classes, there is a growing need for people to check an elements class attribute contains or equals a value. I am currently in this circumstance building a set of custom AIO components utilising TailwindCSS and FontAwesome icons.

My reasoning for making this addition was to check a callback had successfully changed the icon within a div. FontAwesome uses the ::before pseudo-element with a content css property to contain the unicode character of the icon. The process to access psuedo-elements within Selenium is not the most developer friendly method (example here) but if they're being created by classes, why not just check and wait for those?

The testing documentation (located here) would need to be updated to include these new options under Browser APIs.

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • Add wait_for_class_to_equal
    • Add wait_for_contains_class
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added entry in the CHANGELOG.md

@MrTeale MrTeale requested a review from alexcjohnson as a code owner May 13, 2022 03:34
dash/testing/wait.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice addition @MrTeale! 💃 after my two minor comments are addressed.

@MrTeale
Copy link
Contributor Author

MrTeale commented May 20, 2022

Thanks @alexcjohnson! I've made those changes and should be 💃 now

@alexcjohnson alexcjohnson merged commit 04217e8 into plotly:dev May 21, 2022
@MrTeale MrTeale deleted the wait-for-class-values branch May 22, 2022 12:18
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.

2 participants