Hi,
so I noticed last week that the Flow builds were getting deprecation warnings from the test framework saying "Locating textareas with '#text_field' is deprecated. Please, use '#textarea' method instead."
I don't like being deprecated, but upon updating the test, to my surprise, the page_object gem could no longer see the element.
I filed an upstream bug for this: https://github.com/cheezy/page-object/issues/248
In the meantime, let's keep using the text_field locator as long as it keeps working for us.
-Chris
Flow's post input fields morph from an input text field to a textarea upon click. I assumed that was why we use "text_field", as it works with either.
I think your test is accessing the topic title (name="topiclist_topic"), which continues to be an input text field after clicking, so textarea won't work.
We could make an intermediate Flow step definition When I enter "Foo" in morphing |field_name|
that turns into step I click in the <input field element> and it becomes a <textarea element> and I send_keys "My reply here" in the <textarea element>
but I'm not sure how in Ruby/Watir
On Mon, Sep 22, 2014 at 11:29 AM, Chris McMahon cmcmahon@wikimedia.org wrote:
Hi,
so I noticed last week that the Flow builds were getting deprecation warnings from the test framework saying "Locating textareas with '#text_field' is deprecated. Please, use '#textarea' method instead."
I don't like being deprecated, but upon updating the test, to my surprise, the page_object gem could no longer see the element.
I filed an upstream bug for this: https://github.com/cheezy/page-object/issues/248
In the meantime, let's keep using the text_field locator as long as it keeps working for us.
On 09/22/2014 04:21 PM, S Page wrote:
We could make an intermediate Flow step definition When I enter "Foo" in morphing |field_name|
that turns into step I click in the <input field element> and it becomes a <textarea element> and I send_keys "My reply here" in the <textarea element>
but I'm not sure how in Ruby/Watir
For an example of such a meta-step, see https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FFlow.git/0e79d9d2f8e... .
Matt Flaschen
Hi Matt,
I think what S was referring to was that Flow has some input elements that are a little unusual. When you delete/hide/suppress a topic in Flow, you have to give a reason. The reason field is a little unusual. I handled a few of those here: https://gerrit.wikimedia.org/r/#/c/161411/3/tests/browser/features/step_defi...
In this case, we have an input with no type at all that has to be clicked in order to transform or "morph" it into a text input. (It's fun to watch that element in the browser console when it gets clicked btw)
In this case, unless I am mistaken, Selenium recognizes the "closed" input element as a "button", which is normal behavior, and recognizes the same element "open" as a text input.
I don't think that's what's going on in my bug report below.
On Tue, Sep 23, 2014 at 9:39 PM, Matthew Flaschen mflaschen@wikimedia.org wrote:
On 09/22/2014 04:21 PM, S Page wrote:
We could make an intermediate Flow step definition When I enter "Foo" in morphing |field_name|
that turns into step I click in the <input field element> and it becomes a <textarea element> and I send_keys "My reply here" in the <textarea element>
but I'm not sure how in Ruby/Watir
For an example of such a meta-step, see https://git.wikimedia.org/ blob/mediawiki%2Fextensions%2FFlow.git/0e79d9d2f8edcb9e80b9f8200f9b62 7760d88c85/tests%2Fbrowser%2Ffeatures%2Fstep_definitions% 2Fflow_steps.rb#L26 .
Matt Flaschen
EE mailing list EE@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/ee
On 09/24/2014 10:11 AM, Chris McMahon wrote:
Hi Matt,
I think what S was referring to was that Flow has some input elements that are a little unusual. When you delete/hide/suppress a topic in Flow, you have to give a reason. The reason field is a little unusual. I handled a few of those here: https://gerrit.wikimedia.org/r/#/c/161411/3/tests/browser/features/step_defi...
Yeah, that's what I understood as well (that he was talking about changing from <input> to a <textarea>).
He said, "We could make an intermediate Flow step definition", but indicated he wasn't sure how to do so, which is why I provided that example.
In this case, we have an input with no type at all that has to be clicked in order to transform or "morph" it into a text input. (It's fun to watch that element in the browser console when it gets clicked btw)
In this case, unless I am mistaken, Selenium recognizes the "closed" input element as a "button", which is normal behavior, and recognizes the same element "open" as a text input.
That doesn't seem correct behavior by Selenium, if so. <input> and <textarea> are both different forms of text input. <input> (or <input type="text">, which is equivalent) is for one-line text input, whereas <textarea> is multi-line text input.
You can see from http://jsfiddle.net/58j0f0wj/ that a simple <input> (no attributes) if a one-line text input, not a button (the same is true of <input type="text">).
Matt Flaschen
On Wed, Sep 24, 2014 at 5:00 PM, Matthew Flaschen mflaschen@wikimedia.org wrote:
On 09/24/2014 10:11 AM, Chris McMahon wrote:
https://gerrit.wikimedia.org/r/#/c/161411/3/tests/browser/ features/step_definitions/moderation_steps.rb
Yeah, that's what I understood as well (that he was talking about changing from <input> to a <textarea>).
That doesn't seem correct behavior by Selenium, if so. <input> and <textarea> are both different forms of text input. <input> (or <input type="text">, which is equivalent) is for one-line text input, whereas <textarea> is multi-line text input.
That's what the HTML spec says, but that's not how things actually work in Selenium, and it's been like that for a long time. They don't think it be like that but it do. You can see the test work with "button" not "text_field" in the example above.
On 09/24/2014 08:14 PM, Chris McMahon wrote:
That's what the HTML spec says, but that's not how things actually work in Selenium, and it's been like that for a long time. They don't think it be like that but it do. You can see the test work with "button" not "text_field" in the example above.
What is the purpose of text_field then (http://rubydoc.info/gems/page-object/PageObject/Accessors:text_field)?
Is it useful for another page-object backend, but not Selenium?
Thanks,
Matt Flaschen
On Wed, Sep 24, 2014 at 10:07 PM, Matthew Flaschen mflaschen@wikimedia.org wrote:
What is the purpose of text_field then (http://rubydoc.info/gems/ page-object/PageObject/Accessors:text_field)?
It's use is deprecated in the page_object gem, as I said in the original post, when we use text_field we see a message reported '#text_field' is deprecated. Please, use '#textarea' method instead.".
On 09/25/2014 09:37 AM, Chris McMahon wrote:
On Wed, Sep 24, 2014 at 10:07 PM, Matthew Flaschen <mflaschen@wikimedia.org mailto:mflaschen@wikimedia.org> wrote:
What is the purpose of text_field then (http://rubydoc.info/gems/__page-object/PageObject/__Accessors:text_field <http://rubydoc.info/gems/page-object/PageObject/Accessors:text_field>)?
It's use is deprecated in the page_object gem, as I said in the original post, when we use text_field we see a message reported '#text_field' is deprecated. Please, use '#textarea' method instead.".
Thanks.
Matt Flaschen
Sure. BTW, I updated the upstream issue with what I think is going on, commented on my original post: https://github.com/cheezy/page-object/issues/248
On Mon, Sep 29, 2014 at 2:48 PM, Matthew Flaschen mflaschen@wikimedia.org wrote:
On 09/25/2014 09:37 AM, Chris McMahon wrote:
On Wed, Sep 24, 2014 at 10:07 PM, Matthew Flaschen <mflaschen@wikimedia.org mailto:mflaschen@wikimedia.org> wrote:
What is the purpose of text_field then (http://rubydoc.info/gems/__page-object/PageObject/__
Accessors:text_field <http://rubydoc.info/gems/page-object/PageObject/Accessors:text_field
)?
It's use is deprecated in the page_object gem, as I said in the original post, when we use text_field we see a message reported '#text_field' is deprecated. Please, use '#textarea' method instead.".
Thanks.
Matt Flaschen
EE mailing list EE@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/ee
On 09/29/2014 06:16 PM, Chris McMahon wrote:
Sure. BTW, I updated the upstream issue with what I think is going on, commented on my original post: https://github.com/cheezy/page-object/issues/248
Thanks, I've replied. I'm hoping cheezy/the other maintainers can clarify the intended behavior and the docs.
Matt Flaschen