From 35660a222eba577441b13015170df589b524d37b Mon Sep 17 00:00:00 2001 From: Sanad Liaquat Date: Tue, 5 Mar 2019 12:41:59 +0500 Subject: Add qa class and some refactor --- app/views/layouts/nav/sidebar/_admin.html.haml | 2 +- qa/qa/page/project/new.rb | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index 2fdd65f639b..bb2d206ba91 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -220,7 +220,7 @@ = _('Repository') - if template_exists?('admin/application_settings/templates') = nav_link(path: 'application_settings#templates') do - = link_to templates_admin_application_settings_path, title: _('Templates') do + = link_to templates_admin_application_settings_path, title: _('Templates'), class: 'qa-admin-settings-template-item' do %span = _('Templates') = nav_link(path: 'application_settings#ci_cd') do diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb index eabeae1acc4..552b2293115 100644 --- a/qa/qa/page/project/new.rb +++ b/qa/qa/page/project/new.rb @@ -24,11 +24,14 @@ module QA end def choose_test_namespace + choose_namespace(Runtime::Namespace.path) + end + + def choose_namespace(namespace) retry_on_exception do click_body click_element :project_namespace_select - - search_and_select(Runtime::Namespace.path) + search_and_select(namespace) end end -- cgit v1.2.1 From 3ca673281d3da3dd0e5be71657b30d3cd2de7fa0 Mon Sep 17 00:00:00 2001 From: Sanad Liaquat Date: Tue, 5 Mar 2019 18:31:35 +0500 Subject: Use prefer_exact match type --- qa/qa/page/component/select2.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/qa/page/component/select2.rb b/qa/qa/page/component/select2.rb index 98bcb96b92c..3c3461d6b20 100644 --- a/qa/qa/page/component/select2.rb +++ b/qa/qa/page/component/select2.rb @@ -3,7 +3,7 @@ module QA module Component module Select2 def select_item(item_text) - find('.select2-result-label', text: item_text).click + find('.select2-result-label', text: item_text, match: :prefer_exact).click end def clear_current_selection_if_present -- cgit v1.2.1