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

Arquillian AngularJS 1.2.0.Alpha1 发布

[日期:2014-05-07] 来源:oschina.net   作者:Linux [字体:大 中 小]

Arquillian 团队今天发布了 Arquillian AngularJS 1.2.0.Alpha1 版本。这是 Arquillian 用于 AngularJS 支持的扩展。

Arquillian 使用指南 http://www.linuxidc.com/Linux/2013-07/87941.htm

这也是首个发行版本,增强方面包括:

Graphene enhancements for AngularJS

  • WebDriver event synchronization
  • @FindByNg selectors (see below)

@FindByNg Selectors

  • Model bindings – @FindByNg(model = "..")
  • Button, link or form actions – @FindByNg(action = "..")
  • Repeated DOM blocks – @FindByNg(repeat = "..")

使用实例:

@RunWith(Arquillian.class)
          @RunAsClient
          public class AngularTest {
      
              ..
      
              @FindByNg(model = "todo.done")
              List todos;
      
              @FindByNg(model = "todoText")
              WebElement todoEntry;
      
              @FindByNg(action = "archive()")
              WebElement archive;
      
              @FindByNg(action = "addTodo()")
              WebElement addTodo;
      
              @FindByNg(repeat = "todo in todos")
              List todoRepeat;
      
              @Before
              public void loadPage() {
                  browser.navigate().to(contextRoot + "index.html");
              }
      
              @Test
              public void testNumberOfTodos() {
                  assertEquals(2, todos.size());
              }
      
              @Test
              public void testArchive() {
                  assertEquals(2, todos.size());
                  archive.click();
                  assertEquals(1, todos.size());
              }
      
              @Test
              public void testAddTodo() {
                  assertEquals(2, todos.size());
                  todoEntry.sendKeys("This is a new TODO item");
                  addTodo.submit();
                  assertEquals(3, todos.size());
              }
      
              @Test
              public void testRepeater() {
                  assertEquals(2, todoRepeat.size());
                  WebElement secondRow = todoRepeat.get(1);
                  WebElement checkbox = secondRow.findElement(By.tagName("input"));
                  WebElement todoItem = secondRow.findElement(By.tagName("span"));
                  assertEquals("second todo", todoItem.getText());
      
                  checkbox.click();
                  archive.click();
      
                  assertEquals(0, todoRepeat.size());
              }
          }

Arquillian 的详细介绍:请点这里
Arquillian 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/101351.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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