在做量角器aftereach描述与angularjs硒服务器的东西 [英] Doing something aftereach describe in protractor with selenium server with angularjs

查看:195
本文介绍了在做量角器aftereach描述与angularjs硒服务器的东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要做的每个事情后描述(每个测试用例后没有),并各自描述之前,有没有办法做到这一点?我曾尝试下面的格式,但它给了我错误,前后没有定义,是有可能在每次之后做sometask描述:

 描述('测试用例',函数(){
    前(函数(){
        --------------
    })
    beforeEach(函数(){
       -----------------
    })
    afterEach(函数(){
        --------------
    })
    后(函数(){
        -----------------
    })
    它('独立写作',函数(){
             -----------    })它('TASK2',函数(){
                  ------------------
    })
})


解决方案

据我了解,你想要的 beforeAll 毕竟 这是在茉莉介绍2.1


  

该beforeAll功能在所有的规格之前只调用一次
  描述被运行,并且毕竟函数所有规格后称为
  完。这些功能可以用于与以加快测试套件
  昂贵的安装和拆卸。


对于老年茉莉的版本,同样可以用的 茉莉花beforeAll

I want to do something after each describe(not after each testcase) and before each describe, is there any way to do this? I have tried below format, but it gives me error that, before and after not defined, is it possible to do sometask before and after of each describe:

describe('testcase', function () {
    before(function () {
        --------------
    })
    beforeEach(function () {
       -----------------
    })
    afterEach(function () {
        --------------
    })
    after(function () {
        -----------------
    })
    it('task1', function () {
             -----------

    })it('task2', function () {
                  ------------------
    })
})

解决方案

As far as I understand, you want beforeAll and afterAll which were introduced in jasmine 2.1:

The beforeAll function is called only once before all the specs in describe are run, and the afterAll function is called after all specs finish. These functions can be used to speed up test suites with expensive setup and teardown.

For the older jasmine versions, the same can be done with the help of jasmine-beforeAll package.

这篇关于在做量角器aftereach描述与angularjs硒服务器的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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