Comments (7)
Actually not. The base Browser
was designed as an immutable set of operations which other components rely on.
If specific things are needed, you can:
- add new methods that implement specific things in your browser subclass
- request a backwards-compatible change in WT browser method (add a parameter or whatever).
- use an existing hook in plugin class
- add a new hook into the Plugin class and add the hook calls in the particular browser methods, that way extensions altering the behaviour of the browser can be done without harming vanilla browser's behaviour.
from widgetastic.core.
@RonnyPfannschmidt Perhaps a custom super wrapper that "unwraps" the underlying browser from its wrapping would do. Instead of super(MyBrowser, self)
one would call something like self.super(MyBrowser)
and it would:
- Figure the unwrapped object
- call
super(...)
with it - Rewrap it again with the current wrapper.
And then the use would be like with normal super.
from widgetastic.core.
So basically we want to extend wait_for_element
with one extra argument. To avoid copy pasting entire method body we just call super()
and extend result with our stuff.
For top-level views calls to wait_for_element() via self.browser.wait_for_element()
work ok, but for nested structure like the one @oshtaier provided - it fails on super()
call (obj must be an instance or subtype of type
), as self.browser
for all nested views is BrowserParentWrapper
, not the Browser
itself.
Using it through self.root_browser.wait_for_element()
works, but that doesn't sound like a right option to use root browser for every overwritten method to me.
Is that expected behavior and we aren't supposed to extend any browser's method or that's an issue with BrowserParentWrapper
proxy implementation?
from widgetastic.core.
widgetastic.core/src/widgetastic/browser.py
Lines 833 to 853 in f39a87f
from widgetastic.core.
this change may necessitate a structural shift for wrapping browsers and locator using objects to sort out,
its possible we cant get around it before the new year
right now i don't have a idea for a solution
from widgetastic.core.
please also show the use-case you want to implement, due the nature of the issue (structural) it may be easier in the short term to find a different way to implement the use-case simply to avoid having to sort out the underlying issue in a timely manner
from widgetastic.core.
@RonnyPfannschmidt actually that was real use case.
I did it here:
https://github.com/SatelliteQE/airgun/pull/263/files#diff-b5de464875aa71a973dee2e139a855c9R130
but teammates said proper comment that it will be necessary to fix all (>50) places where we have not top level view.
from widgetastic.core.
Related Issues (20)
- E TypeError: __init__() got an unexpected keyword argument 'prov_class' HOT 1
- partial_match does not support parenthesis () in object
- Table widget: tbody row indexing starts from 1 when there's a row in table header HOT 4
- Element not found with Zalenium webdriver and scrolled down HOT 1
- Inconsistency in indexing of Table rows and columns HOT 1
- Provide method to pull browser debug console content
- TableRow.__dir__ is broken
- table.headers is incorrectly calculated when there are non-text header rows HOT 1
- TableWidget with rowspan and with a column widget does not return widget value when reading HOT 5
- refactor Table widget in order to make it less awkward
- Preferred way of performing action on view before reading?
- Move WT as multi-window framework
- Readme file missing
- DeprecationWarning driver.switch_to.alert instead self.selenium.switch_to_alert() HOT 2
- Deprecation of getargspec as we are using py3
- OUIA component ID cannot be None
- clear() does not work reliably HOT 1
- "force_scroll" must be enabled for Chrome
- PyPI upload filename has to match project name HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from widgetastic.core.