summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-03-18 01:27:52 +0000
committerRobert Speicher <robert@gitlab.com>2016-03-18 01:27:52 +0000
commitfc75de7dc2c90deb0dccede8a42ada8cc4792678 (patch)
tree580344b27d03be9e114b1effee773a52bdb7113a
parent4c517ce6dc6cecd885d7db473d6ad3905a2f761c (diff)
parent0901d5172429630c8d1ea6d8e91be71a2e690043 (diff)
downloadgitlab-ce-fc75de7dc2c90deb0dccede8a42ada8cc4792678.tar.gz
Merge branch 'improve-award-emoji-spinach-tests' into 'master'
Improve award emoji test reliability by checking that the emoji is displayed before the search field is focused See merge request !3288
-rw-r--r--features/project/issues/award_emoji.feature11
-rw-r--r--features/steps/project/issues/award_emoji.rb4
2 files changed, 11 insertions, 4 deletions
diff --git a/features/project/issues/award_emoji.feature b/features/project/issues/award_emoji.feature
index 2945bb3753a..f0fd414a9f9 100644
--- a/features/project/issues/award_emoji.feature
+++ b/features/project/issues/award_emoji.feature
@@ -18,21 +18,24 @@ Feature: Award Emoji
@javascript
Scenario: I add and remove custom award in the issue
Given I click to emoji-picker
- Then The search field is focused
- And I click to emoji in the picker
+ Then The emoji menu is visible
+ And The search field is focused
+ Then I click to emoji in the picker
Then I have award added
And I can remove it by clicking to icon
@javascript
Scenario: I can see the list of emoji categories
Given I click to emoji-picker
- Then The search field is focused
+ Then The emoji menu is visible
+ And The search field is focused
Then I can see the activity and food categories
@javascript
Scenario: I can search emoji
Given I click to emoji-picker
- Then The search field is focused
+ Then The emoji menu is visible
+ And The search field is focused
And I search "hand"
Then I see search result for "hand"
diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb
index ce2554bc80d..c5d45709b44 100644
--- a/features/steps/project/issues/award_emoji.rb
+++ b/features/steps/project/issues/award_emoji.rb
@@ -92,6 +92,10 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
end
end
+ step 'The emoji menu is visible' do
+ page.find(".emoji-menu.is-visible")
+ end
+
step 'The search field is focused' do
expect(page).to have_selector('#emoji_search')
expect(page.evaluate_script('document.activeElement.id')).to eq('emoji_search')