seldomqa / seldom-platform Goto Github PK
View Code? Open in Web Editor NEWBased on the seldom test platform
Home Page: http://seldom.testpub.cn
License: Apache License 2.0
Based on the seldom test platform
Home Page: http://seldom.testpub.cn
License: Apache License 2.0
为了支持分布式部署,需要前端增加selenium grid 配置参数,后端也需要做相应的支持。
跑完之后发现并没有发送邮件
公司项目组一直在用seldom并推广,最近打算转平台,请问这个平台还在维护中吗?
本地通过seldom -p 命令起的是无头模式,但是用平台运行就又打开窗口了,这里是如何设置的呢?
场景1:当同步用例后,去任务管理运行,会出现卡住的现象
场景2:当任务管理页运行后,去操作同步用例,会出现报错的问题
Traceback (most recent call last):
File "C:\Users\huawei\AppData\Local\Programs\Python\Python311\Lib\site-packages\ninja\operation.py", line 107, in run
result = self.view_func(request, **values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\PythonAbout\test_platform\backend\app_project\api.py", line 195, in sync_project_case
main_extend = TestMainExtend(path=test_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huawei\AppData\Local\Programs\Python\Python311\Lib\site-packages\seldom\running\runner.py", line 275, in __init__
super().__init__(path=path, browser=browser, base_url=base_url, debug=debug, timeout=timeout,
File "C:\Users\huawei\AppData\Local\Programs\Python\Python311\Lib\site-packages\seldom\running\runner.py", line 164, in __init__
self.TestSuits = seldomTestLoader.rediscover(self.path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huawei\AppData\Local\Programs\Python\Python311\Lib\site-packages\seldom\running\loader_extend.py", line 165, in rediscover
tests = list(self._find_tests(start_dir, pattern))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huawei\AppData\Local\Programs\Python\Python311\Lib\unittest\loader.py", line 377, in _find_tests
tests, should_recurse = self._find_test_path(full_path, pattern)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huawei\AppData\Local\Programs\Python\Python311\Lib\unittest\loader.py", line 429, in _find_test_path
raise ImportError(
ImportError: 'test_rdsAPIAverageExecutionTimeOfQueryTasks' module incorrectly imported from 'D:\\PythonAbout\\test_platform\\backend\\github\\inter-fave-auto-test_temp\\test_dir'. Expected 'D:\\PythonAbout\\test_platform\\backend\\github\\inter-fave-auto-test\\test_dir'. Is this module globally installed?
Internal Server Error: /api/project/1/sync_case
文件地址:running.runner.py
个人认为好处:
1、可以针对结果进行分析统计
2、针对返回结果进行二次策略性调用
3、主要添加返回结果:result=runner.run(suits)
改过的一系列方法:含关联文件
def run(self, suits) -> None:
"""
run test case
"""
if self.debug is False:
for filename in os.listdir(os.getcwd()):
if filename == "reports":
break
else:
os.mkdir(os.path.join(os.getcwd(), "reports"))
if (self.report is None) and (BrowserConfig.REPORT_PATH is not None):
report_path = BrowserConfig.REPORT_PATH
else:
report_path = BrowserConfig.REPORT_PATH = os.path.join(os.getcwd(), "reports", self.report)
with open(report_path, 'wb') as fp:
if report_path.split(".")[-1] == "xml":
runner = XMLTestRunner(output=fp, logger=log_cfg)
result=runner.run(suits)
else:
runner = HTMLTestRunner(stream=fp, title=self.title, tester=self.tester,
description=self.description,
language=self.language, blacklist=self.blacklist, whitelist=self.whitelist,
logger=log_cfg)
result=runner.run(suits, rerun=self.rerun, save_last_run=self.save_last_run)
log.success(f"generated html file: file:///{report_path}")
log.success(f"generated log file: file:///{BrowserConfig.LOG_PATH}")
if self.open is True:
webbrowser.open_new(f"file:///{report_path}")
else:
runner = DebugTestRunner(
blacklist=self.blacklist,
whitelist=self.whitelist,
verbosity=2)
result=runner.run(suits)
log.success(f"A1 run the test in debug mode without generating HTML report!\n{result}")
return result
选择左侧树文件,穿梭框的数据实际效果是append,而不是reset
# 字典树
import json
class TrieTree:
def __init__(self):
self.root = {}
def insert(self, item):
current_node = self.root
for _item in item:
node = current_node.get(_item)
if node is None:
new_node = {}
current_node[_item] = new_node
current_node = new_node
else:
current_node = node
current_node["is_file"] = True
trie_tree = TrieTree()
trie_tree.insert(item=["test_dmo.py"])
trie_tree.insert(item=["base_case", "test_001_from.py"])
trie_tree.insert(item=["base_case", "test_002_link.py"])
trie_tree.insert(item=["base_case", "test_003_iframe.py"])
trie_tree.insert(item=["more_case", "test_004_window.py"])
trie_tree.insert(item=["more_case", "test_005_ddt.py"])
trie_tree.insert(item=["more_case", "test_006_file_ddt.py"])
print(json.dumps(trie_tree.root, indent=2, ensure_ascii=False))
运行结果:
{
"test_dmo.py": {
"is_file": true
},
"base_case": {
"test_001_from.py": {
"is_file": true
},
"test_002_link.py": {
"is_file": true
},
"test_003_iframe.py": {
"is_file": true
}
},
"more_case": {
"test_004_window.py": {
"is_file": true
},
"test_005_ddt.py": {
"is_file": true
},
"test_006_file_ddt.py": {
"is_file": true
}
}
}
应该是unittest的discover传None导致,但我尝试了几种传参,没找到好的解决方法。
get_queryset() got an unexpected keyword argument 'task_id'
Traceback (most recent call last):
File "E:\Software\Python37\lib\site-packages\ninja\operation.py", line 104, in run
result = self.view_func(request, **values)
File "E:\Software\Python37\lib\site-packages\ninja\pagination.py", line 140, in view_with_pagination
items = func(*args, **kwargs)
File "F:\seldom-platform\backend\app_task\api.py", line 188, in get_report_list
return TaskReport.objects.get_queryset(task_id=task_id).order_by("-create_time")[:1000]
TypeError: get_queryset() got an unexpected keyword argument 'task_id'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.