我学习的端到端测试angularjs量角器有一些困难,让事情进展。
I am learning protractor for e2e testing angularjs and having some difficulties getting things going.
由于我是新来这个框架,进出口以下一些教程像https://egghead.io/lessons/angularjs-protractor-interactive.
Since I am new to this framework, Im following some tutorials like https://egghead.io/lessons/angularjs-protractor-interactive.
看教程,我看到他检查是否元素已通过的 * Tab键的成功发现。
watching the tutorial I see that he checks if an element has been successfully found by *tabbing.
我放弃尝试了。
我做了一个按钮,并输入字段像他那样跑进交互模式。
I made a button and input field as he did and ran into interactive mode.
element(by.tagName("button")).click()
我做的罚款。它单击该按钮上的index.html。
did fine for me. it clicked the button on index.html.
但是,如果元素已点击之前发现我无法检查。这意味着我不能看到当我做打字的点元素(by.tagName(按钮))跳格单击选项。
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")).
我发现它效率低下重新运行规范只是为了检查是否元素已经发现每一次。
I found it inefficient to rerun specs just to check if element has been found every time.
我真的AP preciate如果有人可以让我知道正确的解决这个问题。
I would really appreciate if someone can let me know the right solution to this problems.
感谢您。
这是固定的 5天前且尚未发布。
所以,你可以等待量角器> 1.3.1或开始使用主分支。
So you can wait for Protractor > 1.3.1 or start using master branch.
如果你需要须藤
并用量角器全球的装机量:
In case you need sudo
and using Protractor globally installed:
sudo npm -g install git://github.com/angular/protractor#master
我preFER设置一个项目的NodeJS用的package.json,并指向一个特定的量角器版本或承诺,更好地控制:
I prefer to setup a NodeJS project with package.json and point to an specific Protractor version or commit, for better control:
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