From 40974c2f948cf6a49e6950e8b91a32daa21af69f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 8 Oct 2020 14:47:46 -0700 Subject: [PATCH] Simplify Krusader app test We don't need a separate 'welcome' needle because it just matches on an OK button anyway. So turn that needle into an OK needle (we don't have any existing 'blue OK button' needle) and simplify the logic to a single loop for kde_ok and krusader_settings_close. Signed-off-by: Adam Williamson --- .../{krusader_welcome.json => kde_ok-blue.json} | 4 ++-- .../apps/{krusader_welcome.png => kde_ok-blue.png} | Bin tests/apps_startstop/kde/krusader.pm | 13 +++---------- 3 files changed, 5 insertions(+), 12 deletions(-) rename needles/kde/apps/{krusader_welcome.json => kde_ok-blue.json} (87%) rename needles/kde/apps/{krusader_welcome.png => kde_ok-blue.png} (100%) diff --git a/needles/kde/apps/krusader_welcome.json b/needles/kde/apps/kde_ok-blue.json similarity index 87% rename from needles/kde/apps/krusader_welcome.json rename to needles/kde/apps/kde_ok-blue.json index 258d2ed2..594b2d06 100644 --- a/needles/kde/apps/krusader_welcome.json +++ b/needles/kde/apps/kde_ok-blue.json @@ -1,7 +1,7 @@ { "properties": [], "tags": [ - "krusader_welcome" + "kde_ok" ], "area": [ { @@ -12,4 +12,4 @@ "type": "match" } ] -} \ No newline at end of file +} diff --git a/needles/kde/apps/krusader_welcome.png b/needles/kde/apps/kde_ok-blue.png similarity index 100% rename from needles/kde/apps/krusader_welcome.png rename to needles/kde/apps/kde_ok-blue.png diff --git a/tests/apps_startstop/kde/krusader.pm b/tests/apps_startstop/kde/krusader.pm index 3a3a2fc7..9cf7d655 100644 --- a/tests/apps_startstop/kde/krusader.pm +++ b/tests/apps_startstop/kde/krusader.pm @@ -10,19 +10,12 @@ sub run { # Start the application menu_launch_type "krusader"; - # Deal with the welcome screens - assert_screen ["krusader_welcome", "krusader_settings_close"]; - while (match_has_tag "krusader_welcome") { - assert_and_click "krusader_welcome"; - assert_screen ["krusader_welcome", "krusader_settings_close"]; - } - # Settings close - assert_screen ["krusader_settings_close", "kde_ok"]; + # Deal with the welcome screens, which all have an OK button + assert_screen ["kde_ok", "krusader_settings_close"]; while (match_has_tag "kde_ok") { assert_and_click "kde_ok"; - assert_screen ["krusader_settings_close", "kde_ok"] + assert_screen ["kde_ok", "krusader_settings_close"]; } - assert_and_click "krusader_settings_close"; wait_still_screen 2;