From d5bcb9054b4c8f881814114a9891ec2b645a2429 Mon Sep 17 00:00:00 2001 From: Sven Kroell Date: Fri, 7 Dec 2018 10:28:15 +0000 Subject: add ffaker to gemfile and optimise checking for available notes --- qa/Gemfile | 5 +++-- 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 -- cgit v1.2.1