Exemplo n.º 1
0
  @Test
  public void testQuit() {
    Wasavi.sendNoWait(":quit\n");

    Boolean vanished = Wasavi.waitTerminate();
    assertTrue("wasaviFrame must not be exist.", vanished);
  }
Exemplo n.º 2
0
  @Test
  public void testExitNotModified() {
    Wasavi.sendNoWait(":xit\n");

    Boolean vanished = Wasavi.waitTerminate();
    assertTrue("wasaviFrame must not be exist.", vanished);

    String text = driver.findElement(By.id("t2")).getAttribute("value");
    assertEquals("#1-1", "", text);
  }
Exemplo n.º 3
0
  @Test
  public void testWriteAndQuit() {
    Wasavi.send("ifoobar\u001b");
    Wasavi.sendNoWait(":wq\n");

    Boolean vanished = Wasavi.waitTerminate();
    assertTrue("wasaviFrame must not be exist.", vanished);

    String text = driver.findElement(By.id("t2")).getAttribute("value");
    assertEquals("#1-1", "foobar", text);
  }
Exemplo n.º 4
0
  @Test
  public void testQuitForce() {
    Wasavi.send("ifoo\u001b");

    Wasavi.send(":qui\n");
    WebElement wasaviFrame = driver.findElement(By.id("wasavi_frame"));
    assertNotNull(wasaviFrame);
    assertEquals(
        "#1-1",
        "quit: The text has been modified; use :quit! to discard any changes.",
        Wasavi.getLastMessage());

    Wasavi.sendNoWait(":qu!\n");
    Boolean vanished = Wasavi.waitTerminate();
    assertTrue("wasaviFrame must not be exist.", vanished);
  }