diff options
author | Sven Kroell <sven.kroell@googlemail.com> | 2018-12-07 10:28:15 +0000 |
---|---|---|
committer | Sven Kroell <sven.kroell@googlemail.com> | 2018-12-07 10:28:15 +0000 |
commit | d5bcb9054b4c8f881814114a9891ec2b645a2429 (patch) | |
tree | b5bb2375d446b4a2b0200fad3a78f1f6e33490e2 | |
parent | 1b80b2ac2f471d7c6984fe5c2846f09c1d539f71 (diff) | |
download | gitlab-ce-sven.kroell/52707_add_test_for_issue_closing-qa.tar.gz |
add ffaker to gemfile and optimise checking for available notessven.kroell/52707_add_test_for_issue_closing-qa
-rw-r--r-- | qa/Gemfile | 5 | ||||
-rw-r--r-- | qa/qa/page/project/issue/show.rb | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/qa/Gemfile b/qa/Gemfile index d69c71003ae..31ade7b461b 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -1,9 +1,10 @@ source 'https://rubygems.org' -gem 'pry-byebug', '~> 3.5.1', platform: :mri +gem 'airborne', '~> 0.2.13' gem 'capybara', '~> 2.16.1' gem 'capybara-screenshot', '~> 1.0.18' +gem 'ffaker', '~> 2.10' +gem 'pry-byebug', '~> 3.5.1', platform: :mri gem 'rake', '~> 12.3.0' gem 'rspec', '~> 3.7' gem 'selenium-webdriver', '~> 3.8.0' -gem 'airborne', '~> 0.2.13' diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb index b7202dcd014..5bede6f28e3 100644 --- a/qa/qa/page/project/issue/show.rb +++ b/qa/qa/page/project/issue/show.rb @@ -61,18 +61,16 @@ module QA def first_note_header wait_for_notes_to_be_displayed - notes = all_elements(:note_header) - raise ElementNotFound, "Couldn't find any notes on the issue page" if notes.count.zero? - - notes.first.text + all_elements(:note_header).first.text end private def wait_for_notes_to_be_displayed - wait(reload: false, max: 5) do + notes_found = wait(reload: false, max: 5) do all_elements(:note_header).count > 0 end + raise ElementNotFound, "Couldn't find any notes on the issue page" unless notes_found end end end |