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
@FindByNgselectors (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
