Commit 91645247 authored by Arsam Ali's avatar Arsam Ali

remove unnaccassary lines of code

parent fb7b136c
...@@ -5,10 +5,7 @@ import org.apache.logging.log4j.LogManager; ...@@ -5,10 +5,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.openqa.selenium.*; import org.openqa.selenium.*;
import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.time.Duration;
public class NisumPage { public class NisumPage {
WebDriver driver; WebDriver driver;
...@@ -44,7 +41,6 @@ public class NisumPage { ...@@ -44,7 +41,6 @@ public class NisumPage {
WebElement globalCareers = driver.findElement(globalCareersBtn); WebElement globalCareers = driver.findElement(globalCareersBtn);
Actions actions = new Actions(driver); Actions actions = new Actions(driver);
// Hovering over the element
actions.moveToElement(globalCareers).perform(); actions.moveToElement(globalCareers).perform();
// log.info("Hovered over the Global Careers button."); // log.info("Hovered over the Global Careers button.");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -17,7 +17,6 @@ public class NisumSteps { ...@@ -17,7 +17,6 @@ public class NisumSteps {
@Given("I am on the Google homepage") @Given("I am on the Google homepage")
public void iAmOnTheGoogleHomepage() { public void iAmOnTheGoogleHomepage() {
// WebDriver auto-start using WebDriverManager
WebDriverManager.chromedriver().setup(); WebDriverManager.chromedriver().setup();
driver = new ChromeDriver(); driver = new ChromeDriver();
driver.manage().window().maximize(); driver.manage().window().maximize();
......
...@@ -2,9 +2,6 @@ package org.example.OpenAI; ...@@ -2,9 +2,6 @@ package org.example.OpenAI;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import okhttp3.*; import okhttp3.*;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -14,7 +11,7 @@ public class OpenAISuggestions { ...@@ -14,7 +11,7 @@ public class OpenAISuggestions {
private static final String API_URL = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=AIzaSyDwyMA69dj-7tejDr7iVlKzU0Y86OGMAZ0"; private static final String API_URL = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=AIzaSyDwyMA69dj-7tejDr7iVlKzU0Y86OGMAZ0";
private final OkHttpClient client = new OkHttpClient(); private final OkHttpClient client = new OkHttpClient();
private final ObjectMapper objectMapper = new ObjectMapper(); // Jackson object mapper for JSON private final ObjectMapper objectMapper = new ObjectMapper();
public Map<String, Object> getSuggestions(String errorLog) throws IOException { public Map<String, Object> getSuggestions(String errorLog) throws IOException {
Map<String, Object> jsonBody = new HashMap<>(); Map<String, Object> jsonBody = new HashMap<>();
...@@ -42,7 +39,7 @@ public class OpenAISuggestions { ...@@ -42,7 +39,7 @@ public class OpenAISuggestions {
} }
String responseBody = response.body().string(); String responseBody = response.body().string();
return parseResponse(responseBody); // Parse the response return parseResponse(responseBody);
} }
} }
......
...@@ -2,14 +2,8 @@ package org.example.SastaTicketPage; ...@@ -2,14 +2,8 @@ package org.example.SastaTicketPage;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.example.NisumSearchPage.NisumPage;
import org.openqa.selenium.By; import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.time.Duration;
public class SastaTicketPage { public class SastaTicketPage {
......
...@@ -57,7 +57,6 @@ public class SastaTicketSteps { ...@@ -57,7 +57,6 @@ public class SastaTicketSteps {
@Then("I should see the available flights") @Then("I should see the available flights")
public void iShouldSeeTheAvailableFlights() { public void iShouldSeeTheAvailableFlights() {
// Validation logic to check if flight results appear.
System.out.println("Flight search results displayed."); System.out.println("Flight search results displayed.");
driver.quit(); driver.quit();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment