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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
b9dcb855
Commit
b9dcb855
authored
Sep 19, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql_browser_ui_test: introduce minimal test for erp5_sql_browser
parent
1aff7695
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
411 additions
and
3 deletions
+411
-3
bt5/erp5_sql_browser/SkinTemplateItem/portal_skins/erp5_sql_browser/ZMySQLDAConnection_viewQueryBrowser.html
...erp5_sql_browser/ZMySQLDAConnection_viewQueryBrowser.html
+5
-3
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite.xml
..._test/PathTemplateItem/portal_tests/sql_browser_zuite.xml
+26
-0
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_completion.xml
...teItem/portal_tests/sql_browser_zuite/test_completion.xml
+58
-0
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_completion.zpt
...teItem/portal_tests/sql_browser_zuite/test_completion.zpt
+57
-0
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_query.xml
...emplateItem/portal_tests/sql_browser_zuite/test_query.xml
+58
-0
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_query.zpt
...emplateItem/portal_tests/sql_browser_zuite/test_query.zpt
+54
-0
bt5/erp5_sql_browser_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalSQLBrowser.py
...m/portal_components/test.erp5.testFunctionalSQLBrowser.py
+34
-0
bt5/erp5_sql_browser_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalSQLBrowser.xml
.../portal_components/test.erp5.testFunctionalSQLBrowser.xml
+112
-0
bt5/erp5_sql_browser_ui_test/bt/dependency_list
bt5/erp5_sql_browser_ui_test/bt/dependency_list
+2
-0
bt5/erp5_sql_browser_ui_test/bt/template_format_version
bt5/erp5_sql_browser_ui_test/bt/template_format_version
+1
-0
bt5/erp5_sql_browser_ui_test/bt/template_path_list
bt5/erp5_sql_browser_ui_test/bt/template_path_list
+2
-0
bt5/erp5_sql_browser_ui_test/bt/template_test_id_list
bt5/erp5_sql_browser_ui_test/bt/template_test_id_list
+1
-0
bt5/erp5_sql_browser_ui_test/bt/title
bt5/erp5_sql_browser_ui_test/bt/title
+1
-0
No files found.
bt5/erp5_sql_browser/SkinTemplateItem/portal_skins/erp5_sql_browser/ZMySQLDAConnection_viewQueryBrowser.html
View file @
b9dcb855
...
...
@@ -33,14 +33,15 @@
body
{
font-family
:
Verdana
;}
.c3-line
{
stroke-width
:
3px
;}
.c3
circle
{
stroke
:
white
;}
.c3
text
{
font-size
:
12px
;}
.c3
text
{
font-size
:
12px
;}
.c3
text
{
font-size
:
12px
;}
.c3
text
{
font-size
:
12px
;}
.tick
line
{
stroke
:
white
;}
</style>
</head>
<body>
<script
type=
"text/javascript"
>
var
monaco_editor
;
$
(
function
()
{
var
editor
,
ht
=
new
Handsontable
(
document
.
getElementById
(
'
table_container
'
),
{
data
:
[[
0
]],
rowHeaders
:
true
,
colHeaders
:
true
}),
...
...
@@ -98,7 +99,7 @@
$
(
function
()
{
let
editor_backup
=
document
.
querySelector
(
"
textarea[name='editor_backup']
"
);
editor
=
monaco
.
editor
.
create
(
editor
=
monaco
_editor
=
monaco
.
editor
.
create
(
document
.
querySelector
(
'
#query
'
),
{
automaticLayout
:
true
,
...
...
@@ -135,6 +136,7 @@
$
.
getJSON
(
"
ZMySQLDAConnection_getSchemaAsJSON
"
).
then
(
function
(
schema
)
{
monaco
.
languages
.
registerCompletionItemProvider
(
'
sql
'
,
new
SQLCompletionProvider
(
schema
));
document
.
querySelector
(
'
#query
'
).
classList
.
add
(
'
initialized
'
);
});
$
(
'
button[name="Query"]
'
).
click
(
redraw
);
...
...
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite.xml
0 → 100644
View file @
b9dcb855
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Zuite"
module=
"Products.Zelenium.zuite"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
sql_browser_zuite
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_completion.xml
0 → 100644
View file @
b9dcb855
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test_completion
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_completion.zpt
0 → 100644
View file @
b9dcb855
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title
tal:content=
"template/title_and_id"
></title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr>
<td
rowspan=
"1"
colspan=
"3"
tal:content=
"template/title_and_id"
></td>
</tr>
</thead>
<tbody>
<tr>
<td>
open
</td>
<td
tal:content=
"string: ${here/portal_url}/erp5_sql_connection/ZMySQLDAConnection_viewQueryBrowser"
></td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
css=div.monaco-editor.vs
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
css=#query.initialized
</td>
<td></td>
</tr>
<tr>
<td>
assertEval
</td>
<td>
selenium.browserbot.getCurrentWindow().monaco_editor.trigger('', 'type', {'text': 'select cat'})
</td>
<td>
null
</td>
</tr>
<tr>
<td>
assertEval
</td>
<td>
selenium.browserbot.getCurrentWindow().monaco_editor.trigger('', 'editor.action.triggerSuggest')
</td>
<td>
null
</td>
</tr>
<!-- suggestion drop down -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@aria-label="catalog"]
</td>
<td></td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_query.xml
0 → 100644
View file @
b9dcb855
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test_query
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_sql_browser_ui_test/PathTemplateItem/portal_tests/sql_browser_zuite/test_query.zpt
0 → 100644
View file @
b9dcb855
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title
tal:content=
"template/title_and_id"
></title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr>
<td
rowspan=
"1"
colspan=
"3"
tal:content=
"template/title_and_id"
></td>
</tr>
</thead>
<tbody>
<tr>
<td>
open
</td>
<td
tal:content=
"string: ${here/portal_url}/erp5_sql_connection/ZMySQLDAConnection_viewQueryBrowser"
></td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
css=div.monaco-editor.vs
</td>
<td></td>
</tr>
<tr>
<td>
assertEval
</td>
<td>
selenium.browserbot.getCurrentWindow().monaco_editor.trigger('', 'type', {'text': 'select 1+1'})
</td>
<td>
null
</td>
</tr>
<tr>
<td>
click
</td>
<td>
//button[@name="Query"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForText
</td>
<td>
xpath=(//div[contains(@class, "handsontable")]//th//span[@class="colHeader"])[2]
</td>
<td>
1+1
</td>
</tr>
<tr>
<td>
assertText
</td>
<td>
//div[contains(@class, "handsontable")]//tbody/tr/td
</td>
<td>
2
</td>
</tr>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
bt5/erp5_sql_browser_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalSQLBrowser.py
0 → 100644
View file @
b9dcb855
##############################################################################
#
# Copyright (c) 2022- Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from
Products.ERP5Type.tests.ERP5TypeFunctionalTestCase
import
ERP5TypeFunctionalTestCase
class
TestSQLBrowser
(
ERP5TypeFunctionalTestCase
):
run_only
=
"sql_browser_zuite"
del
ERP5TypeFunctionalTestCase
bt5/erp5_sql_browser_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalSQLBrowser.xml
0 → 100644
View file @
b9dcb855
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testFunctionalSQLBrowser
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testFunctionalSQLBrowser
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_sql_browser_ui_test/bt/dependency_list
0 → 100644
View file @
b9dcb855
erp5_sql_browser
erp5_ui_test_core
\ No newline at end of file
bt5/erp5_sql_browser_ui_test/bt/template_format_version
0 → 100644
View file @
b9dcb855
1
\ No newline at end of file
bt5/erp5_sql_browser_ui_test/bt/template_path_list
0 → 100644
View file @
b9dcb855
portal_tests/sql_browser_zuite
portal_tests/sql_browser_zuite/**
\ No newline at end of file
bt5/erp5_sql_browser_ui_test/bt/template_test_id_list
0 → 100644
View file @
b9dcb855
test.erp5.testFunctionalSQLBrowser
\ No newline at end of file
bt5/erp5_sql_browser_ui_test/bt/title
0 → 100644
View file @
b9dcb855
erp5_sql_browser_ui_test
\ No newline at end of file
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