单元测试:前端代码测试 3

端对端测试 注意点:(1)切换框架frameworks: ['ng-scenario'], (2)浏览器安全问题chrome_without_security 语法:

browser().reload()

browser().navigateTo(url, fn)

browser().navigateTo(url)

pause();

sleep(seconds);

input(name).enter(value)

input(name).select(value)

repeater(selector, label).row(index)

element(selector, label).click()

五、指标 Function coverage - Has each function (or subroutine) in the program been called? 函数覆盖率:是不是所有的函数都被调用了 Statement coverage - Has each statement in the program been executed? 状态/语句覆盖率:是不是所有的状态都执行了 Branch coverage - Has each branch (also called DD-path) of each control structure (such as in if and case statements) been executed? For example, given an if statement, have both the true and false branches been executed? Another way of saying this is, has every edge in the program been executed? 分支覆盖率:像 if else case 三目运算 这种 是不是所有的分支都被执行了 ignored :设置被忽略 测试工程师可以查看coverage 测试结果,帮助他们设计测试用例和输入或配置设置,将增加代码覆盖至关重要的功能。两种常见形式的代码覆盖率测试人员使用的statements(lines)覆盖和branch(或edge)的报道。lines覆盖率报告测试的执行足迹的行代码被执行完成测试。edge覆盖报告执行的分支或代码决策点来完成测试。他们都报告覆盖率指标,测量作为一个百分比。这取决于什么形式的意义(s)已使用代码覆盖,67比67的语句覆盖率分支覆盖更全面。

原文地址:https://www.cnblogs.com/poptest/p/5124701.html