Skip to content

Commit 08e1b12

Browse files
committed
updated test.java
1 parent ffc2b29 commit 08e1b12

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/test/java/com/browserstack/FinstackLoanTest.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
public class FinstackLoanTest extends SeleniumTest {
1818

1919

20-
public void introduceVisualBug(WebElement element, String styleChange) {
21-
try {
22-
JavascriptExecutor js = (JavascriptExecutor) driver;
23-
js.executeScript("arguments[0].setAttribute('style', arguments[1]);", element, styleChange);
24-
Thread.sleep(500); // Small pause to ensure style is applied before screenshot
25-
} catch (Exception e) {
26-
System.out.println("Could not apply visual bug: " + e.getMessage());
27-
}
28-
}
20+
//public void introduceVisualBug(WebElement element, String styleChange) {
21+
// try {
22+
// JavascriptExecutor js = (JavascriptExecutor) driver;
23+
// js.executeScript("arguments[0].setAttribute('style', arguments[1]);", element, styleChange);
24+
// Thread.sleep(500); // Small pause to ensure style is applied before screenshot
25+
// } catch (Exception e) {
26+
// System.out.println("Could not apply visual bug: " + e.getMessage());
27+
// }
28+
// }
2929

3030
@Test
3131
public void loansPayment() throws Exception {
@@ -53,13 +53,13 @@ public void loansPayment() throws Exception {
5353
driver.findElement(By.xpath(createAccountLinkXPath)).click();
5454
Thread.sleep(10000);
5555

56-
// VISUAL BUG: Change the background color of the 'First Name' input field to be noticeable.
57-
WebElement firstNameInput = driver.findElement(By.xpath("//input[@id='firstName']"));
58-
introduceVisualBug(firstNameInput, "background-color: #FFDDC1;"); // Light orange background
56+
// // VISUAL BUG: Change the background color of the 'First Name' input field to be noticeable.
57+
// WebElement firstNameInput = driver.findElement(By.xpath("//input[@id='firstName']"));
58+
// introduceVisualBug(firstNameInput, "background-color: #FFDDC1;"); // Light orange background
5959

6060
// VISUAL BUG: Change the background color of the 'email' input field to be noticeable.
61-
WebElement emailInput = driver.findElement(By.xpath("//input[@id='email']"));
62-
introduceVisualBug(emailInput, "background-color: #320b56ff;"); // purple background
61+
// WebElement emailInput = driver.findElement(By.xpath("//input[@id='email']"));
62+
// introduceVisualBug(emailInput, "background-color: #320b56ff;"); // purple background
6363

6464
PercySDK.screenshot(driver, "Before Filling the Form");
6565

@@ -74,9 +74,9 @@ public void loansPayment() throws Exception {
7474
driver.findElement(By.xpath("//input[@id='password']")).sendKeys("SamplePass123!");
7575
driver.findElement(By.xpath("//input[@id='confirmPassword']")).sendKeys("SamplePass123!");
7676

77-
// VISUAL BUG: Increase the font size of the 'Create Account' button to make it oversized.
78-
WebElement createAccountButton = driver.findElement(By.xpath("//button[text()='Create Account']"));
79-
introduceVisualBug(createAccountButton, "font-size: 25px; padding: 20px;");
77+
// // VISUAL BUG: Increase the font size of the 'Create Account' button to make it oversized.
78+
// WebElement createAccountButton = driver.findElement(By.xpath("//button[text()='Create Account']"));
79+
// introduceVisualBug(createAccountButton, "font-size: 25px; padding: 20px;");
8080

8181

8282
PercySDK.screenshot(driver, "After Filling the Form");
@@ -115,8 +115,8 @@ public void loansPayment() throws Exception {
115115
driver.findElement(By.xpath(loansTabXPath)).click();
116116
Thread.sleep(2000);
117117
// VISUAL BUG: Change the color of the "Loans" page header.
118-
WebElement pageHeader = driver.findElement(By.xpath("//span[text()='Loans']"));
119-
introduceVisualBug(pageHeader, "color: purple;");
118+
// WebElement pageHeader = driver.findElement(By.xpath("//span[text()='Loans']"));
119+
// introduceVisualBug(pageHeader, "color: purple;");
120120

121121
PercySDK.screenshot(driver, "Loans Tab");
122122

@@ -126,8 +126,8 @@ public void loansPayment() throws Exception {
126126
driver.findElement(By.xpath(collapseButtonXPath)).click();
127127
Thread.sleep(1000);
128128
// VISUAL BUG: Add a large, ugly border to the 'Make Payment' button.
129-
WebElement makePaymentBtn = driver.findElement(By.xpath("//button[text()='Make Payment']"));
130-
introduceVisualBug(makePaymentBtn, "border: 5px dashed red;");
129+
// WebElement makePaymentBtn = driver.findElement(By.xpath("//button[text()='Make Payment']"));
130+
// introduceVisualBug(makePaymentBtn, "border: 5px dashed red;");
131131

132132
PercySDK.screenshot(driver, "Without Sidebar");
133133

0 commit comments

Comments
 (0)