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

    Boolean vanished = Wasavi.waitTerminate();
    assertTrue("wasaviFrame must not be exist.", vanished);
  }
Esempio 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);
  }
Esempio 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);
  }
Esempio 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);
  }