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

Parametrized widgets #18

Open
mfalesni opened this issue Feb 13, 2017 · 1 comment
Open

Parametrized widgets #18

mfalesni opened this issue Feb 13, 2017 · 1 comment

Comments

@mfalesni
Copy link
Contributor

We already have parametrized views but a parametrized Widget would also be nice.

Current code sample:

   def _remove_recipient(self, email):
        Text(self, ".//a[text()='{}']".format(email)).click()

What I would imagine:

class Foo(View):
    w = Text(ParametrizedLocator('//something[@important={name|quote}]'))

v = "instance of Foo"
# Widget recognizes that there is a parametrized locator in args and returns a proxy
v.w == "some proxy"
v.w.read() # => triggers an error because it is a proxy
v.w(name='foobar').__locator__() == '//something[@important="foobar"]'
v.w(name='foobar').read() == "something"
@mfalesni
Copy link
Contributor Author

This would be a very similar way how we treat parametrized Views.

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

No branches or pull requests

1 participant