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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
2a0b92de
Commit
2a0b92de
authored
Apr 25, 2023
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_drone_capture_flag_test: app functional test and drone flight test
parent
58c95f1c
Changes
21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1435 additions
and
0 deletions
+1435
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite.xml
...ateItem/portal_tests/drone_capture_flag_ui_site_zuite.xml
+26
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlag.xml
...drone_capture_flag_ui_site_zuite/testDroneCaptureFlag.xml
+62
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlag.zpt
...drone_capture_flag_ui_site_zuite/testDroneCaptureFlag.zpt
+88
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.xml
...capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.xml
+62
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.zpt
...capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.zpt
+89
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_html.html
...eItem/web_page_module/test_capture_drone_flight_html.html
+42
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_html.xml
...teItem/web_page_module/test_capture_drone_flight_html.xml
+344
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.js
...plateItem/web_page_module/test_capture_drone_flight_js.js
+215
-0
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.xml
...lateItem/web_page_module/test_capture_drone_flight_js.xml
+346
-0
bt5/erp5_officejs_drone_capture_flag_test/TestTemplateItem/portal_components/test.erp5.testFunctionalDroneCaptureFlag.py
...al_components/test.erp5.testFunctionalDroneCaptureFlag.py
+46
-0
bt5/erp5_officejs_drone_capture_flag_test/TestTemplateItem/portal_components/test.erp5.testFunctionalDroneCaptureFlag.xml
...l_components/test.erp5.testFunctionalDroneCaptureFlag.xml
+102
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/dependency_list
bt5/erp5_officejs_drone_capture_flag_test/bt/dependency_list
+2
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/description
bt5/erp5_officejs_drone_capture_flag_test/bt/description
+1
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/template_format_version
...ficejs_drone_capture_flag_test/bt/template_format_version
+1
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/template_keep_last_workflow_history_only_path_list
...est/bt/template_keep_last_workflow_history_only_path_list
+1
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/template_keep_path_list
...ficejs_drone_capture_flag_test/bt/template_keep_path_list
+1
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/template_keep_workflow_path_list
...one_capture_flag_test/bt/template_keep_workflow_path_list
+1
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/template_path_list
...p5_officejs_drone_capture_flag_test/bt/template_path_list
+3
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/template_test_id_list
...officejs_drone_capture_flag_test/bt/template_test_id_list
+1
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/test_dependency_list
..._officejs_drone_capture_flag_test/bt/test_dependency_list
+1
-0
bt5/erp5_officejs_drone_capture_flag_test/bt/title
bt5/erp5_officejs_drone_capture_flag_test/bt/title
+1
-0
No files found.
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite.xml
0 → 100644
View file @
2a0b92de
<?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>
drone_capture_flag_ui_site_zuite
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlag.xml
0 → 100644
View file @
2a0b92de
<?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=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
testDroneCaptureFlag
</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_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlag.zpt
0 → 100644
View file @
2a0b92de
<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>
Test Drone Capture Flag OJS app (expected failure)
</title>
<!-- This test is expected to fail as the drone simulator runs on a web worker canvas, which relies on a very new feature: offscreen canvas
---- This feature is not supported yet by the latest Firefox ESR used in the test nodes -->
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Drone Capture Flag OJS app (expected failure)
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<!-- Go to site -->
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/officejs_drone_capture_flag/
</td>
<td></td>
</tr>
<!-- error on /Zuite_waitForActivities
<tal:block tal:define="web_site_name python: 'officejs_drone_capture_flag'">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForOfficejsUi/macros/install_offline_and_redirect" />
</tal:block>
-->
<!-- Check form -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_page_drone_capture_flag_script_page.html')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//label[text()='Simulation Speed']
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'codemirror.gadget.html')]
</td>
<td></td>
<tr>
<!-- Check panel -->
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_panel_drone_capture_flag.html')]//a[contains(@class, 'ui-icon-puzzle-piece') and text()='Run Game']
</td>
<td></td>
<tr>
<!-- Run game -->
<tr>
<td>
pause
</td>
<td>
3000
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_page_drone_capture_flag_script_page.html')]//input[@type="submit" and @name="action_run"]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//span[@id="loading"]
</td>
<td></td>
<tr>
<!-- Check simulator gadget and babylon lib -->
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'babylonjs.gadget.html')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'babylonjs.gadget.html')]//canvas[contains(@data-engine, 'Babylon.js')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//a[contains(text(), 'Download Simulation LOG')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//textarea[@id="log_result_0"]
</td>
<td></td>
<tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.xml
0 → 100644
View file @
2a0b92de
<?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=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
testDroneCaptureFlagFlight
</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_officejs_drone_capture_flag_test/PathTemplateItem/portal_tests/drone_capture_flag_ui_site_zuite/testDroneCaptureFlagFlight.zpt
0 → 100644
View file @
2a0b92de
<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>
Test Drone Capture Flag OJS app (expected failure)
</title>
<!-- This test is expected to fail as the drone simulator runs on a web worker canvas, which relies on a very new feature: offscreen canvas
---- This feature is not supported yet by the latest Firefox ESR used in the test nodes -->
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Drone Capture Flag OJS app (expected failure)
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<!-- Go to site -->
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/officejs_drone_capture_flag/app/#/?page=drone_capture_flag_test_page
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'gadget_erp5_page_drone_capture_flag_test_page.html')]//input[@type="submit" and @name="action_run"]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//span[@id="loading"]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'babylonjs.gadget.html')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(@data-gadget-url, 'babylonjs.gadget.html')]//canvas[contains(@data-engine, 'Babylon.js')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(text(), 'CONSOLE LOG ENTRIES:')]
</td>
<td></td>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[contains(text(), 'Simulation finished')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Initial speed: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Yaw angle: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Timestamp: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Distance: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Latitude: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Longitude: OK')]
</td>
<td></td>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[contains(text(), 'Altitude: OK')]
</td>
<td></td>
<tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_html.html
0 → 100644
View file @
2a0b92de
<!DOCTYPE html>
<html>
<!--
data-i18n=Others
data-i18n=Tools
-->
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width"
/>
<title>
Drone Simulator Test Page
</title>
<link
rel=
"http://www.renderjs.org/rel/interface"
href=
"interface_page.html"
>
<!-- renderjs -->
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"jiodev.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_global.js"
type=
"text/javascript"
></script>
<script
src=
"domsugar.js"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
src=
"./libraries/seedrandom.min.js"
></script>
<script
src=
"gadget_erp5_page_drone_capture_flag_test_page.js"
type=
"text/javascript"
></script>
</head>
<body>
<form>
<div
data-gadget-url=
"gadget_erp5_form.html"
data-gadget-scope=
"form_view"
data-gadget-sandbox=
"public"
>
</div>
<input
name=
"action_run"
class=
"dialogconfirm"
type=
"submit"
value=
"Run"
style=
"margin-bottom: 20pt;margin-top: 20pt;"
>
<a
data-i18n=
"Storages"
></a>
<!-- for zelenium test common macro -->
<div
class=
"simulator_div"
></div>
<div
data-gadget-url=
"gadget_erp5_form.html"
data-gadget-scope=
"form_view_babylonjs"
data-gadget-sandbox=
"public"
>
</div>
<div
class=
"test_log"
></div>
</form>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_html.xml
0 → 100644
View file @
2a0b92de
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.js
0 → 100644
View file @
2a0b92de
/*jslint indent: 2, maxlen: 100*/
/*global window, rJS, domsugar, document, URLSearchParams, Blob*/
(
function
(
window
,
rJS
,
domsugar
,
document
,
URLSearchParams
,
Blob
)
{
"
use strict
"
;
var
SIMULATION_SPEED
=
10
,
SIMULATION_TIME
=
270
,
MAP_SIZE
=
600
,
map_height
=
700
,
start_AMSL
=
595
,
DEFAULT_SPEED
=
16
,
MAX_ACCELERATION
=
6
,
MAX_DECELERATION
=
1
,
MIN_SPEED
=
12
,
MAX_SPEED
=
26
,
MAX_ROLL
=
35
,
MIN_PITCH
=
-
20
,
MAX_PITCH
=
25
,
MAX_CLIMB_RATE
=
8
,
MAX_SINK_RATE
=
3
,
NUMBER_OF_DRONES
=
1
,
FLAG_WEIGHT
=
5
,
SEED
=
'
flag
'
,
// Non-inputs parameters
DEFAULT_SCRIPT_CONTENT
=
'
function assert(a, b, msg) {
\n
'
+
'
if (a === b)
\n
'
+
'
console.log(msg + ": OK");
\n
'
+
'
else
\n
'
+
'
console.log(msg + ": FAIL");
\n
'
+
'
}
\n
'
+
'
function distance(lat1, lon1, lat2, lon2) {
\n
'
+
'
var R = 6371e3, // meters
\n
'
+
'
la1 = lat1 * Math.PI / 180, // lat, lon in radians
\n
'
+
'
la2 = lat2 * Math.PI / 180,
\n
'
+
'
lo1 = lon1 * Math.PI / 180,
\n
'
+
'
lo2 = lon2 * Math.PI / 180,
\n
'
+
'
haversine_phi = Math.pow(Math.sin((la2 - la1) / 2), 2),
\n
'
+
'
sin_lon = Math.sin((lo2 - lo1) / 2),
\n
'
+
'
h = haversine_phi + Math.cos(la1) * Math.cos(la2) * sin_lon * sin_lon;
\n
'
+
'
return 2 * R * Math.asin(Math.sqrt(h));
\n
'
+
'
}
\n
'
+
'
function compare(coord1, coord2) {
\n
'
+
'
assert(coord1.x, coord2.x, "Latitude")
\n
'
+
'
assert(coord1.y, coord2.y, "Longitude")
\n
'
+
'
assert(coord1.z, coord2.z, "Altitude")
\n
'
+
'
}
\n
'
+
'
me.onStart = function () {
\n
'
+
'
assert(me.getAirSpeed(), 16, "Initial speed");
\n
'
+
'
assert(me.getYaw(), 0, "Yaw angle")
\n
'
+
'
me.initialPosition = me.getCurrentPosition();
\n
'
+
'
me.setTargetCoordinates(
\n
'
+
'
me.initialPosition.x + 0.01,
\n
'
+
'
me.initialPosition.y,
\n
'
+
'
me.initialPosition.z
\n
'
+
'
);
\n
'
+
'
};
\n
'
+
'
me.onUpdate = function (timestamp) {
\n
'
+
'
var realDistance = distance(
\n
'
+
'
me.initialPosition.x,
\n
'
+
'
me.initialPosition.y,
\n
'
+
'
me.getCurrentPosition().x,
\n
'
+
'
me.getCurrentPosition().y
\n
'
+
'
).toFixed(8),
\n
'
+
'
expectedDistance = (me.getAirSpeed() * timestamp / 1000).toFixed(8);
\n
'
+
'
assert(timestamp, 1000 / 60, "Timestamp");
\n
'
+
'
assert(realDistance, expectedDistance, "Distance");
\n
'
+
'
compare(me.getCurrentPosition(), {
\n
'
+
'
x: me.initialPosition.x + 2.3992831666911723e-06,
\n
'
+
'
y: me.initialPosition.y,
\n
'
+
'
z: me.initialPosition.z
\n
'
+
'
});
\n
'
+
'
me.exit(me.triggerParachute());
\n
'
+
'
};
'
,
DRAW
=
true
,
LOG
=
true
,
LOG_TIME
=
1662.7915426540285
,
DRONE_LIST
=
[],
LOGIC_FILE_LIST
=
[
'
gadget_erp5_page_drone_capture_flag_logic.js
'
,
'
gadget_erp5_page_drone_capture_flag_fixedwingdrone.js
'
,
'
gadget_erp5_page_drone_capture_flag_enemydrone.js
'
];
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
"
notifySubmitted
"
)
.
declareMethod
(
'
render
'
,
function
render
()
{
var
gadget
=
this
;
return
gadget
.
runGame
();
})
.
declareJob
(
'
runGame
'
,
function
runGame
(
options
)
{
var
gadget
=
this
,
i
,
fragment
=
gadget
.
element
.
querySelector
(
'
.simulator_div
'
),
game_parameters_json
,
map_json
;
DRONE_LIST
=
[];
fragment
=
domsugar
(
gadget
.
element
.
querySelector
(
'
.simulator_div
'
),
[
domsugar
(
'
div
'
)]).
firstElementChild
;
for
(
i
=
0
;
i
<
NUMBER_OF_DRONES
;
i
+=
1
)
{
DRONE_LIST
[
i
]
=
{
"
id
"
:
i
,
"
type
"
:
"
FixedWingDroneAPI
"
,
"
script_content
"
:
DEFAULT_SCRIPT_CONTENT
};
}
map_json
=
{
"
map_size
"
:
parseFloat
(
MAP_SIZE
),
"
height
"
:
parseInt
(
map_height
,
10
),
"
start_AMSL
"
:
parseFloat
(
start_AMSL
),
"
flag_list
"
:
[{
"
position
"
:
{
"
x
"
:
-
27
,
"
y
"
:
72
,
"
z
"
:
10
}
}],
"
obstacle_list
"
:
[],
"
drones
"
:
{
"
user
"
:
DRONE_LIST
,
"
enemy
"
:
[]
}
};
game_parameters_json
=
{
"
debug_test_mode
"
:
true
,
"
drone
"
:
{
"
maxAcceleration
"
:
parseInt
(
MAX_ACCELERATION
,
10
),
"
maxDeceleration
"
:
parseInt
(
MAX_DECELERATION
,
10
),
"
minSpeed
"
:
parseInt
(
MIN_SPEED
,
10
),
"
speed
"
:
parseFloat
(
DEFAULT_SPEED
),
"
maxSpeed
"
:
parseInt
(
MAX_SPEED
,
10
),
"
maxRoll
"
:
parseFloat
(
MAX_ROLL
),
"
minPitchAngle
"
:
parseFloat
(
MIN_PITCH
),
"
maxPitchAngle
"
:
parseFloat
(
MAX_PITCH
),
"
maxSinkRate
"
:
parseFloat
(
MAX_SINK_RATE
),
"
maxClimbRate
"
:
parseFloat
(
MAX_CLIMB_RATE
)
},
"
gameTime
"
:
parseInt
(
SIMULATION_TIME
,
10
),
"
simulation_speed
"
:
parseInt
(
SIMULATION_SPEED
,
10
),
"
latency
"
:
{
"
information
"
:
0
,
"
communication
"
:
0
},
"
map
"
:
map_json
,
"
draw_flight_path
"
:
DRAW
,
"
temp_flight_path
"
:
true
,
"
log_drone_flight
"
:
LOG
,
"
log_interval_time
"
:
LOG_TIME
};
return
gadget
.
declareGadget
(
"
babylonjs.gadget.html
"
,
{
element
:
fragment
,
scope
:
'
simulator
'
})
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
form_view_babylonjs
'
);
})
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
my_babylonjs
"
:
{
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
0
,
"
editable
"
:
1
,
"
key
"
:
"
babylonjs
"
,
"
hidden
"
:
0
,
"
type
"
:
"
GadgetField
"
,
"
url
"
:
"
babylonjs.gadget.html
"
,
"
sandbox
"
:
"
public
"
,
"
renderjs_extra
"
:
'
{"autorun": false,
'
+
'
"logic_file_list":
'
+
JSON
.
stringify
(
LOGIC_FILE_LIST
)
+
'
,
'
+
'
"game_parameters":
'
+
JSON
.
stringify
(
game_parameters_json
)
+
'
}
'
}
}},
"
_links
"
:
{
"
type
"
:
{
name
:
""
}
}
},
form_definition
:
{
group_list
:
[[
"
bottom
"
,
[[
"
my_babylonjs
"
]]
]]
}
});
})
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
form_view_babylonjs
'
);
})
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
getContent
();
})
.
push
(
function
(
result
)
{
var
div
=
domsugar
(
'
div
'
,
{
text
:
"
CONSOLE LOG ENTRIES:
"
});
document
.
querySelector
(
'
.container
'
).
parentNode
.
appendChild
(
div
);
function
createLogNode
(
message
)
{
var
node
=
document
.
createElement
(
"
div
"
);
var
textNode
=
document
.
createTextNode
(
message
);
node
.
appendChild
(
textNode
);
return
node
;
}
var
lines
=
result
.
console_log
.
split
(
'
\n
'
);
for
(
var
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
var
node
=
createLogNode
(
lines
[
i
]);
document
.
querySelector
(
'
.test_log
'
).
appendChild
(
node
);
}
},
function
(
error
)
{
return
gadget
.
notifySubmitted
({
message
:
"
Error:
"
+
error
.
message
,
status
:
'
error
'
});
});
});
}(
window
,
rJS
,
domsugar
,
document
,
URLSearchParams
,
Blob
));
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/PathTemplateItem/web_page_module/test_capture_drone_flight_js.xml
0 → 100644
View file @
2a0b92de
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs_drone_capture_flag_test/TestTemplateItem/portal_components/test.erp5.testFunctionalDroneCaptureFlag.py
0 → 100644
View file @
2a0b92de
##############################################################################
#
# Copyright (c) 2011 Nexedi SARL and Contributors. All Rights Reserved.
# Kazuhiko <kazuhiko@nexedi.com>
# Rafael Monnerat <rafael@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability 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
# garantees 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
unittest
from
Products.ERP5Type.tests.ERP5TypeFunctionalTestCase
import
ERP5TypeFunctionalTestCase
class
TestDroneCaptureFlag
(
ERP5TypeFunctionalTestCase
):
foreground
=
0
run_only
=
"drone_capture_flag_ui_site_zuite"
def
getBusinessTemplateList
(
self
):
return
(
'erp5_ui_test_core'
,
'erp5_officejs_drone_capture_flag'
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestDroneCaptureFlag
))
return
suite
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/TestTemplateItem/portal_components/test.erp5.testFunctionalDroneCaptureFlag.xml
0 → 100644
View file @
2a0b92de
<?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>
testFunctionalDroneCaptureFlag
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testFunctionalDroneCaptureFlag
</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_officejs_drone_capture_flag_test/bt/dependency_list
0 → 100644
View file @
2a0b92de
erp5_officejs_ui_test
erp5_officejs_drone_capture_flag
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/description
0 → 100644
View file @
2a0b92de
Zelenium tests for erp5_officejs_drone_capture_flag
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/template_format_version
0 → 100644
View file @
2a0b92de
1
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/template_keep_last_workflow_history_only_path_list
0 → 100644
View file @
2a0b92de
web_page_module/test_drone_*
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/template_keep_path_list
0 → 100644
View file @
2a0b92de
web_page_module/test_drone_*
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/template_keep_workflow_path_list
0 → 100644
View file @
2a0b92de
web_page_module/test_drone_*
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/template_path_list
0 → 100644
View file @
2a0b92de
portal_tests/drone_capture_flag_ui_site_zuite
portal_tests/drone_capture_flag_ui_site_zuite/**
web_page_module/test_drone_*
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/template_test_id_list
0 → 100644
View file @
2a0b92de
test.erp5.testFunctionalDroneCaptureFlag
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/test_dependency_list
0 → 100644
View file @
2a0b92de
erp5_full_text_mroonga_catalog
\ No newline at end of file
bt5/erp5_officejs_drone_capture_flag_test/bt/title
0 → 100644
View file @
2a0b92de
erp5_officejs_drone_capture_flag_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