selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[py]: Align error handling to `W3C`

Open symonk opened this issue 2 years ago • 4 comments

Converts the error codes into a Tuple as they are immutable and adds appropriate type hints for them. Removes unused vars screen & stacktrace as they are redefined later when used.

symonk avatar May 16 '22 21:05 symonk

Looking at this again we can remove the numbers, that's a hangover from JWP that we are trying to remove anyway

AutomatedTester avatar Jun 08 '22 14:06 AutomatedTester

Codecov Report

Merging #10657 (da85cde) into trunk (744b4bd) will decrease coverage by 0.03%. The diff coverage is 50.64%.

@@            Coverage Diff             @@
##            trunk   #10657      +/-   ##
==========================================
- Coverage   48.42%   48.38%   -0.04%     
==========================================
  Files          84       84              
  Lines        5485     5481       -4     
  Branches      279      279              
==========================================
- Hits         2656     2652       -4     
  Misses       2550     2550              
  Partials      279      279              
Impacted Files Coverage Δ
py/selenium/webdriver/remote/errorhandler.py 54.60% <50.64%> (+0.11%) :arrow_up:
py/selenium/webdriver/remote/remote_connection.py 29.78% <0.00%> (-0.71%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 744b4bd...da85cde. Read the comment docs.

codecov-commenter avatar Jun 11 '22 09:06 codecov-commenter

Refactoring the error handling is a bigger task than initially thought; all the tests are parameterised for the (int, str) so the new str only is iterable and unpacking itself into hundreds of parameterised tests :smile: need to keep grinding on this one gradually!

symonk avatar Jun 14 '22 19:06 symonk

I think the error handling code could use a rewrite to scrub some JWP code, I will do it as a follow up ticket.

symonk avatar Jun 15 '22 20:06 symonk