如何使用简历()的角JS端到端测试? [英] How do I use resume() in Angular JS e2e testing?

查看:147
本文介绍了如何使用简历()的角JS端到端测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要通过这个角度JS教程的第三步。 http://docs.angularjs.org/tutorial/step_03

I am going through step three of this angular js tutorial. http://docs.angularjs.org/tutorial/step_03

在最后的任务是添加暂停()语句结束到终端的测试里面重新运行它。

The very last task is to "Add a pause() statement inside of an end-to-end test and rerun it."

我是能够添加暂停()和测试暂停,因为它应该。问题是,如何恢复?

I was able to add pause() and the test paused as it should. The question is, how to resume?

文档暂停()这里表示调用简历()在控制台或单击亚军UI简历链接,但我似乎无法弄清楚如何调用简历从控制台,也可以找到在亚军UI简历链接。

The documentation for pause() here indicates calling resume() in the console or clicking the resume link in the Runner UI, but I can't seem to figure out how to call resume from the console, nor can I find the resume link in the Runner UI.

你怎么叫简历()

推荐答案

我的猜测是你把暂停()在错误的地方在<$ c函数调用$ C>测试\\ E2E \\ scenarios.js 文件。我这样做同样的事情 - 测试没有停顿,它完成第一或两者或两者都不是,这取决于你把暂停()呼叫

My guess is you put the pause() function call in the wrong place in your test\e2e\scenarios.js file. I did this same thing - the test doesn't pause, it finishes the first or both or neither, depending on where you put the pause() call.

暂停()呼叫你的 beforeEach(...)调用像这样

beforeEach(function() {
    browser().navigateTo('app/index.html');

    pause();
});

随后的它('应该过滤的右括号后直接添加在本教程中给出的新的它(...)方法手机...)功能。

Then add the new it(...) method given in the tutorial directly after the closing parenthesis of the it('should filter the phone...) function.

现在的端到端测试页将执行每个它(...)部分之前暂停,并让你的测试运行前更改DOM内容。例如,如果你点击'恢复'没有寻找任何的第一个测试通过,因为有清单3电话条目。但是,如果你搜索XYZ会失败,因为不会有列表中的任何电话条目。

Now the e2e test page will pause before executing each it(...) section and let you change the DOM contents before the test runs. For example, if you click 'resume' without searching for anything the first test passes because there are 3 phone entries in the list. But if you search for xyz it will fail because there will not be any phone entries in the list.

您还可以将暂停()每次通话前预期(中继器(...))输入('...')调用每个子测试之前有测试暂停。通过将一个暂停()之前每​​个期待(...)调用,您可以编辑后的DOM 输入('...')电话已经改变,但作出断言之前,所以你可以看到输入如何变化的内容和原因改变了自己的内容可能会导致asssertion( 期待(...))失败或成功。

You can also place the pause() call before each expect(repeater(...)) or input('...') call to have the test pause before each sub test. By placing a pause() before each expect(...) call you can edit the DOM after the input('...') call has changed it but before the assertion is made so you can see how the input changes the content and why changing that content yourself might cause an asssertion (expect(...)) to fail or succeed.

这篇关于如何使用简历()的角JS端到端测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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