使用量角器时如何运行单个特定的测试用例 [英] How to run a single specific test case when using protractor

查看:24
本文介绍了使用量角器时如何运行单个特定的测试用例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用量角器进行角度 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"?

推荐答案

Protractor 的最新版本(至少)支持通常的 Jasmine 方法:将 describe() 函数重命名为ddescribe(),只有里面的测试才会运行.或者将 it() 函数重命名为 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆