Last modified: 2014-11-05 15:46:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74149, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72149 - create custom RSpec matchers for when_present, when_not_present, etc
create custom RSpec matchers for when_present, when_not_present, etc
Status: RESOLVED INVALID
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
wmf-deployment
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-16 20:37 UTC by Chris McMahon
Modified: 2014-11-05 15:46 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Chris McMahon 2014-10-16 20:37:13 UTC
see the discussion at 

https://lists.wikimedia.org/pipermail/qa/2014-October/002021.html

this would allow us to not have to make 2-line Then statements along the lines of 

Then(/^the top post is an open discussion$/) do
  on(FlowPage) do |page|
    page.flow_first_topic_moderation_msg_element.when_not_present
    expect(page.flow_first_topic_moderation_element).not_to be_visible
  end
end
Comment 1 Chris McMahon 2014-10-17 15:08:50 UTC
Zeljko and I dug into this and we discovered that refactoring has removed most instance of this sort of thing.  But here is one example still in place, from reply_steps.rb in Flow: 

Then(/^I should see the topic reply form$/) do
  on(FlowPage) do |page|
    page.wait_until { page.new_reply_input_element.visible? }
    expect(page.new_reply_input_element).to be_visible
  end
end
Comment 2 Željko Filipin 2014-10-17 15:12:38 UTC
This should do the same thing:

  Then(/^I should see the topic reply form$/) do
    expect(on(FlowPage).new_reply_input_element.when_visible).to be_visible
  end
Comment 3 Chris McMahon 2014-10-17 15:14:52 UTC
I think this should actually be

Then(/^I should see the topic reply form$/) do
    expect(on(FlowPage).new_reply_input_element.when_present).to be_visible
  end

but this makes sense
Comment 4 Matthew Flaschen 2014-11-05 03:06:43 UTC
(In reply to Chris McMahon from comment #3)
> Then(/^I should see the topic reply form$/) do
>     expect(on(FlowPage).new_reply_input_element.when_present).to be_visible
>   end

If it's not present, won't this actually timeout on the when_present (as S brought up in his email), before the expect runs?
Comment 5 Chris McMahon 2014-11-05 15:46:41 UTC
refactoring actually corrected the problem instances

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links