Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Sep 2, 2024
1 parent de68c1c commit b62fd00
Show file tree
Hide file tree
Showing 27 changed files with 1,198 additions and 659 deletions.
6 changes: 4 additions & 2 deletions tests/netedit/neteditTestFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2814,9 +2814,11 @@ def createDataInterval(begin="0", end="3600"):
#################################################


def contextualMenuOperation(referencePosition, position, contextualMenuOperation):
def contextualMenuOperation(referencePosition, position, contextualMenuOperation,
offsetX=0, offsetY=0):
# obtain clicked position
clickedPosition = [referencePosition[0] + position.x, referencePosition[1] + position.y]
clickedPosition = [referencePosition[0] + position.x + offsetX,
referencePosition[1] + position.y + offsetY]
# move mouse to position
pyautogui.moveTo(clickedPosition)
# wait after move
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-09-02 11:10:14 by Eclipse SUMO netedit Version v1_20_0+1821-fef78581e33
This data file 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
This file may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License 2.0 are satisfied: GNU General Public License, version 2
or later which is available at
https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
-->

<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd">
<!-- StoppingPlaces -->
<busStop id="bs_0" lane="E0_1" startPos="2.80" endPos="12.80"/>
<busStop id="bs_1" lane="-E0_1" startPos="5.00" endPos="15.00"/>
<busStop id="bs_2" lane="E1_1" startPos="2.80" endPos="12.80"/>
<busStop id="bs_3" lane="-E1_1" startPos="5.00" endPos="15.00"/>
<busStop id="bs_4" lane="E2_1" startPos="2.80" endPos="12.80"/>
<busStop id="bs_5" lane="-E2_1" startPos="5.00" endPos="15.00"/>
<busStop id="bs_7" lane="E3_0" startPos="2.80" endPos="12.80"/>
<busStop id="bs_8" lane="-E3_1" startPos="5.00" endPos="15.00"/>
</additional>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-09-02 11:10:14 by Eclipse SUMO netedit Version v1_20_0+1821-fef78581e33
This data file 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
This file may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License 2.0 are satisfied: GNU General Public License, version 2
or later which is available at
https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
-->

<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/datamode_file.xsd">
<interval id="test" begin="0.00" end="3600.00">
<edge id="E0"/>
<edge id="-E0"/>
<edge id="-E1"/>
<edge id="E1"/>
<edge id="-E3"/>
<edge id="E3"/>
<edge id="E2"/>
<edge id="-E2"/>
<edgeRelation from="-E2" to="E0"/>
<edgeRelation from="-E0" to="E3"/>
<edgeRelation from="-E3" to="E1"/>
<edgeRelation from="-E1" to="E2"/>
</interval>
</data>

Large diffs are not rendered by default.

322 changes: 322 additions & 0 deletions tests/netedit/network/junctions/move/after_recomputing/net.netedit

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TestFunctions: Netedit opened successfully
Finding reference
TestFunctions: 'reference.png' found. Position: 304 - 168
TestFunctions: Clicked over position 304 - 168
TestFunctions: Clicked over position 802 - 404
TestFunctions: Clicked over position 304 - 168
TestFunctions: Clicked over position 304 - 168
TestFunctions: Netedit closed successfully
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-09-02 11:10:14 by Eclipse SUMO netedit Version v1_20_0+1821-fef78581e33
This data file 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
This file may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License 2.0 are satisfied: GNU General Public License, version 2
or later which is available at
https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
-->

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<!-- Vehicles, persons and containers (sorted by depart) -->
<trip id="t_0" depart="0.00" from="-E0" to="E1"/>
<trip id="t_1" depart="0.00" from="-E1" to="E0"/>
<trip id="t_2" depart="0.00" from="-E2" to="E3"/>
<trip id="t_3" depart="0.00" from="-E3" to="E2"/>
<person id="p_0" depart="0.00">
<stop busStop="bs_3" duration="0.00"/>
<personTrip to="E0"/>
</person>
<person id="p_1" depart="0.00">
<stop busStop="bs_1" duration="0.00"/>
<personTrip to="E1"/>
</person>
<person id="p_2" depart="0.00">
<stop busStop="bs_5" duration="0.00"/>
<personTrip to="E3"/>
</person>
<person id="p_3" depart="0.00">
<stop busStop="bs_8" duration="0.00"/>
<personTrip to="E2"/>
</person>
</routes>
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,15 @@
# Change to move
netedit.moveMode()

# move single edge junctions
netedit.dragDrop(referencePosition, 190, 50, 45, 50)
netedit.dragDrop(referencePosition, 806, 51, 932, 116)

# move double edge junctions
netedit.dragDrop(referencePosition, 187, 297, 187, 421)

# move center
netedit.dragDrop(referencePosition, 620, 300, 932, 363)

# rebuild network
netedit.rebuildNetwork()

# Check undo
netedit.undo(referencePosition, 5)

# Change to move
netedit.moveMode()

# move single edge junctions
netedit.dragDrop(referencePosition, 190, 50, 45, 50)
netedit.dragDrop(referencePosition, 806, 51, 932, 116)
# move
netedit.moveElement(referencePosition, netedit.positions.network.junction.cross.center,
netedit.positions.elements.movementRadius)

# move double edge junctions
netedit.dragDrop(referencePosition, 187, 297, 187, 421)

# move center
netedit.dragDrop(referencePosition, 620, 300, 932, 363)
# rebuild network
netedit.rebuildNetwork()

# Check undo
netedit.undo(referencePosition, 5)
Expand Down
26 changes: 26 additions & 0 deletions tests/netedit/network/junctions/move/basic/additionals.netedit
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-09-02 11:10:14 by Eclipse SUMO netedit Version v1_20_0+1821-fef78581e33
This data file 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
This file may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License 2.0 are satisfied: GNU General Public License, version 2
or later which is available at
https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
-->

<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd">
<!-- StoppingPlaces -->
<busStop id="bs_0" lane="E0_1" startPos="2.80" endPos="12.80"/>
<busStop id="bs_1" lane="-E0_1" startPos="5.00" endPos="15.00"/>
<busStop id="bs_2" lane="E1_1" startPos="2.80" endPos="12.80"/>
<busStop id="bs_3" lane="-E1_1" startPos="5.00" endPos="15.00"/>
<busStop id="bs_4" lane="E2_1" startPos="2.80" endPos="12.80"/>
<busStop id="bs_5" lane="-E2_1" startPos="5.00" endPos="15.00"/>
<busStop id="bs_7" lane="E3_0" startPos="2.80" endPos="12.80"/>
<busStop id="bs_8" lane="-E3_1" startPos="5.00" endPos="15.00"/>
</additional>
31 changes: 31 additions & 0 deletions tests/netedit/network/junctions/move/basic/datas.netedit
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2024-09-02 11:10:14 by Eclipse SUMO netedit Version v1_20_0+1821-fef78581e33
This data file 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
This file may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the Eclipse
Public License 2.0 are satisfied: GNU General Public License, version 2
or later which is available at
https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
-->

<data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/datamode_file.xsd">
<interval id="test" begin="0.00" end="3600.00">
<edge id="E0"/>
<edge id="-E0"/>
<edge id="-E1"/>
<edge id="E1"/>
<edge id="-E3"/>
<edge id="E3"/>
<edge id="E2"/>
<edge id="-E2"/>
<edgeRelation from="-E2" to="E0"/>
<edgeRelation from="-E0" to="E3"/>
<edgeRelation from="-E3" to="E1"/>
<edgeRelation from="-E1" to="E2"/>
</interval>
</data>
Empty file.
Empty file.
Loading

0 comments on commit b62fd00

Please sign in to comment.