/
test.py
57 lines (43 loc) · 1.47 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2009-2018 German Aerospace Center (DLR) and others.
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v20.html
# SPDX-License-Identifier: EPL-2.0
# @file test.py
# @author Pablo Alvarez Lopez
# @date 2016-11-25
# @version $Id$
# import common functions for netedit tests
import os
import sys
testRoot = os.path.join(os.environ.get('SUMO_HOME', '.'), 'tests')
neteditTestRoot = os.path.join(
os.environ.get('TEXTTEST_HOME', testRoot), 'netedit')
sys.path.append(neteditTestRoot)
import neteditTestFunctions as netedit # noqa
# Open netedit
neteditProcess, referencePosition = netedit.setupAndStart(neteditTestRoot, ['--gui-testing-debug-gl'])
# go to select mode
netedit.selectMode()
# select first polygon
netedit.leftClick(referencePosition, 100, 50)
# select second polygon
netedit.leftClick(referencePosition, 300, 50)
# go to inspect mode
netedit.inspectMode()
# inspect first polygon
netedit.leftClick(referencePosition, 100, 50)
# Change boolean parameter 2
netedit.modifyAttribute(4, "true")
# Check undos and redos
netedit.undo(referencePosition, 2)
netedit.redo(referencePosition, 2)
# save shapes
netedit.saveShapes()
# save network
netedit.saveNetwork()
# quit netedit
netedit.quit(neteditProcess)