Replace "execute_script" in publisher_steps definitions
This commit is contained in:
parent
4548380080
commit
637dad208a
1 changed files with 6 additions and 10 deletions
|
|
@ -13,9 +13,11 @@ Then /^the publisher should be expanded$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I click to delete the first uploaded photo$/ do
|
When /^I click to delete the first uploaded photo$/ do
|
||||||
page.execute_script("$('#photodropzone .x').css('display', 'block');")
|
|
||||||
image_count = all(".publisher_photo img", wait: false).count
|
image_count = all(".publisher_photo img", wait: false).count
|
||||||
find("#photodropzone .x", match: :first).trigger "click"
|
within "ul#photodropzone" do
|
||||||
|
first("img").hover
|
||||||
|
find(".x", match: :first).trigger "click"
|
||||||
|
end
|
||||||
page.assert_selector(".publisher_photo img", count: image_count - 1)
|
page.assert_selector(".publisher_photo img", count: image_count - 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -68,12 +70,6 @@ When /^I post an extremely long status message$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I select "([^"]*)" on the aspect dropdown$/ do |text|
|
When /^I select "([^"]*)" on the aspect dropdown$/ do |text|
|
||||||
page.execute_script(
|
find("button.dropdown-toggle").click
|
||||||
"$('#publisher .dropdown .dropdown_list, #publisher .aspect-dropdown .dropdown-menu')
|
find(".dropdown-menu li", text: text).click
|
||||||
.find('li').each(function(i,el){
|
|
||||||
var elem = $(el);
|
|
||||||
if ('" + text + "' == $.trim(elem.text()) ) {
|
|
||||||
elem.click();
|
|
||||||
}});"
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue