[gnome-build-meta/sam/openqa-python] WIP: Rewrite OpenQA tests in Python




commit 1b8fd7260b4241a1538c8ae97ca062693f5924e8
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Thu Nov 4 13:24:54 2021 +0100

    WIP: Rewrite OpenQA tests in Python
    
    This doesn't run in the upstream container at time of writing because
    it's missing 'Inline' Perl module:
    
        [2021-11-04T12:24:15.764 UTC] [warn] !!! autotest::loadtest: error on tests/gnome_install.py: Can't 
locate Inline.pm in
        @INC (you may need to install the Inline module) (@INC contains: /tests/tests /tests/lib /blib/arch 
/blib/lib /usr/lib/os-autoinst /usr/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi 
/usr/lib/perl5/site_perl/5.26.1 /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.26.1 /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/5.26.1 
/usr/lib/perl5/site_perl) at (eval 119) line 4.
          BEGIN failed--compilation aborted at (eval 119) line 4.
    
    We could manually do this on container startup.

 openqa/main.pm                |  6 +++---
 openqa/tests/gnome_desktop.pm | 15 ---------------
 openqa/tests/gnome_desktop.py |  8 ++++++++
 openqa/tests/gnome_install.pm | 20 --------------------
 openqa/tests/gnome_install.py | 13 +++++++++++++
 openqa/tests/gnome_welcome.pm | 30 ------------------------------
 openqa/tests/gnome_welcome.py | 23 +++++++++++++++++++++++
 7 files changed, 47 insertions(+), 68 deletions(-)
---
diff --git a/openqa/main.pm b/openqa/main.pm
index b6fbf2556..2f8a739e7 100644
--- a/openqa/main.pm
+++ b/openqa/main.pm
@@ -3,7 +3,7 @@ use testapi;
 use autotest;
 use needle;
 
-autotest::loadtest "tests/gnome_install.pm";
-autotest::loadtest "tests/gnome_welcome.pm";
-autotest::loadtest "tests/gnome_desktop.pm";
+autotest::loadtest "tests/gnome_install.py";
+autotest::loadtest "tests/gnome_welcome.py";
+autotest::loadtest "tests/gnome_desktop.py";
 1;
diff --git a/openqa/tests/gnome_desktop.py b/openqa/tests/gnome_desktop.py
new file mode 100644
index 000000000..8d3ba3855
--- /dev/null
+++ b/openqa/tests/gnome_desktop.py
@@ -0,0 +1,8 @@
+from testapi import *
+
+def run(self):
+    assert_and_click('gnome_desktop_tour', timeout=60, button='left');
+    assert_screen('gnome_desktop_desktop', 60);
+
+def test_flags(self):
+    return { 'fatal': 1 }
diff --git a/openqa/tests/gnome_install.py b/openqa/tests/gnome_install.py
new file mode 100644
index 000000000..d0d812639
--- /dev/null
+++ b/openqa/tests/gnome_install.py
@@ -0,0 +1,13 @@
+from testapi import *
+
+def run(self):
+    assert_and_click('gnome_install_1', button='left', timeout=120)
+    assert_and_click('gnome_install_disk', button='left', timeout=10)
+    assert_and_click('gnome_install_disk2', button='left', timeout=10)
+    assert_screen('gnome_install_reformatting1', 120)
+    assert_screen('gnome_install_complete', 120)
+    eject_cd
+    power('reset')
+
+def test_flags(self):
+    return { 'fatal': 1 }
diff --git a/openqa/tests/gnome_welcome.py b/openqa/tests/gnome_welcome.py
new file mode 100644
index 000000000..38f6497dd
--- /dev/null
+++ b/openqa/tests/gnome_welcome.py
@@ -0,0 +1,23 @@
+from testapi import *
+
+def run(self):
+    assert_and_click('gnome_firstboot_welcome', timeout=600, button='left')
+    assert_and_click('gnome_firstboot_language', timeout=10, button='left')
+    assert_and_click('gnome_firstboot_privacy', timeout=10, button='left')
+    assert_screen('gnome_firstboot_timezone_1', 30)
+    type_string('London, East')
+    assert_and_click('gnome_firstboot_timezone_2', timeout=20, button='left')
+    assert_and_click('gnome_firstboot_timezone_3', timeout=20, button='left')
+    assert_and_click('gnome_firstboot_accounts', timeout=10, button='left')
+    assert_screen('gnome_firstboot_aboutyou_1', 10)
+    type_string('testuser')
+    assert_and_click('gnome_firstboot_aboutyou_2', timeout=10, button='left')
+    assert_screen('gnome_firstboot_password_1', 10)
+    type_string('testingtesting123')
+    send_key('tab')
+    type_string('testingtesting123')
+    assert_and_click('gnome_firstboot_password_2', timeout=10, button='left')
+    assert_and_click('gnome_firstboot_complete', timeout=10, button='left')
+
+def test_flags(self):
+    return { 'fatal': 1 }


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