Skip to content

Commit 466a0b4

Browse files
committed
fix: testng checkout flow test
1 parent 12db0bc commit 466a0b4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

testng/src/test/java/com/example/SimpleTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ public class SimpleTest {
2323
public void setUp() throws Exception {
2424
try {
2525
System.out.println("Setting up Chrome options...");
26-
27-
// Try a simpler approach first - just basic capabilities
26+
2827
DesiredCapabilities caps = new DesiredCapabilities();
2928
caps.setBrowserName("chrome");
3029

@@ -125,8 +124,8 @@ public void testCheckoutFlowBStackDemo() {
125124

126125
// Checkout
127126
driver.findElement(By.id("checkout-shipping-continue")).click();
128-
driver.findElement(By.xpath("//*[text()='Continue']")).click();
129-
driver.findElement(By.xpath("//*[text()='Orders']")).click();
127+
String checkoutMessage = driver.findElement(By.id("confirmation-message")).getText();
128+
Assert.assertEquals(checkoutMessage, "Your Order has been successfully placed.");
130129

131130
System.out.println("Test passed: Checkout flow works!");
132131
}

0 commit comments

Comments
 (0)