你好,游客 登录 注册 搜索
背景:
阅读新闻

Graphene 2.0.0.Alpha3 发布,Ajax 测试扩展

[日期:2013-01-17] 来源:oschina.net  作者:Linux [字体:大 中 小]

Graphene 项目的目的是使用非常性感的类型安全的 API 进行 Ajax 测试,是 Selenium 项目的扩展。

值得关注的改进:

jQuery Selectors

Graphene gets its own @FindBy annotation and ByJQuery selector in order to fully support jQuery selectors. (read more )

Injecting Selenium Resources

The interesting Selenium APIs (HTML5, Mobile, etc.) can be injected to the test or page fragments directly. (read more )

Fluent API for Waiting

Waiting conditions can now be defined in a nice fluent API. (read more )

Injecting List of Page Fragments

It’s possible to inject a list of page fragments with @FindBy List .

Page Fragment Enrichment

Any Arquillian resource available through @ArquillianResource can be injected into page fragments.

重要的 Bug 修复

XHR Request Guards

guardXhr wasn’t waiting for the XHR request to fully complete. So we have improved it and now it not only waits for AJAX callback to completely finish, but it will wait for any asynchronous processing caused by that callback to finish.

Protecting against Stale Elements

You are now completely protected against StaleElementReferenceException when using page fragments and elements injected by @FindBy , because operations on those elements are evaluated lazily (at the time of usage) and they are re-evaluated when they get stale.

Refined Page Fragments

Page Fragments have received a lot of bug fixes and improvements.

jQuery Selectors

This feature injects a jQuery script to a tested page and allows Graphene to find elements using the jQuery Selectors syntax :

@FindBy(jquery = ":button:visible")
WebElement firstVisibleButton;

Note that Graphene injects jQuery in non-conflict way , so it does not affect your tested application.

Injecting Selenium Resources

Graphene leverages a long list of advanced Selenium features and their APIs to take full control of your browser:

You can inject those using @ArquillianResource annotation:

@ArquillianResource
BrowserConnection connection;


@Test
public void test() {
    connection.setOnline(false);
}

Fluent API for Waiting

The Alpha2 API allowed you to define a wait like this:

waitAjax().until(element(button).isVisible());

In order to fully support code-completion, we have decided to deprecate this API in favor of a fluent API:

waitAjax().until().element(button).is().visible();
linux
相关资讯       Graphene 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款