[Fuego] [PATCH 09/16] Include add-jobs, add-views and build-jobs tests

Guilherme Campos Camargo guicc at profusion.mobi
Thu Mar 29 00:08:25 UTC 2018


Those tests are using a combination of ShExpect and SeleniumHQ for
executing the command and checking if the website has responded
properly.

For now, SeleniumHQ is just being used for viewing the results on the
website, and not for sending commands. In other words, build-jobs is
being triggered through the command-line only, and not through the
Jenkins UI.

Signed-off-by: Guilherme Campos Camargo <guicc at profusion.mobi>
---
 engine/tests/Functional.fuegotest/test_run.py | 34 +++++++++++++++++----------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/engine/tests/Functional.fuegotest/test_run.py b/engine/tests/Functional.fuegotest/test_run.py
index e03853b..09b3a95 100755
--- a/engine/tests/Functional.fuegotest/test_run.py
+++ b/engine/tests/Functional.fuegotest/test_run.py
@@ -516,20 +516,30 @@ def main():
         return 1
 
     COMMANDS_TO_TEST = [
-        ShExpect(
-            'echo $\'hello\n\n\nfrom\n\n\ncontainer\'',
-            r'hello\s+from\s+container'),
-        ShExpect(
-            'cat -ThisOptionDoesNotExists', expected_result=1),
-        ShExpect('ftc add-nodes docker'),
-        ShExpect(
-            'ftc list-nodes', r'Jenkins nodes in this system:\s*docker\s*.*'),
-        ShExpect('ftc add-jobs -b docker -p testplan_docker'),
-        ShExpect(
-            'ftc list-jobs', r'Jenkins jobs in this system:(\s*docker\..*)+'),
+        # Set Selenium Browser root
         Visit(url=container.get_url()),
+
+        # Add Nodes
+        ShExpect('ftc add-nodes docker'),
+        ShExpect('ftc list-nodes -q', r'.*docker.*'),
+        CheckText(_id='executors', text='master'),
         CheckText(_id='executors', text='docker'),
-        CheckText(_id='executors', text='master')
+
+        # Add Fuego TestPlan
+        ShExpect('ftc add-jobs -b docker -p testplan_fuego_tests'),
+        ShExpect('ftc list-jobs', r'.*docker\.testplan_fuego_tests\.batch.*'),
+
+        ClickLink(linktext='docker'),
+        CheckText(_id='projectstatus', text='docker.testplan_fuego_tests.batch'),
+        Back(),
+
+        # Install Views
+        ShExpect('ftc add-view batch .*.batch'),
+        CheckText(_id='projectstatus-tabBar', text='batch'),
+
+        # Start Tests
+        ShExpect('ftc build-jobs *.*.Functional.fuego_board_check'),
+        CheckText(_id='buildQueue', text='Functional.fuego_board_check'),
     ]
 
     if not execute_tests(args.timeout):
-- 
2.16.2



More information about the Fuego mailing list