如何用量角器时运行一个特定的测试案例 [英] How to run a single specific test case when using protractor
问题描述
我使用我的应用程序的角度JS测试量角器,并有目前约19的测试例,其中他们中的一个发生故障
I am using protractor for angular js testing in my app and have around 19 test cases at the moment, of which one of them is failing
describe('Login page', function() {
beforeEach(function() {
browser.ignoreSynchronization = true;
ptor = protractor.getInstance();
});
it('should contain navigation items', function(){
//test case code here
});
it('should login the user successfully', function(){
//test case code here
})
});
目前,我运行所有的测试用例。但是,我怎么能调试例如,一个被描述为登录页应该成功登录用户?
Currently, I run all the test cases. But, how can I run just one test case to debug an issue for example one which is described as "Login page should login the user successfully"?
推荐答案
最新的版本(至少)量角器的支持这样做的通常的茉莉花方式:重命名描述()
函数 ddescribe()
,只有里面的测试运行。或重命名它()
函数 IIT()
,也只有这个测试将运行。
The most recent version (at least) of Protractor supports the usual Jasmine way of doing that: rename a describe()
function to ddescribe()
, and only the tests inside it will run. Or rename an it()
function to iit()
, and only this test will run.
这篇关于如何用量角器时运行一个特定的测试案例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!