Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
f5e15283
Commit
f5e15283
authored
Aug 16, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make possible use phanthomjs instead firefox.
Phantomjs still draft.
parent
25888cb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+14
-19
No files found.
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
f5e15283
...
@@ -227,20 +227,20 @@ class FunctionalTestRunner:
...
@@ -227,20 +227,20 @@ class FunctionalTestRunner:
# There is no test that can take more them 24 hours
# There is no test that can take more them 24 hours
timeout = 24 * 60 * 60
timeout = 24 * 60 * 60
def __init__(self, host, port, portal, run_only='', use_phanthom=False):
def __init__(self, host, port, portal, run_only=''):
self.instance_home = os.environ['INSTANCE_HOME']
self.instance_home = os.environ['INSTANCE_HOME']
self.host = host
self.port = int(port)
# Such informations should be automatically loaded
# Such informations should be automatically loaded
self.user = 'ERP5TypeTestCase'
self.user = 'ERP5TypeTestCase'
self.password = ''
self.password = ''
self.run_only = run_only
self.run_only = run_only
self.xvfb_display = ':123'
self.xvfb_display = ':123'
self.profile_dir = os.path.join(self.instance_home, 'profile')
profile_dir = os.path.join(self.instance_home, 'profile')
self.portal_url = "http://%s:%d/%s" % (host, port, portal.getId())
self.portal = portal
self.portal = portal
if use_phanthom:
self.browser = PhantomJS(profile_dir, host, int(port))
else:
self.browser = Firefox(profile_dir, host, int(port))
def getStatus(self):
def getStatus(self):
transaction.commit()
transaction.commit()
...
@@ -250,25 +250,21 @@ class FunctionalTestRunner:
...
@@ -250,25 +250,21 @@ class FunctionalTestRunner:
return ZELENIUM_BASE_URL % (self.portal.portal_url(), self.run_only,
return ZELENIUM_BASE_URL % (self.portal.portal_url(), self.run_only,
self.portal.portal_url(), self.user, self.password)
self.portal.portal_url(), self.user, self.password)
def launchFunctionalTest(self, debug=0):
def test(self, debug=0):
pid = None
test_url = self._getTestURL(self.run_only)
browser = Firefox(self.profile_dir, self.host, self.port)
display = None
xvfb = Xvfb(self.instance_home, None)
xvfb = Xvfb(self.instance_home, None)
try:
try:
start = time.time()
start = time.time()
if not debug and self.browser.use_xvfb:
if not debug and self.browser.use_xvfb:
xvfb.display = self.xvfb_display
xvfb.display = self.xvfb_display
xvfb.run()
xvfb.run()
browser.run(test_url
, xvfb.display)
self.browser.run(self._getTestURL()
, xvfb.display)
while self.getStatus() is None:
while self.getStatus() is None:
time.sleep(10)
time.sleep(10)
if (start - time.time()) > float(self.timeout):
if (start - time.time()) > float(self.timeout):
raise TimeoutError("Test took more them %s seconds" % self.timeout)
raise TimeoutError("Test took more them %s seconds" % self.timeout)
finally:
finally:
browser.quit()
self.
browser.quit()
xvfb.quit()
xvfb.quit()
def processResult(self):
def processResult(self):
...
@@ -296,11 +292,10 @@ class FunctionalTestRunner:
...
@@ -296,11 +292,10 @@ class FunctionalTestRunner:
return detail, int(sucess_amount), int(failure_amount), error_title_list
return detail, int(sucess_amount), int(failure_amount), error_title_list
class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
run_only = ""
run_only = ""
foreground = 0
foreground = 0
use_phanthom = True
def getTitle(self):
def getTitle(self):
return "Zelenium"
return "Zelenium"
...
@@ -328,10 +323,10 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
...
@@ -328,10 +323,10 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
# first of all, abort to get rid of the mysql participation inn this
# first of all, abort to get rid of the mysql participation inn this
# transaction
# transaction
self.portal._p_jar.sync()
self.portal._p_jar.sync()
self.runner = FunctionalTestRunner(self.serverhost, self.serverport,
self.runner = FunctionalTestRunner(self.serverhost, self.serverport,
self.portal, self.run_only)
self.portal, self.run_only, self.use_phanthom)
self.runner.launchFunctionalTest(debug=self.foreground)
self.runner.test(debug=self.foreground)
detail, success, failure, error_title_list = self.runner.processResult()
detail, success, failure, error_title_list = self.runner.processResult()
self.logMessage("-" * 79)
self.logMessage("-" * 79)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment