Algorithm
编写一个 SQL 查询, 满足条件: 无论 person 是否有地址信息, 都需要基于上述两表提供? person 的以下信息: FirstName, LastName, City, State
Combine Two Tables
编写一个 SQL 查询, 获取? Employee? 表中第二高的薪水 (Salary),? 如果不存在第二高的薪水, 那么查询应返回? null.
Second Highest Salary
编写一个 SQL 查询, 获取? Employee? 表中第? n? 高的薪水 (Salary), 如果不存在第? n? 高的薪水, 那么查询应返回? null.
- Nth Highest Salary
- Review
- Chaining Requests in Postman - Part 2
将 postman collection 导出为 JSON 格式文件
newman 运行 collection case(newman run )
使用 newman 生成测试报告 (newman run -r cli,html)
测试报告可二次定制
Tip
使用 logging 模块, 在做自动化测试时可以打印日志, 便于定位问题
logging 的封装:
- import logging,os
- from datetime import datetime
- class UserLog:
- ????def __init__(self):
- ????????self.logger = logging.getLogger()
- ????????self.logger.setLevel(logging.DEBUG)
- ????????# 文件路径
- ????????base_dir = os.path.dirname(os.path.abspath(__file__))
- ????????# log_file = datetime.now().strftime('%Y%m%d%H%M%S') + '.log'
- ????????log_file = datetime.now().strftime('%Y%m%d') + '.log'
- ????????log_path = os.path.join(base_dir,'logs',log_file)
- ?? ??? ?# 文件输出日志
- ????????self.file_handle = logging.FileHandler(log_path)
- ?? ??? ?# 格式化日志
- ????????formatter = logging.Formatter('%(asctime)s--%(filename)s--%(funcName)s--%(lineno)d--%(levelname)s--->%(message)s')
- ????????self.file_handle.setFormatter(formatter)
- ????????self.logger.addHandler(self.file_handle)
- ????def get_log(self):
- ????????return self.logger
- ????def remove_handler(self):
- ????????self.file_handle.close()
- ????????self.logger.removeHandler(self.file_handle)
- if __name__ == "__main__":
- ????user_log = UserLog()
- ????logger = user_log.get_log()
- ????logger.debug("This is a test")
- ????user_log.remove_handler()
其中 logging 的日志输出级别:
DEBUG: 最详细的日志信息, 典型应用场景是 问题诊断
INFO: 信息详细程度仅次于 DEBUG, 通常只记录关键节点信息, 用于确认一切都是按照我们预期的那样进行工作
WARNING: 当某些不期望的事情发生时记录的信息 (如, 磁盘可用空间较低), 但是此时应用程序还是正常运行的
ERROR: 由于一个更严重的问题导致某些功能不能正常运行时记录的信息
CRITICAL: 当发生严重错误, 导致应用程序不能继续运行时记录的信息
- Share
- How to Write a Bug Report
PS: 写缺陷报告注意的一些格式, 但是现在大都用缺陷管理平台的, 都自带格式. 新手向
来源: http://www.bubuko.com/infodetail-3332337.html