selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[py] extend typing options for get_property()

Open eNcacz opened this issue 3 years ago • 3 comments

fixes #10624

Extend list of types which can be returned byt get_property() method.

Description

Current typing options does not cover all possible types returned by get_property()

For example

  • clientHeight property is returned as int
  • fooBar property is returned as NoneType
  • childNodes property is returned as list

Motivation and Context

Linters (like mypy or PyCharm) complains about get_property() usage when we expect one of mentioned data type.

Types of changes

  • [x] 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

  • [x] 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.
  • [x] All new and existing tests passed.

eNcacz avatar May 23 '22 06:05 eNcacz

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 23 '22 06:05 CLAassistant

Codecov Report

Merging #10682 (0e2dd11) into trunk (9a43c53) will not change coverage. The diff coverage is 0.00%.

:exclamation: Current head 0e2dd11 differs from pull request most recent head 68c7aa6. Consider uploading reports for the commit 68c7aa6 to get more accurate results

@@           Coverage Diff           @@
##            trunk   #10682   +/-   ##
=======================================
  Coverage   46.61%   46.61%           
=======================================
  Files          86       86           
  Lines        5848     5848           
  Branches      278      278           
=======================================
  Hits         2726     2726           
  Misses       2844     2844           
  Partials      278      278           
Impacted Files Coverage Δ
py/selenium/webdriver/remote/webelement.py 32.96% <0.00%> (ø)

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 9a43c53...68c7aa6. Read the comment docs.

codecov-commenter avatar May 26 '22 21:05 codecov-commenter

@eNcacz looks like we've updated to Python 3 syntax for this, can you update this PR so we can merge it? Thanks!

titusfortner avatar Jul 04 '22 18:07 titusfortner