[英]e2e testing angularjs with protractor (protractor interactive mode brakes)
I am learning protractor for e2e testing angularjs and having some difficulties getting things going. 我正在学习e2e测试角度测量仪的量角器,并且遇到一些困难。
Since I am new to this framework, Im following some tutorials like https://egghead.io/lessons/angularjs-protractor-interactive . 由于我是这个框架的新手,我遵循一些教程,如https://egghead.io/lessons/angularjs-protractor-interactive 。
watching the tutorial I see that he checks if an element has been successfully found by *tabbing . 观看教程我看到他通过* tabbing检查是否已成功找到元素。
I gave tries too. 我也试过了。
I made a button and input field as he did and ran into interactive mode. 我做了一个按钮和输入字段,然后进入交互模式。
element(by.tagName("button")).click()
did fine for me. 对我来说很好。 it clicked the button on index.html.
它点击了index.html上的按钮。
However, I cannot check if the element has been found before clicking it. 但是,我无法在单击之前检查是否找到了该元素。 That means I cannot see click option by tabbing when I am done typing to the point element(by.tagName("button")).
这意味着当我输入点元素(by.tagName(“button”))时,我无法通过tab键看到单击选项。
a busy cat http://i59.tinypic.com/dmfcrt.jpg 一只忙碌的猫http://i59.tinypic.com/dmfcrt.jpg
I found it inefficient to rerun specs just to check if element has been found every time. 我发现重新运行规范只是为了检查每次是否找到元素是低效的。
I would really appreciate if someone can let me know the right solution to this problems. 如果有人能让我知道解决这个问题的正确方法,我真的很感激。
Thank you. 谢谢。
This was fixed 6 days ago and is not yet released . 这是在6天前修复的,尚未发布 。
So you can wait for Protractor > 1.3.1 or start using master branch. 因此,您可以等待Protractor> 1.3.1或开始使用master分支。
In case you need sudo
and using Protractor globally installed: 如果您需要
sudo
并使用全局安装的Protractor:
sudo npm -g install git://github.com/angular/protractor#master
I prefer to setup a NodeJS project with package.json and point to an specific Protractor version or commit, for better control: 我更喜欢使用package.json设置NodeJS项目并指向特定的Protractor版本或提交,以便更好地控制:
npm init
npm install --save git://github.com/angular/protractor#ed1c75c7
mkdir -p bin
# some handy shortcuts
ln -s ../node_modules/.bin/protractor bin/p
ln -s ../node_modules/protractor/bin/elementexplorer.js bin/e
# elementexplorer sample usage
bin/e https://angularjs.org/
# Protractor binary sample usage
bin/p your-config.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.