Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. @Test
  2. public void successfulPurchase(){
  3. driver.findElement(By.id("B45593 Sunglasses_entry")).findElement(By.id("Add to Cart")).click();
  4. driver.findElement(By.id("checkout_button")).click();
  5. String name = "Name";
  6. String address = "Address street 420-69";
  7. String email = "mail@gmail.com";
  8. driver.findElement(By.id("order_name")).sendKeys(name);
  9. driver.findElement(By.id("order_address")).sendKeys(address);
  10. driver.findElement(By.id("order_email")).sendKeys(email);
  11. Select paymentOptions = new Select(driver.findElement(By.id("order_pay_type")));
  12. paymentOptions.selectByIndex(2);
  13. driver.findElement(By.id("place_order")).click();
  14.  
  15. String expectedOutput = "Thank you for your order";
  16. WebElement actualOutput = driver.findElement(By.id("order_receipt"));
  17. String actualOutputString = actualOutput.getText();
  18.  
  19. assertEquals(expectedOutput, actualOutputString);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement