Path: blob/main/tests/netedit/network/trafficlights/edit_click/test.py
169713 views
#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2009-2025 German Aerospace Center (DLR) and others.3# This program and the accompanying materials are made available under the4# terms of the Eclipse Public License 2.0 which is available at5# https://www.eclipse.org/legal/epl-2.0/6# This Source Code may also be made available under the following Secondary7# Licenses when the conditions for such availability set forth in the Eclipse8# Public License 2.0 are satisfied: GNU General Public License, version 29# or later which is available at10# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1213# @file test.py14# @author Pablo Alvarez Lopez15# @date 2016-11-251617# import common functions for netedit tests18import os19import sys20import pyautogui21import time2223sys.path.append(os.path.join(os.environ.get("SUMO_HOME", "."), "tools"))24import neteditTestFunctions as netedit # noqa2526# Open netedit27neteditProcess, referencePosition = netedit.setupAndStart()2829# go to TLS mode30netedit.changeMode("TLS")3132# select junction33netedit.leftClick(referencePosition, netedit.positions.network.junction.cross.center)3435# create TLS36netedit.createTLS()3738# click relative to offset39netedit.rightClick(referencePosition, netedit.positions.network.TLS.edit)4041# place cursor over first operation42for _ in range(7):43# wait before every down44time.sleep(0.3)45# type down keys46pyautogui.hotkey("down")4748# type right key for the second menu49netedit.typeKey("space")5051# focus on frame52netedit.focusOnFrame()5354# place cursor over first operation55for _ in range(3):56# wait before every down57time.sleep(0.3)58# type down keys59netedit.typeKey("tab")6061# type right key for the second menu62netedit.typeKey("space")6364# create TLS65netedit.changeMode("inspect")6667# Check undo68netedit.undo(referencePosition, 1)6970# Check redo71netedit.redo(referencePosition, 1)7273# save Netedit config74netedit.saveExistentFile("neteditConfig")7576# quit netedit77netedit.quit(neteditProcess)787980