RedHatQE / RedHatQE/widgetastic.core

Parametrized widgets

Open
#18 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
37
Forks
46
PR merge metrics
No merged PRs in 30d

Description

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"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading how parametrized views currently work, then trace how Text and ParametrizedLocator handle their arguments. Use the examples in the issue to define proxy behavior, locator expansion, and read behavior; done means named widget parameters produce the expected locator and usable widget operations while direct proxy reads fail as shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.