<div dir="ltr">Thanks a lot Dan,<div><br></div><div>Its clear now.As of now,I was seeing we are dealing with a page object element and calling visible? method on that.</div><div><br></div><div>Regards,</div><div>Jagori</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 16, 2014 at 12:01 PM, Dan Duvall <span dir="ltr"><<a href="mailto:dduvall@wikimedia.org" target="_blank">dduvall@wikimedia.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="">> <span style="font-family:arial,sans-serif;font-size:13px">Thus expect(x).to be_visible</span><div style="font-family:arial,sans-serif;font-size:13px">
> is basically calling x.visible? method.Hope I am right in my understanding.<br>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">That's exactly right!</div><div class=""><div style="font-family:arial,sans-serif;font-size:13px">
<br>
</div><div style="font-family:arial,sans-serif;font-size:13px">> is visible? a method available by default from Ruby or is it a user defined function?</div><br style="font-family:arial,sans-serif;font-size:13px"></div>
<div>(TL;DR: user defined)</div>
<div><br></div><div>It completely depends on the subject of your test, so you'll have to know a little about the object you're dealing with in each case. For browser tests, you're usually dealing with some kind of PageObject element, so you'll want to reference the API documentation for <a href="http://rubydoc.info/github/cheezy/page-object/" target="_blank">PageObject</a> and <a href="http://watir.github.io/watir-webdriver/doc/" target="_blank">WebDriver</a>. (Zeljko might know of some API documentation that's easier to follow.) Alternatively, just try it and if you get a NoMethodError, the object doesn't respond to `visible?`.</div>

<div><br></div><div>Hope this helps!</div><span class="HOEnZb"><font color="#888888"><div>Dan</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 15, 2014 at 6:13 PM, jagori samajdar <span dir="ltr"><<a href="mailto:jagori79@gmail.com" target="_blank">jagori79@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Dan,<br><br></div>Thanks for sharing the article.I can correlate a bit now.I read about predicate methods too about which I wasn't aware.<br>

<br></div>Thus expect(x).to be_visible<br>
<br></div>is basically calling x.visible? method.Hope I am right in my understanding.<br><br></div>Just one more question,might sound bit basic:)<br><br></div>is visible? a method available by default from Ruby or is it a user defined function?<br>


<br></div>Thanks,<br>Jagori<br><div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 16, 2014 at 10:55 AM, jagori samajdar <span dir="ltr"><<a href="mailto:jagori79@gmail.com" target="_blank">jagori79@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Dan,yup I was reading that only now:)<br></div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jul 16, 2014 at 10:39 AM, Dan Duvall <span dir="ltr"><<a href="mailto:dduvall@wikimedia.org" target="_blank">dduvall@wikimedia.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Got it! I was confused about what you were confused about then. :)<div><br></div><div>If you're still wondering about the absence of `be_visible` in the RSpec documentation, do check out the link to predicate matchers I posted.[1]</div>




<div><br></div><div><a href="https://www.relishapp.com/rspec/rspec-expectations/v/3-0/docs/built-in-matchers/predicate-matchers" target="_blank">https://www.relishapp.com/rspec/rspec-expectations/v/3-0/docs/built-in-matchers/predicate-matchers</a></div>




<div><br></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 15, 2014 at 5:01 PM, jagori samajdar <span dir="ltr"><<a href="mailto:jagori79@gmail.com" target="_blank">jagori79@gmail.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thanks Dan,I understand and am aware of that.<br><br>It was just for my knowledge and understanding.Since am pretty new to Ruby and Watir-Webdriver,so am trying to learn whatever things I come across while making the changes.<br>





<br></div>Thanks ,<br></div>Jagori<br></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 16, 2014 at 3:12 AM, Dan Duvall <span dir="ltr"><<a href="mailto:dduvall@wikimedia.org" target="_blank">dduvall@wikimedia.org</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Just to clarify, AFAIK the <a href="https://www.relishapp.com/rspec/rspec-expectations/v/3-0/docs/built-in-matchers/predicate-matchers" target="_blank">predicate matcher</a> syntax has not changed, so there's no need to change `be_visible`. As Zeljko has illustrated, it's only the <a href="https://www.relishapp.com/rspec/rspec-expectations/docs" target="_blank">expectation syntax</a> that needs refactoring.</div>






<div class="gmail_extra"><div><div><br><br><div class="gmail_quote">On Tue, Jul 15, 2014 at 1:07 AM, jagori samajdar <span dir="ltr"><<a href="mailto:jagori79@gmail.com" target="_blank">jagori79@gmail.com</a>></span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thanks Zeljko for helping me out with the conversion part.I was thinking , how to convert a single line statement like this:)<br>






<br></div>But I still remain confused about the documentation.<br><br>
If anybody could provide any other documentation would be wonderful.<br></div>Thanks,<br>jagori<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Mon, Jul 14, 2014 at 10:21 PM, Željko Filipin <span dir="ltr"><<a href="mailto:zfilipin@wikimedia.org" target="_blank">zfilipin@wikimedia.org</a>></span> wrote:<br>







</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>On Mon, Jul 14, 2014 at 11:28 AM, jagori samajdar <span dir="ltr"><<a href="mailto:jagori79@gmail.com" target="_blank">jagori79@gmail.com</a>></span> wrote:<br>









</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>As part of my task wherein am converting the should syntax to expect,am bit confused with the <i>be_visible</i> matcher or whatever it is.<br>









</div></div></blockquote><div><br></div></div><div>For those of you that are not familiar with the bug, it is 66369[1].</div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">









<div dir="ltr"><div><div>I couldn't see it anywhere in the RSpec's default built in matcher list.</div>
</div><div><a href="https://github.com/rspec/rspec-expectations" target="_blank">https://github.com/rspec/rspec-expectations</a><br></div><div><br></div><div>Can anyone help me understand the same as in the pasted code defined in options_steps.rb:</div>










<div><br></div><div><div>Then(/^I should see the options overlay$/) do</div><div>  on(VisualEditorPage).options_page_title_element.when_present.should be_visible</div><div>end</div></div><div></div></div></blockquote><div>









<br></div></div><div>In this case, you have to convert</div><div><br></div><div>on(VisualEditorPage).options_page_title_element.when_present.should be_visible<br></div><div><br></div><div>to</div><div><br></div>expect((VisualEditorPage).options_page_title_element.when_present).to be_visible<br>









<div><br></div><div>Let me know if you are still confused, or if you need more documentation. If anybody can point to better documentation than I have provided in the last e-mail message, please do.</div><div><br></div><div>









Željko</div><div>--</div><div><a href="https://bugzilla.wikimedia.org/show_bug.cgi?id=66369" target="_blank">https://bugzilla.wikimedia.org/show_bug.cgi?id=66369</a> </div></div></div></div>
<br></div></div>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org" target="_blank">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org" target="_blank">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div dir="ltr">Dan Duvall<div>Automation Engineer</div><div><a href="http://wikimediafoundation.org" target="_blank">Wikimedia Foundation</a><br>





</div></div>

</font></span></div>
<br>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org" target="_blank">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org" target="_blank">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Dan Duvall<div>Automation Engineer</div><div><a href="http://wikimediafoundation.org" target="_blank">Wikimedia Foundation</a><br></div></div>





</div>
</div></div><br>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org" target="_blank">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org" target="_blank">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Dan Duvall<div>Automation Engineer</div><div><a href="http://wikimediafoundation.org" target="_blank">Wikimedia Foundation</a><br></div></div>


</div>
</div></div><br>_______________________________________________<br>
QA mailing list<br>
<a href="mailto:QA@lists.wikimedia.org">QA@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/qa" target="_blank">https://lists.wikimedia.org/mailman/listinfo/qa</a><br>
<br></blockquote></div><br></div>