From 1e74bc15d87ead58c2996f98df3d30a0f9fc496e Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Mon, 29 Nov 2021 14:03:58 +0800 Subject: [PATCH] [TS-748]fix windows input limit --- tests/pytest/fulltest.bat | 3 +- tests/pytest/tools/windows_input.py | 79 +++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 tests/pytest/tools/windows_input.py diff --git a/tests/pytest/fulltest.bat b/tests/pytest/fulltest.bat index ad3803b01f..6eac17ad2e 100644 --- a/tests/pytest/fulltest.bat +++ b/tests/pytest/fulltest.bat @@ -18,4 +18,5 @@ python .\test.py -f query\filterAllIntTypes.py python .\test.py -f query\filterFloatAndDouble.py python .\test.py -f query\filterOtherTypes.py python .\test.py -f query\querySort.py -python .\test.py -f query\queryJoin.py \ No newline at end of file +python .\test.py -f query\queryJoin.py +python .\test.py -f tools\windows_input.py \ No newline at end of file diff --git a/tests/pytest/tools/windows_input.py b/tests/pytest/tools/windows_input.py new file mode 100644 index 0000000000..aeb3ee7783 --- /dev/null +++ b/tests/pytest/tools/windows_input.py @@ -0,0 +1,79 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import os +from uiautomation import WindowControl +from util.cases import * +from util.sql import * + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + self.host = conn._host + + def win_input_test(self): + os.system("start") + time.sleep(1) + + # 获取CMD窗口 + # window = DocumentControl(searchDepth=3, Name='Text Area') + window = WindowControl(searchDepth=1, AutomationId='Console Window') + # 切换英文输入法 + # window.SendKeys('\\') + # window.SendKeys('{Enter}') + # window.SendKeys('{Shift}') + # window.SendKeys('\\') + # window.SendKeys('{Enter}') + + # 切换目录 + window.SendKeys('c:') + window.SendKeys('{Enter}') + window.SendKeys('cd \\') + window.SendKeys('{Enter}') + window.SendKeys('cd c:\\TDengine') + window.SendKeys('{Enter}') + # 启动taos.exe + window.SendKeys('taos.exe -h %s || taos.exe' % (self.host)) + window.SendKeys('{Enter}') + # 输入 + + temp = '' + for i in range(300): + temp += 'a' + sql = "'insert into db.tb values(now,'%s')" % temp + window.SendKeys(sql) + window.SendKeys('{Enter}') + window.SendKeys('{Ctrl}C') + window.SendKeys('exit') + window.SendKeys('{Enter}') + + def run(self): + tdSql.prepare() + + ret = tdSql.execute('create table tb (ts timestamp, i binary(300))') + + self.win_input_test() + + tdSql.query("select * from tb") + tdSql.checkRows(1) + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) -- GitLab