ScreenPyHQ / screenpy

Screenplay pattern base for Python automated UI test suites.
MIT License
27 stars 3 forks source link

beat does not handle attribute references with numbers #75

Closed bandophahita closed 1 year ago

bandophahita commented 1 year ago

The following results in `KeyError: 'item1':

class CompareRow(Performable):
    @beat("{} sees if {item1} is equal to {item2}")
    def perform_as(self, actor: Actor):
        ...

    def __init__(self, item1: Target, item2: Target):
        self.item1 = item1
        self.item2 = item2

I'm guessing we need to tweak the marker logic in beat to handle all legal python attributes. markers = re.findall(r"\{([^0-9\}]+)}", line)

perrygoy commented 1 year ago

I'm not sure why i even included the 0-9 in there. I think it should work if we take it out.

perrygoy commented 1 year ago

I've got a fix in on PR #69, i was already editing pacing.py so i fixed that quick, too.

perrygoy commented 1 year ago

Merged and fixed!