Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.7
obs-server
obs-server-2.7.1-0021-webui-Wait-for-elements-t...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.7.1-0021-webui-Wait-for-elements-to-appear-in-webui-tests.patch of Package obs-server
From 572e7a9caeddb022b818a4bdd4340d01228a7084 Mon Sep 17 00:00:00 2001 From: Oleg Girko <ol@infoserver.lv> Date: Thu, 14 Jul 2016 12:56:17 +0100 Subject: [PATCH 21/29] [webui] Wait for elements to appear in webui tests. This change replaces first (and page.all) methods with find method that waits for element to appear. This solves some timing problems with newer phantomjs with elements appearing not quickly enough to be found. Signed-off-by: Oleg Girko <ol@infoserver.lv> --- src/api/test/functional/webui/download_on_demand_controller_test.rb | 2 +- src/api/test/functional/webui/maintenance_workflow_test.rb | 4 ++-- src/api/test/functional/webui/package_controller_test.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/test/functional/webui/download_on_demand_controller_test.rb b/src/api/test/functional/webui/download_on_demand_controller_test.rb index a709570..cb860a4 100644 --- a/src/api/test/functional/webui/download_on_demand_controller_test.rb +++ b/src/api/test/functional/webui/download_on_demand_controller_test.rb @@ -145,7 +145,7 @@ class Webui::DownloadOnDemandControllerTest < Webui::IntegrationTest find(:id, 'flash-messages').must_have_text('Config successfully saved!') click_link("Repositories") - first(:xpath, "//a[text()='Delete']").click + find(:xpath, "//a[text()='Delete']", match: :first).click page.wont_have_text 'Download on demand repositories' page.wont_have_link 'http://mola.org2' diff --git a/src/api/test/functional/webui/maintenance_workflow_test.rb b/src/api/test/functional/webui/maintenance_workflow_test.rb index ac5557c..37fe67d 100644 --- a/src/api/test/functional/webui/maintenance_workflow_test.rb +++ b/src/api/test/functional/webui/maintenance_workflow_test.rb @@ -56,7 +56,7 @@ class Webui::MaintenanceWorkflowTest < Webui::IntegrationTest login_user('maintenance_coord', 'buildservice', to: project_show_path(project: 'My:Maintenance')) find(:link, 'open request').click - first('.request_link').click + find('.request_link', match: :first).click find(:id, 'description-text').text.must_equal 'I want the update' find(:id, 'action_display_0').must_have_text ('Release in BaseDistro2.0:LinkedUpdateProject') fill_in 'reason', with: 'really? ok' @@ -111,7 +111,7 @@ class Webui::MaintenanceWorkflowTest < Webui::IntegrationTest login_user('maintenance_coord', 'buildservice', to: project_show_path(project: 'My:Maintenance')) find(:link, 'open request').click - first('.request_link').click + find('.request_link', match: :first).click find(:id, 'description-text').text.must_equal 'I have a additional fix' find(:link, 'Merge with existing incident').click # set to not existing incident diff --git a/src/api/test/functional/webui/package_controller_test.rb b/src/api/test/functional/webui/package_controller_test.rb index 56b0c2f..5e60cc5 100644 --- a/src/api/test/functional/webui/package_controller_test.rb +++ b/src/api/test/functional/webui/package_controller_test.rb @@ -256,7 +256,7 @@ class Webui::PackageControllerTest < Webui::IntegrationTest # test reload and wait for the build to finish starttime=Time.now while Time.now - starttime < 10 - first('.icons-reload').click + find('.icons-reload', match: :first).click if page.has_selector? '.buildstatus' break if first('.buildstatus').text == 'succeeded' end @@ -544,7 +544,7 @@ class Webui::PackageControllerTest < Webui::IntegrationTest use_js login_king to: package_live_build_log_path(package: 'pack2.linked', project: 'BaseDistro2.0', repository: 'BaseDistro2_repo', arch: 'i586') - page.all(:link, 'Trigger Rebuild')[0].click + find_link('Trigger Rebuild', match: :first).click find('#flash-messages').must_have_text('Triggered rebuild for BaseDistro2.0/pack2.linked successfully.') end end -- 2.7.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor