自动化 - 如何组织测试用例、测试对象和测试套件?
automation - How to organize test cases, test objects and test suites?
我是自动化测试新手。我正在使用 Katalon 测试端到端功能,该功能允许用户上传他们的文件并获得分析报告。这是一个快速流程:
身份验证->点击上传文件->点击添加文件->点击下一步->点击提交
是否有编写和安排测试用例和测试套件的指南?现在我正在编写如下测试用例:
- 测试用例 1:测试 身份验证
- 测试用例 2:调用测试用例 1 -> 测试上传文件
- 测试用例 3:调用测试用例 2 -> 测试添加文件
- 测试用例4:调用测试用例3 -> 测试下一步
- 测试用例5:调用测试用例4 -> 测试提交
这样写测试用例好还是测试用例应该相互独立?例如,
- 测试用例 1:测试 身份验证
- 测试用例 2:测试上传文件
- 测试用例 3:测试 添加文件
- 测试用例 4:测试下一个
- 测试用例5:测试提交
在这种情况下,我会将这些测试用例放入一个测试套件中,以便它们按顺序执行:
测试套件 1:调用测试用例 1 -> 调用测试用例 2 -> 调用测试用例 3 -> 调用测试用例 4 -> 调用测试用例 5
哪个更容易接受?任何建议将不胜感激:)
我更喜欢将测试分开并尽可能独立,这样我就不会从另一个测试用例中调用测试用例。
我的测试是使用关键字构建的,因此它们看起来像:
- myMethods.authetication(用户名, 密码)
- myMethods.uploadFiles()
- myMethods.addFiles()
- myMethods.testNext()
- myMethods.testSubmit()
但是,由于您的测试仅包含一次点击(据我所知),您可以这样做:
第 1 步:
myMethods.authetication(username, password)
第 2 步:
WebUI.waitForElementClickable('id of the upload button')
WebUI.click('id of the upload button')
WebUI.verifyElementNotPresent('id of the upload button')
第 3 步:
WebUI.waitForElementClickable('id of the add files button')
WebUI.click('id of the add files button')
// verify expected condition
第 4 步:
WebUI.waitForElementClickable('id of the next button')
WebUI.click('id of the next button')
// verify expected condition
第 5 步:
WebUI.waitForElementClickable('id of the submitbutton')
WebUI.click('id of the submit button')
// verify expected condition
我是自动化测试新手。我正在使用 Katalon 测试端到端功能,该功能允许用户上传他们的文件并获得分析报告。这是一个快速流程:
身份验证->点击上传文件->点击添加文件->点击下一步->点击提交
是否有编写和安排测试用例和测试套件的指南?现在我正在编写如下测试用例:
- 测试用例 1:测试 身份验证
- 测试用例 2:调用测试用例 1 -> 测试上传文件
- 测试用例 3:调用测试用例 2 -> 测试添加文件
- 测试用例4:调用测试用例3 -> 测试下一步
- 测试用例5:调用测试用例4 -> 测试提交
这样写测试用例好还是测试用例应该相互独立?例如,
- 测试用例 1:测试 身份验证
- 测试用例 2:测试上传文件
- 测试用例 3:测试 添加文件
- 测试用例 4:测试下一个
- 测试用例5:测试提交
在这种情况下,我会将这些测试用例放入一个测试套件中,以便它们按顺序执行:
测试套件 1:调用测试用例 1 -> 调用测试用例 2 -> 调用测试用例 3 -> 调用测试用例 4 -> 调用测试用例 5
哪个更容易接受?任何建议将不胜感激:)
我更喜欢将测试分开并尽可能独立,这样我就不会从另一个测试用例中调用测试用例。
我的测试是使用关键字构建的,因此它们看起来像:
- myMethods.authetication(用户名, 密码)
- myMethods.uploadFiles()
- myMethods.addFiles()
- myMethods.testNext()
- myMethods.testSubmit()
但是,由于您的测试仅包含一次点击(据我所知),您可以这样做:
第 1 步:
myMethods.authetication(username, password)
第 2 步:
WebUI.waitForElementClickable('id of the upload button')
WebUI.click('id of the upload button')
WebUI.verifyElementNotPresent('id of the upload button')
第 3 步:
WebUI.waitForElementClickable('id of the add files button')
WebUI.click('id of the add files button')
// verify expected condition
第 4 步:
WebUI.waitForElementClickable('id of the next button')
WebUI.click('id of the next button')
// verify expected condition
第 5 步:
WebUI.waitForElementClickable('id of the submitbutton')
WebUI.click('id of the submit button')
// verify expected condition