From 6078a8171dd66e427e76e98a0c7a11fb9bb4232e Mon Sep 17 00:00:00 2001 From: Olli Leppanen Date: Tue, 30 Nov 2010 12:15:51 +0200 Subject: [PATCH] Changes: Added the check that launcher can be found to perf tests RevBy:TrustMe --- .../Harmattan/TestScripts/get-coordinates.rb | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/tests/Harmattan/TestScripts/get-coordinates.rb b/tests/Harmattan/TestScripts/get-coordinates.rb index ec1ad79..0c1dab2 100755 --- a/tests/Harmattan/TestScripts/get-coordinates.rb +++ b/tests/Harmattan/TestScripts/get-coordinates.rb @@ -71,13 +71,13 @@ system("initctl stop xsession/mprogressindicator") while appOnTop.attribute('objectName') != 'meegotouchhome' # Killing the topmost application with xkill - system "DISPLAY=:0 xkill &" - sleep(0.5) - sut.tap_screen(50, 50) -# fullName = appOnTop.attribute('FullName') -# puts "Now killing #{fullName} from the top" -# system "pkill #{fullName}" - appOnTop = sut.application() +# system "DISPLAY=:0 xkill &" +# sleep(0.5) +# sut.tap_screen(50, 50) + fullName = appOnTop.attribute('FullName') + puts "Now killing #{fullName} from the top" + system "pkill #{fullName}" + appOnTop = sut.application() end # Application grid should be now visible @@ -91,8 +91,19 @@ end sleep(2) if @meegoHome.test_object_exists?("LauncherButton", :text => appName) icon = @meegoHome.LauncherButton(:name => "LauncherButton", :text => appName) + + grid = nil + if @meegoHome.test_object_exists?("Launcher" ) + grid = @meegoHome.Launcher + elsif @meegoHome.test_object_exists?("SwipeLauncher" ) + grid = @meegoHome.SwipeLauncher + else + raise "Launcher not found!" + exit 1 + end + while icon.attribute('visibleOnScreen') == 'false' || @meegoHome.LauncherButton(:name => "LauncherButton", :text => appName).attribute('y').to_i > 400 - @meegoHome.Launcher.MPannableViewport( :name => 'SwipePage' ).MWidget( :name => 'glass' ).gesture(:Up, 1, 300) + grid.MPannableViewport( :name => 'SwipePage' ).MWidget( :name => 'glass' ).gesture(:Up, 1, 300) sleep(0.2) icon.refresh end @@ -108,5 +119,5 @@ else raise "Application not found in Application grid" exit 1 end - +