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

LuckyFlow::Element#value uses property instead of attribute #88

Merged
merged 1 commit into from
Jun 8, 2020
Merged

LuckyFlow::Element#value uses property instead of attribute #88

merged 1 commit into from
Jun 8, 2020

Conversation

matthewmcgarvey
Copy link
Member

The reasoning behind this was laid out here: #86

TLDR: switching to property allows us to add support for other browsers in the future

Fixes #86

@@ -1,7 +1,7 @@
class LuckyFlow::Element
private getter raw_selector
getter inner_text
delegate text, click, send_keys, displayed?, attribute, to: element
delegate text, click, send_keys, displayed?, attribute, property, to: element
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while attribute is no longer used in the class, I wasn't sure about removing it from this list since it is technically public API. I can remove it, though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it in. At least for this next release. We can see about deprecating it later.

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. Can we have a spec that shows using this just so we can verify it works?

@matthewmcgarvey
Copy link
Member Author

@jwoertink Do you mean a spec testing the value method? If so, here it is

it "can fill in text" do
flow = visit_page_with <<-HTML
<input name="question:title"/>
<input name="question:body"/>
HTML
flow.field("question:title").value.should eq ""
flow.field("question:body").value.should eq ""
flow.field("question:title").fill("Joe")
flow.fill "question:body", with: "Sally"
flow.field("question:title").value.should eq "Joe"
flow.field("question:body").value.should eq "Sally"
end

@jwoertink
Copy link
Member

I was thinking more on the property method itself, but now I think value being called is probably good enough. 👍

@jwoertink jwoertink merged commit d2f2d4c into luckyframework:master Jun 8, 2020
@matthewmcgarvey matthewmcgarvey deleted the value-change branch June 9, 2020 01:25
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

Successfully merging this pull request may close these issues.

Get the value of an element with property rather than attribute
2 participants