Repository navigation
Add tested Color examples for the Colors page - #2997
Open
vishalchincholi1 wants to merge 6 commits into
Open
vishalchincholi1 wants to merge 6 commits into
vishalchincholi1 wants to merge 6 commits into
Conversation
Replace the inline snippets on the Colors page with gh-codeblock references to runnable tests, in the en, ja, pt-br and zh-cn copies. - Java: fill the empty ColorsTest. - Python: add tests/support/test_colors.py. - Ruby: fill the empty color_spec.rb. - Kotlin: add support/ColorsTest.kt. The tests cover hex, rgb, rgb percent, rgba, rgba percent, hsl and hsla strings, named colours, transparent, and reading an element's color and background-color from the colorPage.html test page, then comparing and converting with hex, rgb and rgba. The Ruby Color class has no named-colour or transparent support (checked in selenium-webdriver 4.52.0), so those two Ruby tabs now show the implementation-missing badge instead of a snippet that would raise an error. The Ruby element test builds expected colours from rgb strings for the same reason. The element snippets now use the namedColor element on colorPage.html instead of a "login" element that no test page provides. Verified locally: Python (4 passed), Java (4 passed), Kotlin (4 passed), Hugo build (no errors). Not run locally: Ruby rspec and rubocop, because the native gems could not be built on this machine. Ruby relies on CI. Hugo cannot resolve gh-codeblock snippets without a GitHub token, so line ranges were checked with a script instead. Part of SeleniumHQ#2890
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Member
|
@vishalchincholi1 , ruby tests are failing. Can you have a look at the failure. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Converts the Colors page (
webdriver/support_features/colors) from inline snippets togh-codeblockreferences backed by runnable tests, in the en, ja, pt-br and zh-cn copies.ColorsTest.java.tests/support/test_colors.py.color_spec.rb.support/ColorsTest.kt.The tests cover creating colors from hex, rgb, rgb percent, rgba, rgba percent, hsl and hsla strings, named colors and
transparent, then reading an element'scolorandbackground-colorfromcolorPage.htmland comparing and converting them with hex, rgb and rgba.Two notes for review:
Colorclass has no named-color ortransparentsupport (checked in selenium-webdriver 4.52.0). Those two Ruby tabs now show the implementation-missing badge instead of a snippet that would raise an error.loginelement that no test page has. They now use thenamedColorelement oncolorPage.html.Motivation and Context
Part of #2890 (the Colors page, as claimed in this comment). Every snippet on the page was untested and marked with
badge-examples.Testing
pytest tests/support/test_colors.py, 4 passed.mvn test -Dtest=ColorsTest, 4 passed.mvn test -Dtest=ColorsTest, 4 passed.gh-codeblockline ranges were checked against the final files with a script, since Hugo needs a GitHub token to fetch the snippets locally.Types of changes
Checklist
I have signed the CLA.