gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-wallet-webex] branch master updated: Using pyvirtual


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] branch master updated: Using pyvirtualdisplay for headless selenium tests.
Date: Thu, 16 Feb 2017 09:55:00 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository wallet-webex.

The following commit(s) were added to refs/heads/master by this push:
     new 18010a7  Using pyvirtualdisplay for headless selenium tests.
18010a7 is described below

commit 18010a739de6eb3bc2d8f2dda8231f40072fbffc
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Feb 16 09:54:08 2017 +0100

    Using pyvirtualdisplay for headless selenium tests.
---
 selenium/withdraw_buy.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/selenium/withdraw_buy.py b/selenium/withdraw_buy.py
index c5e95e6..cc1f71e 100644
--- a/selenium/withdraw_buy.py
+++ b/selenium/withdraw_buy.py
@@ -12,6 +12,7 @@ from selenium.webdriver.support import expected_conditions as 
EC
 from selenium.webdriver.support.ui import WebDriverWait, Select
 from selenium.common.exceptions import NoSuchElementException, TimeoutException
 from selenium.webdriver.common.action_chains import ActionChains
+from pyvirtualdisplay import Display
 from urllib import parse
 import argparse
 import time
@@ -24,6 +25,8 @@ import json
 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
 logger = logging.getLogger(__name__)
 taler_baseurl = os.environ.get('TALER_BASEURL', 'https://test.taler.net/')
+display = Display(visible=0, size=(1024, 768))
+display.start()
 
 def client_setup(args):
     """Return a dict containing the driver and the extension's id"""
@@ -125,7 +128,7 @@ def buy_article(client):
     client.get(parse.urljoin(taler_baseurl, "shop"))
     wait = WebDriverWait(client, 10)
     try:
-        further_teaser = wait.until(EC.element_to_be_clickable((By.XPATH, 
'//h3[a[starts-with(@href, "/essay")]][4]'))) 
+        further_teaser = wait.until(EC.element_to_be_clickable((By.XPATH, 
'//h3[a[starts-with(@href, "/essay")]][7]'))) 
         teaser = wait.until(EC.element_to_be_clickable((By.XPATH, 
'//h3/address@hidden"/essay/Foreword"]')))
         # NOTE: we need to scroll the browser a few inches deeper respect
         # to the element which is to be clicked, otherwise we hit the lang
@@ -133,8 +136,11 @@ def buy_article(client):
         # Unfortunately, just retrieving the element to click and click it
         # did NOT work.
         actions = ActionChains(client)
+        time.sleep(2)
         actions.move_to_element(further_teaser)
+        time.sleep(2)
         actions.move_to_element(teaser)
+        time.sleep(2)
         actions.click(teaser)
         actions.perform()
     except (NoSuchElementException, TimeoutException):

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]