Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
amrani
erp5
Commits
ca565876
Commit
ca565876
authored
Apr 05, 2013
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement Extensions for Functional Test to be able to check whether a report has been generated.
parent
436873b2
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
2 deletions
+101
-2
bt5/erp5_ui_test_core/ExtensionTemplateItem/ERP5Zuite.py
bt5/erp5_ui_test_core/ExtensionTemplateItem/ERP5Zuite.py
+31
-0
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_isReportGenerated.xml
...ortal_skins/erp5_ui_test_core/Zuite_isReportGenerated.xml
+28
-0
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_prepareReportDirectory.xml
..._skins/erp5_ui_test_core/Zuite_prepareReportDirectory.xml
+28
-0
bt5/erp5_ui_test_core/bt/change_log
bt5/erp5_ui_test_core/bt/change_log
+3
-0
bt5/erp5_ui_test_core/bt/revision
bt5/erp5_ui_test_core/bt/revision
+1
-1
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+10
-1
No files found.
bt5/erp5_ui_test_core/ExtensionTemplateItem/ERP5Zuite.py
View file @
ca565876
...
...
@@ -40,3 +40,34 @@ def appendTestToWebPage(text, test_text):
else
:
root
.
replace
(
table_list
[
0
],
tutorial_test
)
return
lxml
.
html
.
tostring
(
root
).
replace
(
'
\
n
'
,
''
).
replace
(
"
\
'
"
,
"'"
)
from
App.config
import
getConfiguration
import
os
def
prepareReportDirectory
(
self
,
expected_filename
):
"""
Remove existing report with the given filename if any. This must be called
before a report button is clicked
"""
filename_path
=
os
.
path
.
join
(
getConfiguration
().
instancehome
,
'var'
,
expected_filename
)
if
os
.
path
.
exists
(
filename_path
):
os
.
remove
(
filename_path
)
return
'Done'
def
isReportGenerated
(
self
,
expected_filename
):
"""
Check that the report has been generated. Firefox will not prompt for PDF
files as defined in ERP5Type.tests.ERP5TypeFunctionalTestCase.Firefox in
getPrefJs() method
"""
filename_path
=
os
.
path
.
join
(
getConfiguration
().
instancehome
,
'var'
,
expected_filename
)
if
os
.
path
.
isfile
(
filename_path
):
os
.
remove
(
filename_path
)
return
'Done'
return
'Report not generated!'
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_isReportGenerated.xml
0 → 100644
View file @
ca565876
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
isReportGenerated
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
ERP5Zuite
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Zuite_isReportGenerated
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Zuite_isReportGenerated
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_prepareReportDirectory.xml
0 → 100644
View file @
ca565876
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
prepareReportDirectory
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
ERP5Zuite
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Zuite_prepareReportDirectory
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Zuite_prepareReportDirectory
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_ui_test_core/bt/change_log
View file @
ca565876
2013-04-05 arnaud.fontaine
* Implement Extensions to be able to check whether a report has been generated.
2011-10-11 Xavier
* Selenium core updated (2.6.0)
* captureEntirePageScreenshot is available to take screenshots with Selenium (Firefox only)
...
...
bt5/erp5_ui_test_core/bt/revision
View file @
ca565876
60
\ No newline at end of file
61
\ No newline at end of file
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
ca565876
...
...
@@ -187,6 +187,7 @@ class Firefox(Browser):
os.environ['
MOZ_NO_REMOTE
'] = '
0
'
def getPrefJs(self):
from App.config import getConfiguration
return """
// Don'
t
ask
if
we
want
to
switch
default
browsers
user_pref
(
"browser.shell.checkDefaultBrowser"
,
false
);
...
...
@@ -224,7 +225,15 @@ user_pref("capability.principal.codebase.p1.subjectName", "");
//
For
debugging
,
do
not
waste
space
on
screen
user_pref
(
"browser.tabs.autoHide"
,
true
);
""" % (self.host, self.port)
//
This
is
required
to
download
reports
without
requiring
user
interaction
//
(
See
ERP5UpgradeUtils
for
corresponding
Extensions
)
user_pref
(
"browser.download.folderList"
,
2
);
user_pref
(
"browser.download.manager.showWhenStarting"
,
false
);
user_pref
(
"browser.download.dir"
,
"%s"
);
user_pref
(
"browser.helperApps.neverAsk.saveToDisk"
,
"application/pdf"
);
""" % (self.host, self.port,
os.path.join(getConfiguration().instancehome, 'var'))
class PhantomJS(Browser):
def _createRunJS(self):
...
...
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