面板说明
IDE左上角有个切换按钮,可点击切换面板展示的内容,如下图
左侧测试用例部分,上面有个下拉切换的按钮,点击可以切换tests、test suites、executing三个选项,分别指的是:
tests——测试用例面板:测试用例就是编写基础的测试用例 test suites——测试套件面板:测试套件是将测试用例根据需要组装成一套用例包 executing——执行面板:执行面板就是当前要执行或正在执行的测试用例列表
注意:
1、操作面板只有tests和test suites面板,executing面板下不能操作面板列表内容; 2、tests和test suites下所有内容不能重名,即用例名不得重复,套件包名不能重复,ide会提示报错信息; 3、用例名不建议有前后空格,原因有2个,因为在run命令调用的时候,会自动去前后空格run命令的参数,如果用例名有空格,那么run调用的时候就无法调用成功,另外一个原因,无论在调用还是排查问题的时候,由这个问题引起的错误很难排查;
测试套件说明
1、套件是test suite,它包含若干个test case; 2、每个套件里面不能直接新建用例,而是从用例列表中选择相应的用例组成这个用例包; 3、一个用例可以被多个测试用例引用; 4、测试套件部分可以移除某一个测试用例,但只是从套件中移除,并不会删除此用例; 5、在用例面板中删除被测试套件引用的用例时,ide会进行提示,删除以后,测试套件部分也会移除该用例; 6、测试套件面板中,上面的执行按钮,第一个是执行当前用例所在的套件/包中所有用例,第二个是执行当前打开的用例; 7、测试套件可以对用例进行顺序调整,而用例部分无法控制顺序,这个是比较重要的一个区别; 8、测试套件不能被run方法调用,run方法只能调用用例,不能调用套件/包;
套件学习的side文件
{
"id": "46369fe9-80bc-4824-98bd-7166b613dd6b",
"version": "2.0",
"name": "78",
"url": "http://www.baidu.com",
"tests": [{
"id": "5aae0fea-b480-4f24-b4d9-ea75b15ac08d",
"name": "ga1",
"commands": [{
"id": "cd3001c9-8cf5-42db-8690-36071f6a2133",
"comment": "",
"command": "echo",
"target": "ga1",
"targets": [],
"value": ""
}]
}, {
"id": "a030b06a-e4d8-417a-b20d-612e238debe7",
"name": "ga2",
"commands": [{
"id": "7af6545b-d456-4431-ba0e-8da8e13f7e9f",
"comment": "",
"command": "echo",
"target": "ga2",
"targets": [],
"value": ""
}]
}, {
"id": "14eddad5-ed65-426b-8a5b-bfece68d944d",
"name": "ga3",
"commands": [{
"id": "dbb0a74c-5806-4be4-b6c9-668436a31867",
"comment": "",
"command": "echo",
"target": "ga3",
"targets": [],
"value": ""
}]
}, {
"id": "f469ce84-35d4-4df6-8e62-940bb2f07f16",
"name": "gb1",
"commands": [{
"id": "8a71b90f-6169-4920-9f56-94cc215e4c14",
"comment": "",
"command": "echo",
"target": "gb1",
"targets": [],
"value": ""
}]
}, {
"id": "21757d13-d3a2-44a0-9397-3879d5a226fe",
"name": "gb2",
"commands": [{
"id": "f03f26ab-ae20-45ac-8b99-85c47d687c3a",
"comment": "",
"command": "echo",
"target": "gb2",
"targets": [],
"value": ""
}]
}, {
"id": "775a0bd3-e58b-4e6a-922c-d6aac98112c8",
"name": "gb3",
"commands": [{
"id": "1ef07920-6462-4fc2-8d18-b204a6669c84",
"comment": "",
"command": "echo",
"target": "gb3",
"targets": [],
"value": ""
}]
}, {
"id": "aac714eb-b860-4a48-a2ab-7d58ee81df1d",
"name": "gab",
"commands": [{
"id": "8ff2e409-0759-449b-8ef6-0ec33b0711b1",
"comment": "",
"command": "echo",
"target": "gab",
"targets": [],
"value": ""
}]
}],
"suites": [{
"id": "4d518659-f169-4951-a940-851b4e9def4b",
"name": "ga",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["5aae0fea-b480-4f24-b4d9-ea75b15ac08d", "a030b06a-e4d8-417a-b20d-612e238debe7", "14eddad5-ed65-426b-8a5b-bfece68d944d", "aac714eb-b860-4a48-a2ab-7d58ee81df1d"]
}, {
"id": "79b450dc-76ed-46cf-91f0-909425b01122",
"name": "gb",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["aac714eb-b860-4a48-a2ab-7d58ee81df1d", "f469ce84-35d4-4df6-8e62-940bb2f07f16", "21757d13-d3a2-44a0-9397-3879d5a226fe", "775a0bd3-e58b-4e6a-922c-d6aac98112c8"]
}],
"urls": ["http://www.baidu.com/"],
"plugins": []
}