在做量角器aftereach描述与angularjs硒服务器的东西 [英] Doing something aftereach describe in protractor with selenium server with 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
andafterAll
which were introduced injasmine 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 ofjasmine-beforeAll
package.这篇关于在做量角器aftereach描述与angularjs硒服务器的东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!