From dca608aa06dfe3f3f171babab0d2b7a114508903 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 13 Jun 2016 10:19:44 +0200 Subject: [PATCH] Added notify_close() to closed notify messages. --- test/browser/translation_test.rb | 1 + test/browser_test_helper.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/test/browser/translation_test.rb b/test/browser/translation_test.rb index fed45ef87..e9fa63ee4 100644 --- a/test/browser/translation_test.rb +++ b/test/browser/translation_test.rb @@ -49,6 +49,7 @@ class TranslationTest < TestCase click(css: 'a[href="#manage"]') click(css: 'a[href="#system/translation"]') + notify_close(optional: true) # to be not in click area set( css: '#content input.js-Item[data-source="Translations"]', value: 'Übersetzung2', diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index e2efb5f3c..1b1e7c7b0 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -293,6 +293,32 @@ class TestCase < Test::Unit::TestCase sleep 1 end +=begin + + notify_close( + browser: browser1, + optional: true, + ) + +=end + + def notify_close(params = {}) + switch_window_focus(params) + log('notify_close', params) + + instance = params[:browser] || @browser + + notify = instance.find_elements(css: '.noty_inline_layout_container.i-am-new')[0] + if !params[:optional] && !notify + screenshot(browser: instance, comment: 'no_notify') + raise 'Unable to closes notify, no notify found!' + end + return if !notify + notify.click + assert(true, 'notify closed') + sleep 1 + end + =begin location(