Commit ceabbcd089f4712ea04360000cc6fe58db66640c

Authored by Daniel Cunha
1 parent f1e3ef5c

forum.feature

features/forum.feature
@@ -10,18 +10,18 @@ Feature: forum @@ -10,18 +10,18 @@ Feature: forum
10 And "joaosilva" has no articles 10 And "joaosilva" has no articles
11 And I am logged in as "joaosilva" 11 And I am logged in as "joaosilva"
12 12
13 - @selenium 13 + @selenium @ignore-hidden-elements
14 Scenario: create a forum 14 Scenario: create a forum
15 - Given I am on Joao Silva's control panel 15 + Given I am on joaosilva's control panel
16 And I follow "Manage Content" 16 And I follow "Manage Content"
17 And I follow "New content" 17 And I follow "New content"
18 - When I follow "Forum" and wait 18 + When I follow "Forum"
19 And I fill in "Title" with "My Forum" 19 And I fill in "Title" with "My Forum"
20 - And I press "Save" and wait 20 + And I press "Save"
21 Then I should see "Configure forum" 21 Then I should see "Configure forum"
22 22
23 Scenario: redirect to forum after create forum from cms 23 Scenario: redirect to forum after create forum from cms
24 - Given I go to the Control panel 24 + Given I go to joaosilva's control panel
25 And I follow "Manage Content" 25 And I follow "Manage Content"
26 And I follow "New content" 26 And I follow "New content"
27 When I follow "Forum" 27 When I follow "Forum"
@@ -30,13 +30,13 @@ Feature: forum @@ -30,13 +30,13 @@ Feature: forum
30 Then I should be on /joaosilva/forum-from-cms 30 Then I should be on /joaosilva/forum-from-cms
31 31
32 Scenario: create multiple forums 32 Scenario: create multiple forums
33 - Given I go to the Control panel 33 + Given I go to joaosilva's control panel
34 And I follow "Manage Content" 34 And I follow "Manage Content"
35 And I follow "New content" 35 And I follow "New content"
36 And I follow "Forum" 36 And I follow "Forum"
37 And I fill in "Title" with "Forum One" 37 And I fill in "Title" with "Forum One"
38 And I press "Save" 38 And I press "Save"
39 - Then I go to the Control panel 39 + Then I go to joaosilva's control panel
40 And I follow "Manage Content" 40 And I follow "Manage Content"
41 And I follow "New content" 41 And I follow "New content"
42 And I follow "Forum" 42 And I follow "Forum"
@@ -46,7 +46,7 @@ Feature: forum @@ -46,7 +46,7 @@ Feature: forum
46 And I should be on /joaosilva/forum-two 46 And I should be on /joaosilva/forum-two
47 47
48 Scenario: cancel button back to cms 48 Scenario: cancel button back to cms
49 - Given I go to the Control panel 49 + Given I go to joaosilva's control panel
50 And I follow "Manage Content" 50 And I follow "Manage Content"
51 And I follow "New content" 51 And I follow "New content"
52 And I follow "Forum" 52 And I follow "Forum"
@@ -54,7 +54,7 @@ Feature: forum @@ -54,7 +54,7 @@ Feature: forum
54 Then I should be on /myprofile/joaosilva/cms 54 Then I should be on /myprofile/joaosilva/cms
55 55
56 Scenario: cancel button back to myprofile 56 Scenario: cancel button back to myprofile
57 - Given I go to the Control panel 57 + Given I go to joaosilva's control panel
58 And I follow "Manage Content" 58 And I follow "Manage Content"
59 And I follow "New content" 59 And I follow "New content"
60 And I follow "Forum" 60 And I follow "Forum"
@@ -66,8 +66,8 @@ Feature: forum @@ -66,8 +66,8 @@ Feature: forum
66 Given the following forums 66 Given the following forums
67 | owner | name | 67 | owner | name |
68 | joaosilva | Forum One | 68 | joaosilva | Forum One |
69 - And I visit "/joaosilva/forum-one" and wait  
70 - When I follow "Configure forum" and wait 69 + And I go to /joaosilva/forum-one
  70 + When I follow "Configure forum"
71 Then I should be on edit "Forum One" by joaosilva 71 Then I should be on edit "Forum One" by joaosilva
72 72
73 Scenario: last topic update by unautenticated user should not link 73 Scenario: last topic update by unautenticated user should not link
@@ -94,4 +94,4 @@ Feature: forum @@ -94,4 +94,4 @@ Feature: forum
94 | article | author | title | body | 94 | article | author | title | body |
95 | Post one | joaosilva | Hi all | Hi all | 95 | Post one | joaosilva | Hi all | Hi all |
96 When I go to /joaosilva/forum 96 When I go to /joaosilva/forum
97 - Then I should see "Joao" linking to "http:///joaosilva" 97 + Then I should see "Joao" linking to "http://localhost/joaosilva"
features/step_definitions/custom_web_steps.rb
@@ -12,6 +12,11 @@ Then /^I should not see "([^"]*)" link$/ do |text| @@ -12,6 +12,11 @@ Then /^I should not see "([^"]*)" link$/ do |text|
12 page.should have_no_css('a', :text => text) 12 page.should have_no_css('a', :text => text)
13 end 13 end
14 14
  15 +When /^I should see "([^\"]+)" linking to "([^\"]+)"$/ do |text, href|
  16 + page.should have_selector("a:contains('#{text}')")
  17 + page.should have_selector("a[href='#{href}']")
  18 +end
  19 +
15 When /^I reload and wait for the page$/ do 20 When /^I reload and wait for the page$/ do
16 raise "Why why need this? Remove!" 21 raise "Why why need this? Remove!"
17 visit page.driver.browser.current_url 22 visit page.driver.browser.current_url