Package com.meterware.httpunit

Examples of com.meterware.httpunit.WebTable$TableRow


    // Add the item to the cart
    resp = resp.getLinkWith(Util.getBundle("view", "buttonAddToCart")).click();

    // Make sure item is in the cart
    // Check the first two rows of the table
    WebTable itemTable = resp.getTableStartingWith("Item ID");
    itemTable.purgeEmptyCells();
    String[][] table = itemTable.asText();
    assertEquals( "EST-4", table[1][0].trim());
   
    // Set quantity to 3
    WebForm form = resp.getFormWithID("cart");
    form.setParameter("{actionForm.cart.lineItems[0].quantity}", "3");
    resp = form.submit();
   
    // Make sure the Total is $55.50
    itemTable = resp.getTableStartingWith("Item ID");
    itemTable.purgeEmptyCells();
    table = itemTable.asText();
    assertEquals( "$55.50",  table[1][6].trim() );
   }  
View Full Code Here


    assertTrue( resp.getTitle().contains("Spotted Koi") );
    assertTrue( resp.getText().contains("Fresh Water fish from Japan") );
    assertNotNull(resp.getLinkWith("Koi"));

    // Check the first two rows of the table
    WebTable itemTable = resp.getTableStartingWith("EST-4");
    itemTable.purgeEmptyCells();
    String[][] table = itemTable.asText();
    assertEquals( "EST-4",  table[0][0].trim() );
    assertTrue( table[1][0].contains("in Stock") );
    assertTrue( table[1][0].contains("$18.50") );
   }
View Full Code Here

   
    // Submit
    resp = form.submit();
   
    // Make sure the address took
    WebTable table = resp.getTableWithID("address_TestAddress");
    assertNotNull(table);
    TableCell cell = table.getTableCell(0, 0);
    assertNotNull(cell);
    assertTrue(cell.getText().contains("TestAddress"));
    assertTrue(cell.getText().contains("1234 Main Street"));
    assertTrue(cell.getText().contains("Apt 123"));
    assertTrue(cell.getText().contains("Seattle"));
View Full Code Here

     // Sign in and go to addresses
    WebResponse resp = Util.navToAddresses();

    // Get the newly added address
    WebTable table = resp.getTableWithID("address_TestAddress");
    assertNotNull(table);
    TableCell cell = table.getTableCell(0, 0);
    assertNotNull(cell);
   
    // Edit the address by clicking the edit link
    resp = cell.getLinkWith(Util.getBundle("view", "buttonEdit")).click(); // "Edit"
   
    // Enter the new data in the form
    WebForm form = resp.getForms()[1];

    // Make sure this is the right form
    assertEquals(form.getParameterValue("{actionForm.name}"), "TestAddress");
   
    // Set the new values
    form.setParameter( "{actionForm.name}", "EditedTestAddress" );
    form.setParameter( "{actionForm.addr1}", "543 Main Street" );
    form.setParameter( "{actionForm.addr2}", "Unit 345" );
    form.setParameter( "{actionForm.city}", "Portland" );
    form.setParameter( "{actionForm.state}", "OR" );
    form.setParameter( "{actionForm.zip}", "98799" );
    form.setParameter( "{actionForm.country}", "USA2" );
    form.setParameter( "{actionForm.phone}", "208-222-3456" );
   
    // Submit
    resp = form.submit();
   
    // Make sure the address took
    table = resp.getTableWithID("address_EditedTestAddress");
    assertNotNull(table);
    cell = table.getTableCell(0, 0);
    assertNotNull(cell);
    assertTrue(cell.getText().contains("EditedTestAddress"));
    assertTrue(cell.getText().contains("543 Main Street"));
    assertTrue(cell.getText().contains("Unit 345"));
    assertTrue(cell.getText().contains("Portland"));
View Full Code Here

   {
    // Sign in and go to addresses
    WebResponse resp = Util.navToAddresses();

    // Get the newly added address
    WebTable table = resp.getTableWithID("address_EditedTestAddress");
    assertNotNull(table);
    TableCell cell = table.getTableCell(0, 0);
    assertNotNull(cell);
   
    // Click the remove link
    resp = cell.getLinkWith(Util.getBundle("view", "buttonRemove")).click();
   
View Full Code Here

     
      // Make sure we got to the results page
      assertTrue(resp.getText().contains(Util.getBundle("search", "searchResultsLabel"))); // "Search Results"
     
      // Make sure we got the right results
      WebTable itemTable = resp.getTableStartingWith(Util.getBundle("view", "productIdLabel"));
      itemTable.purgeEmptyCells();
      String[][] table = itemTable.asText();
      assertEquals( Util.getBundle("view", "productIdLabel"), table[0][0] ); // "Product ID"
      assertEquals( Util.getBundle("view", "nameLabel"),  table[0][1] ); // "Name"
      assertEquals( Util.getBundle("view", "descriptionLabel"),  table[0][2] ); // "Description"
      assertEquals( "FL-DLH-02",  table[1][0].trim() );
      assertEquals( "Persian",  table[1][1].trim() );
View Full Code Here

     
      // Make sure we got to the results page
      assertTrue(resp.getText().contains(Util.getBundle("search", "searchResultsLabel"))); // "Search Results"

      // Make sure we got the right results
      WebTable itemTable = resp.getTableStartingWith(Util.getBundle("view", "productIdLabel")); //"Product ID"
      assertEquals(itemTable.getRowCount(), 17);
     }
View Full Code Here

TOP

Related Classes of com.meterware.httpunit.WebTable$TableRow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.