[gnome-build-meta/sam/settings-test] openqa: Add an example test for Settings




commit 2a900a9f43bd4429a10670deed356abce5d55785
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Fri Sep 24 10:39:18 2021 +0100

    openqa: Add an example test for Settings
    
    This shows how to launch Settings and save a screenshot, useful for
    manual verification that the app works.

 openqa/lib/gnomeutils.pm      | 26 ++++++++++++++++++++++++++
 openqa/main.pm                |  2 ++
 openqa/tests/apps_settings.pm | 15 +++++++++++++++
 3 files changed, 43 insertions(+)
---
diff --git a/openqa/lib/gnomeutils.pm b/openqa/lib/gnomeutils.pm
new file mode 100644
index 000000000..c329f6ff5
--- /dev/null
+++ b/openqa/lib/gnomeutils.pm
@@ -0,0 +1,26 @@
+sub exit_activities_view {
+    send_key('esc');
+}
+
+sub run_command {
+    my $command = $_[0];
+    my $desktop_runner_hotkey = 'alt-f2';
+
+    exit_activities_view
+
+    type_string($command);
+    send_key 'ret';
+
+    wait_still_screen(2);
+    save_screenshot;
+}
+
+sub start_app {
+    my $command = $_[0];
+    run_command($command);
+
+    wait_still_screen(3);
+    save_screenshot;
+}
+
+1;
diff --git a/openqa/main.pm b/openqa/main.pm
index b6fbf2556..041129ce7 100644
--- a/openqa/main.pm
+++ b/openqa/main.pm
@@ -2,8 +2,10 @@ use strict;
 use testapi;
 use autotest;
 use needle;
+use File::Basename;
 
 autotest::loadtest "tests/gnome_install.pm";
 autotest::loadtest "tests/gnome_welcome.pm";
 autotest::loadtest "tests/gnome_desktop.pm";
+autotest::loadtest "tests/apps_settings.pm";
 1;
diff --git a/openqa/tests/apps_settings.pm b/openqa/tests/apps_settings.pm
new file mode 100644
index 000000000..cc29e3119
--- /dev/null
+++ b/openqa/tests/apps_settings.pm
@@ -0,0 +1,15 @@
+use base 'basetest';
+use strict;
+use testapi;
+use gnomeutils;
+
+sub run {
+    start_app('gnome-control-center');
+    send_key('alt-f4');
+}
+
+sub test_flags {
+    return { fatal => 1 };
+}
+
+1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]