cleanup some publishing/posting cukes, hopefully stabilizing them
This commit is contained in:
parent
19687c32a4
commit
7680165b14
5 changed files with 94 additions and 74 deletions
|
|
@ -28,23 +28,20 @@ Feature: posting from the main page
|
||||||
|
|
||||||
Scenario: post a text-only message to all aspects
|
Scenario: post a text-only message to all aspects
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I fill in the following:
|
When I write the status message "I am eating yogurt"
|
||||||
| status_message_fake_text | I am eating yogurt |
|
And I submit the publisher
|
||||||
And I press "Share"
|
|
||||||
|
|
||||||
And I go to the aspects page
|
And I go to the aspects page
|
||||||
Then "I am eating yogurt" should be post 1
|
Then "I am eating yogurt" should be post 1
|
||||||
|
|
||||||
Scenario: re-posting a text-only message
|
Scenario: re-posting a text-only message
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I fill in the following:
|
When I write the status message "The World needs more Cats."
|
||||||
| status_message_fake_text | The World needs more Cats. |
|
And I submit the publisher
|
||||||
And I press "Share"
|
|
||||||
|
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I fill in the following:
|
When I write the status message "The World needs more Cats."
|
||||||
| status_message_fake_text | The World needs more Cats. |
|
And I submit the publisher
|
||||||
And I press "Share"
|
|
||||||
|
|
||||||
And I go to the aspects page
|
And I go to the aspects page
|
||||||
Then "The World needs more Cats." should be post 1
|
Then "The World needs more Cats." should be post 1
|
||||||
|
|
@ -58,10 +55,9 @@ Feature: posting from the main page
|
||||||
Scenario: post a text-only message to just one aspect
|
Scenario: post a text-only message to just one aspect
|
||||||
When I select only "PostingTo" aspect
|
When I select only "PostingTo" aspect
|
||||||
And I expand the publisher
|
And I expand the publisher
|
||||||
And I fill in the following:
|
When I write the status message "I am eating a yogurt"
|
||||||
| status_message_fake_text | I am eating a yogurt |
|
|
||||||
|
|
||||||
And I press "Share"
|
And I submit the publisher
|
||||||
|
|
||||||
When I am on the aspects page
|
When I am on the aspects page
|
||||||
And I select only "PostingTo" aspect
|
And I select only "PostingTo" aspect
|
||||||
|
|
@ -74,9 +70,8 @@ Feature: posting from the main page
|
||||||
Scenario: post a photo with text
|
Scenario: post a photo with text
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
||||||
When I fill in the following:
|
When I write the status message "Look at this dog"
|
||||||
| status_message_fake_text | Look at this dog |
|
And I submit the publisher
|
||||||
And I press "Share"
|
|
||||||
And I go to the aspects page
|
And I go to the aspects page
|
||||||
Then I should see a "img" within ".stream_element div.photo_attachments"
|
Then I should see a "img" within ".stream_element div.photo_attachments"
|
||||||
And I should see "Look at this dog" within ".stream_element"
|
And I should see "Look at this dog" within ".stream_element"
|
||||||
|
|
@ -112,8 +107,7 @@ Feature: posting from the main page
|
||||||
Scenario: back out of uploading a picture to a post with text
|
Scenario: back out of uploading a picture to a post with text
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
When I fill in the following:
|
When I write the status message "I am eating a yogurt"
|
||||||
| status_message_fake_text | I am eating a yogurt |
|
|
||||||
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
||||||
And I click to delete the first uploaded photo
|
And I click to delete the first uploaded photo
|
||||||
Then I should not see an uploaded image within the photo drop zone
|
Then I should not see an uploaded image within the photo drop zone
|
||||||
|
|
@ -122,8 +116,7 @@ Feature: posting from the main page
|
||||||
Scenario: back out of uploading a picture when another has been attached
|
Scenario: back out of uploading a picture when another has been attached
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
When I fill in the following:
|
When I write the status message "I am eating a yogurt"
|
||||||
| status_message_fake_text | I am eating a yogurt |
|
|
||||||
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
||||||
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
And I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"
|
||||||
And I click to delete the first uploaded photo
|
And I click to delete the first uploaded photo
|
||||||
|
|
@ -133,9 +126,8 @@ Feature: posting from the main page
|
||||||
@wip
|
@wip
|
||||||
Scenario: hide a contact's post
|
Scenario: hide a contact's post
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I fill in the following:
|
When I write the status message "Here is a post for you to hide"
|
||||||
| status_message_fake_text | Here is a post for you to hide |
|
And I submit the publisher
|
||||||
And I press "Share"
|
|
||||||
|
|
||||||
And I log out
|
And I log out
|
||||||
And I sign in as "alice@alice.alice"
|
And I sign in as "alice@alice.alice"
|
||||||
|
|
@ -151,9 +143,8 @@ Feature: posting from the main page
|
||||||
|
|
||||||
Scenario: delete one of my posts
|
Scenario: delete one of my posts
|
||||||
Given I expand the publisher
|
Given I expand the publisher
|
||||||
When I fill in the following:
|
When I write the status message "I am eating a yogurt"
|
||||||
| status_message_fake_text | I am eating a yogurt |
|
And I submit the publisher
|
||||||
And I press "Share"
|
|
||||||
And I go to the aspects page
|
And I go to the aspects page
|
||||||
And I hover over the ".stream_element"
|
And I hover over the ".stream_element"
|
||||||
And I click to delete the first post
|
And I click to delete the first post
|
||||||
|
|
@ -165,7 +156,7 @@ Feature: posting from the main page
|
||||||
And I press the aspect dropdown
|
And I press the aspect dropdown
|
||||||
And I toggle the aspect "PostingTo"
|
And I toggle the aspect "PostingTo"
|
||||||
And I append "I am eating a yogurt" to the publisher
|
And I append "I am eating a yogurt" to the publisher
|
||||||
And I press "Share"
|
And I submit the publisher
|
||||||
|
|
||||||
And I am on the aspects page
|
And I am on the aspects page
|
||||||
And I select only "PostingTo" aspect
|
And I select only "PostingTo" aspect
|
||||||
|
|
@ -179,13 +170,13 @@ Feature: posting from the main page
|
||||||
And I press the aspect dropdown
|
And I press the aspect dropdown
|
||||||
And I toggle the aspect "PostingTo"
|
And I toggle the aspect "PostingTo"
|
||||||
And I append "I am eating a yogurt" to the publisher
|
And I append "I am eating a yogurt" to the publisher
|
||||||
And I press "Share"
|
And I submit the publisher
|
||||||
|
|
||||||
And I expand the publisher
|
And I expand the publisher
|
||||||
And I press the aspect dropdown
|
And I press the aspect dropdown
|
||||||
And I toggle the aspect "Besties"
|
And I toggle the aspect "Besties"
|
||||||
And I append "And cornflakes also" to the publisher
|
And I append "And cornflakes also" to the publisher
|
||||||
And I press "Share"
|
And I submit the publisher
|
||||||
|
|
||||||
And I am on the aspects page
|
And I am on the aspects page
|
||||||
And I select only "PostingTo" aspect
|
And I select only "PostingTo" aspect
|
||||||
|
|
@ -201,9 +192,8 @@ Feature: posting from the main page
|
||||||
# (NOTE) make this a jasmine spec
|
# (NOTE) make this a jasmine spec
|
||||||
Scenario: reject deletion one of my posts
|
Scenario: reject deletion one of my posts
|
||||||
When I expand the publisher
|
When I expand the publisher
|
||||||
When I fill in the following:
|
When I write the status message "I am eating a yogurt"
|
||||||
| status_message_fake_text | I am eating a yogurt |
|
And I submit the publisher
|
||||||
And I press "Share"
|
|
||||||
|
|
||||||
And I hover over the ".stream_element"
|
And I hover over the ".stream_element"
|
||||||
And I prepare the deletion of the first post
|
And I prepare the deletion of the first post
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,21 @@
|
||||||
|
module AspectCukeHelpers
|
||||||
|
def click_aspect_dropdown
|
||||||
|
find('.dropdown .button').click
|
||||||
|
end
|
||||||
|
|
||||||
|
def toggle_aspect(a_name)
|
||||||
|
a_id = @me.aspects.where(name: a_name).pluck(:id).first
|
||||||
|
aspect_css = ".dropdown li[data-aspect_id='#{a_id}']"
|
||||||
|
page.should have_selector(aspect_css)
|
||||||
|
find(aspect_css).click
|
||||||
|
end
|
||||||
|
|
||||||
|
def aspect_dropdown_visible?
|
||||||
|
find('.aspect_membership.dropdown.active').should be_visible
|
||||||
|
end
|
||||||
|
end
|
||||||
|
World(AspectCukeHelpers)
|
||||||
|
|
||||||
When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name|
|
When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name|
|
||||||
within(".all_aspects") do
|
within(".all_aspects") do
|
||||||
li = find('li', text: aspect_name)
|
li = find('li', text: aspect_name)
|
||||||
|
|
@ -23,20 +41,6 @@ When /^I select "([^"]*)" aspect as well$/ do |aspect_name|
|
||||||
step %Q(I should see "#{aspect_name}" aspect selected)
|
step %Q(I should see "#{aspect_name}" aspect selected)
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see "([^"]*)" aspect selected$/ do |aspect_name|
|
|
||||||
aspect = @me.aspects.where(:name => aspect_name).first
|
|
||||||
within("#aspects_list") do
|
|
||||||
page.should have_css "li[data-aspect_id='#{aspect.id}'] .selected"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Then /^I should see "([^"]*)" aspect unselected$/ do |aspect_name|
|
|
||||||
aspect = @me.aspects.where(:name => aspect_name).first
|
|
||||||
within("#aspects_list") do
|
|
||||||
page.should have_no_css "li[data-aspect_id='#{aspect.id}'] .selected"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I check the first contact list button$/ do
|
When /^I check the first contact list button$/ do
|
||||||
find(".contact_list .button", match: :first).tap do |button|
|
find(".contact_list .button", match: :first).tap do |button|
|
||||||
button.click
|
button.click
|
||||||
|
|
@ -51,3 +55,29 @@ When /^I uncheck the first contact list button$/ do
|
||||||
sleep 1 # The expectation above should wait for the request to finsh, but that doesn't work for some reason
|
sleep 1 # The expectation above should wait for the request to finsh, but that doesn't work for some reason
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
When /^I press the aspect dropdown$/ do
|
||||||
|
click_aspect_dropdown
|
||||||
|
end
|
||||||
|
|
||||||
|
And /^I toggle the aspect "([^"]*)"$/ do |name|
|
||||||
|
toggle_aspect(name)
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^I should see "([^"]*)" aspect selected$/ do |aspect_name|
|
||||||
|
aspect = @me.aspects.where(:name => aspect_name).first
|
||||||
|
within("#aspects_list") do
|
||||||
|
page.should have_css "li[data-aspect_id='#{aspect.id}'] .selected"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^I should see "([^"]*)" aspect unselected$/ do |aspect_name|
|
||||||
|
aspect = @me.aspects.where(:name => aspect_name).first
|
||||||
|
within("#aspects_list") do
|
||||||
|
page.should have_no_css "li[data-aspect_id='#{aspect.id}'] .selected"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Then /^the aspect dropdown should be visible$/ do
|
||||||
|
aspect_dropdown_visible?
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -64,19 +64,6 @@ And /^I expand the publisher$/ do
|
||||||
click_publisher
|
click_publisher
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I press the aspect dropdown$/ do
|
|
||||||
find('.dropdown .button').click
|
|
||||||
end
|
|
||||||
|
|
||||||
Then /^the aspect dropdown should be visible$/ do
|
|
||||||
find(:css, '.aspect_membership.dropdown.active').should be_visible
|
|
||||||
end
|
|
||||||
|
|
||||||
And /^I toggle the aspect "([^"]*)"$/ do |aspect_name|
|
|
||||||
aspect = @me.aspects.where(:name => aspect_name).first
|
|
||||||
find(".dropdown li[data-aspect_id='#{aspect.id}']").click
|
|
||||||
end
|
|
||||||
|
|
||||||
Then /^the publisher should be expanded$/ do
|
Then /^the publisher should be expanded$/ do
|
||||||
find("#publisher")["class"].should_not include("closed")
|
find("#publisher")["class"].should_not include("closed")
|
||||||
end
|
end
|
||||||
|
|
@ -85,18 +72,6 @@ Then /^the text area wrapper mobile should be with attachments$/ do
|
||||||
find("#publisher_textarea_wrapper")["class"].should include("with_attachments")
|
find("#publisher_textarea_wrapper")["class"].should include("with_attachments")
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I append "([^"]*)" to the publisher$/ do |stuff|
|
|
||||||
elem = find('#status_message_fake_text')
|
|
||||||
elem.native.send_keys(' ' + stuff)
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I append "([^"]*)" to the publisher mobile$/ do |stuff|
|
|
||||||
elem = find('#status_message_text')
|
|
||||||
elem.native.send_keys(' ' + stuff)
|
|
||||||
|
|
||||||
find('#status_message_text').value.should include(stuff)
|
|
||||||
end
|
|
||||||
|
|
||||||
And /^I want to mention (?:him|her) from the profile$/ do
|
And /^I want to mention (?:him|her) from the profile$/ do
|
||||||
find('#mention_button').click
|
find('#mention_button').click
|
||||||
within('#facebox') do
|
within('#facebox') do
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,10 @@ And /^the post with text "([^"]*)" is reshared by "([^"]*)"$/ do |text, email|
|
||||||
user.post(:reshare, :root_guid => root.guid, :public => true, :to => user.aspects)
|
user.post(:reshare, :root_guid => root.guid, :public => true, :to => user.aspects)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
And /^I submit the publisher$/ do
|
||||||
|
submit_publisher
|
||||||
|
end
|
||||||
|
|
||||||
When /^I click on the first block button/ do
|
When /^I click on the first block button/ do
|
||||||
find(".stream_element", match: :first).hover
|
find(".stream_element", match: :first).hover
|
||||||
find(".block_user").click
|
find(".block_user").click
|
||||||
|
|
@ -71,6 +75,14 @@ When /^I insert an extremely long status message$/ do
|
||||||
write_in_publisher("I am a very interesting message " * 64)
|
write_in_publisher("I am a very interesting message " * 64)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
When /^I append "([^"]*)" to the publisher$/ do |text|
|
||||||
|
append_to_publisher(text)
|
||||||
|
end
|
||||||
|
|
||||||
|
When /^I append "([^"]*)" to the publisher mobile$/ do |text|
|
||||||
|
append_to_publisher(text, '#status_message_text')
|
||||||
|
end
|
||||||
|
|
||||||
When /^I open the show page of the "([^"]*)" post$/ do |post_text|
|
When /^I open the show page of the "([^"]*)" post$/ do |post_text|
|
||||||
visit post_path_by_content(post_text)
|
visit post_path_by_content(post_text)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,23 @@ module PublishingCukeHelpers
|
||||||
fill_in 'status_message_fake_text', with: txt
|
fill_in 'status_message_fake_text', with: txt
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def append_to_publisher(txt, input_selector='#status_message_fake_text')
|
||||||
|
elem = find(input_selector)
|
||||||
|
elem.native.send_keys(' ' + txt)
|
||||||
|
|
||||||
|
# make sure the other text field got the new contents
|
||||||
|
find('#status_message_text', visible: false).value.should include(txt)
|
||||||
|
end
|
||||||
|
|
||||||
def make_post(text)
|
def make_post(text)
|
||||||
write_in_publisher(txt)
|
write_in_publisher(text)
|
||||||
find(".creation").click
|
submit_publisher
|
||||||
page.should have_content text unless page.has_css? '.nsfw-shield'
|
end
|
||||||
|
|
||||||
|
def submit_publisher
|
||||||
|
txt = find('#publisher #status_message_fake_text').value
|
||||||
|
find('#publisher .creation').click
|
||||||
|
page.should have_content(txt) unless page.has_css?('.nsfw-shield')
|
||||||
end
|
end
|
||||||
|
|
||||||
def click_and_post(text)
|
def click_and_post(text)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue