All of lore.kernel.org
 help / color / mirror / Atom feed
From: ldimaggi@sourceware.org <ldimaggi@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci/test congaDemoTests.py conga_Helpers.py
Date: 5 Dec 2006 02:12:20 -0000	[thread overview]
Message-ID: <20061205021220.24139.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	ldimaggi at sourceware.org	2006-12-05 02:12:19

Modified files:
	luci/test      : congaDemoTests.py conga_Helpers.py 

Log message:
	More refactoring - pulled login/logout routines into conga_Helpers.py to make more code re-usable.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/test/congaDemoTests.py.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/test/conga_Helpers.py.diff?cvsroot=cluster&r1=1.2&r2=1.3

--- conga/luci/test/congaDemoTests.py	2006/12/04 15:50:02	1.3
+++ conga/luci/test/congaDemoTests.py	2006/12/05 02:12:18	1.4
@@ -36,19 +36,7 @@
     def setUp(self):
         """Establish connection to selenium server, login to luci """
         self.verificationErrors = []
-        self.selenium = selenium("localhost", 4444, "*firefox", CONGA_SERVER)
-        self.selenium.start()
-
-        #  Login to the luci web app
-        self.selenium.open(CONGA_SERVER)
-
-        # Wait for "Redirecting, please wait to complete" - it seems like this should not be needed,
-        # but as of 20061130, it still is
-        time.sleep(10)
-        self.selenium.type("__ac_name", CONGA_ADMIN_USERNAME)
-        self.selenium.type("__ac_password", CONGA_ADMIN_PASSWORD)
-        self.selenium.click("submit")
-        self.selenium.wait_for_page_to_load(PAGE_DISPLAY_DELAY)
+        self.selenium = login (CONGA_ADMIN_USERNAME, CONGA_ADMIN_PASSWORD)
  
     def test_congaStorage(self):
         """Test to create and delete storage systems"""
@@ -165,10 +153,7 @@
 
     def tearDown(self):
         """Logout and stop Selenium session"""
-        sel = self.selenium
-        self.selenium.click("link=Log out")
-        self.selenium.wait_for_page_to_load(PAGE_DISPLAY_DELAY)
-        self.selenium.stop()
+        logout(self.selenium)
         self.assertEqual([], self.verificationErrors)
 
 def suite():
--- conga/luci/test/conga_Helpers.py	2006/12/04 15:48:24	1.2
+++ conga/luci/test/conga_Helpers.py	2006/12/05 02:12:18	1.3
@@ -119,5 +119,27 @@
     sel.select("deluserId", "label=" + userName)
     sel.click("Submit")
     sel.wait_for_page_to_load(PAGE_DISPLAY_DELAY)    
-    
+        
+def login(userName, password):
+    """Establish connection to selenium server, login to luci """
+    sel = selenium("localhost", 4444, "*firefox", CONGA_SERVER)
+    sel.start()
+
+    #  Login to the luci web app
+    sel.open(CONGA_SERVER)
+
+    # Wait for "Redirecting, please wait to complete" - it seems like this should not be needed,
+    # but as of 20061130, it still is
+    time.sleep(10)
+    sel.type("__ac_name", userName)
+    sel.type("__ac_password", password)
+    sel.click("submit")
+    sel.wait_for_page_to_load(PAGE_DISPLAY_DELAY)
+    return sel
+
+def logout(sel):
+    """Logout and stop Selenium session"""
+    sel.click("link=Log out")
+    sel.wait_for_page_to_load(PAGE_DISPLAY_DELAY)
+    sel.stop()
     
\ No newline at end of file



             reply	other threads:[~2006-12-05  2:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-05  2:12 ldimaggi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-04 15:48 [Cluster-devel] conga/luci/test congaDemoTests.py conga_Helpers.py ldimaggi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061205021220.24139.qmail@sourceware.org \
    --to=ldimaggi@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.