问题标签 [angularjs-e2e]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - Angularjs Test Runner - 检索绑定的值
我对 Angular JS 有点陌生,我一直在这里做教程。我被困在第 8 步,当练习是编写一个测试是否显示缩略图图像的测试时。
基本思路是这样的。我们有一个名为phones/nexus-s.json
. 进出控制器:
好的,很好,电话 JSON 对象作为phone
. 在我们看来:
太好了,我们遍历了所有手机的图片 url。
现在,在测试中,我想检索 的数组phone.images
,查看它的长度,并确保li
呈现的 html 中的项目数量相同。所以我的测试是:
问题是,我不认为我的部分是正确的,如果可能的话,repeater('phone.thumbs').length
我无法找出检索数组的正确方法。phone.thumbs
谁能告诉我该怎么做?
我喜欢一个解释,它实际上也解释了这里发生的事情 - 有很多 Future 对象到处跑,老实说,我不确定如何有效地使用它们。
angularjs - is protractor or browser prefered when testing a large angular application
I have used browser and ptor in my previous tests, and they have different issues, but overall both seem buggy, although I like browser better.
So my question is, for testing a large angular application, is it more preferred to use the protractor.getInstance or just using regular browser?
protractor - 使用量角器在 e2e 测试中使用 Hammer.js
我们正在尝试将量角器与hammer.js 集成以测试我们应用程序中的点击/触摸事件。以前,我们扩展了角度场景 dsl 以将其与 karma e2e 测试相结合。寻找一种使用量角器调用锤击事件的方法。
angularjs - 使用 phantomjs 浏览器运行量角器时,只能运行一次测试
测试代码:
描述('我的网站',函数(){
结果第一次运行,
第二次运行,没有任何中断,只需向上箭头并输入:
第三次
第三次 phantomjs 网络服务器关闭,需要重新连接,然后返回结果 1:
任何线索?
使用的配置文件:
我还注意到有时不需要第 2 步,它会直接进入 ECONNECT 错误,有时它会卡在第 2 步进行多次测试,最终会终止 phantomjs 服务器。
angularjs - 使用量角器进行 AngularJS e2e 测试
我正在尝试通过量角器获取 ng-repeat(ed) 表的最后一行来测试并确保我刚刚在之前的测试运行中创建的对象出现。我已经获得了该行的所有文本,但似乎无法通过反复试验弄清楚如何将最后一行的每一列作为数组的一部分,所以我可以验证每一部分,然后在最后一列我有按钮可以单击,这将是下一步。
我到目前为止的代码是:
如上所述,我要检查的预期输出/输出是“textRunner”,而是得到整行文本:
编辑 这是我的最终代码:
javascript - Protractor Page Objects Inheritance
Given i'm building my angularjs protractor e2e tesing suite leveraging the page objects pattern.
And i separate page object code in different files as much as reasonable.
What would be a good approach to enable page objects inheritance? javascript classic inheritance? Object.create() based inheritance? Other?
Should i keep expectations within the page object? Or favor Martin Fowler optinion by moving them to an assertion library? in which case how exactly would that look like in this javascript-nodejs technology stack?
I've prepared a live jsfiddle playground here so you can try your improvements on.
Or simply paste code within the answer, i'll paste the jsfiddle content below for clarity:
loginPage.js
loginDialog.js
helpers.js
usage.js
testing - 量角器实例与浏览器
我试图寻找类似的 QA,但我找不到一个让我满意的。所以基本上我看到在一些例子中它被使用了
在其他一些例子中,它被使用了。
所以问题是:使用量角器实例和浏览器获取特定网址有什么区别?此外,如果我在 PS 中的假设是正确的,那么更好的做法是:只使用量角器,还是混合它们?
PS我也看到了与调试器在使用上的相同差异。我知道量角器是 web 驱动程序的包装器,我假设量角器.getInstance().get(url) 是 browser.get(url) 的隐式调用。
protractor - 如何使用量角器测试字符串是否不匹配
我正在将我的karma-ng-scenario
测试套件迁移到量角器。我想做类似的事情
以量角器的方式。但似乎没有not()
功能。
我angular-translate
用来将 LONGIN_CONNECT 字符串绑定成多种语言,我想测试字符串是否被翻译。
在全球范围内,是否有一种方法可以测试是否有所不同?...没有课程,页面上不存在,未选中,...
javascript - AngularJS:使用量角器进行 e2e 测试
首先,我是 e2e 测试的菜鸟。我所做的是
- 安装量角器
nmp install protractor
- 安装 webdriver-manager
webdriver-manager start
从我的 angularjs 应用程序所在的目录运行。它运行良好- 运行
protractor tests/e2e/conf.js
它也运行良好
然而在几秒钟内它说Timed out waiting for page to load
这是我的文件:
测试/e2e/conf.js:
测试/e2e/example_spec.js
我只是不明白在哪里定义我的 webapp 布局/放置,所以量角器/webdriver 知道要运行哪个上下文。
node.js - 自动化的 e2e 测试 - WebDriverJS、Jasmine
我正在关注本教程 http://engineering.wingify.com/posts/e2e-testing-with-webdriverjs-jasmine/
第一部分要求创建 testfile.js
var webdriver = require('selenium-webdriver');
当我运行 node testfile.js 时,我能够让浏览器运行
我创建了 testfile.js
$ 猫 testfile.js
我到了你运行 jasmine-node 的部分
预期的行为是它启动浏览器,但这不是我所经历的。