diff --git a/drivers-cache/geckodriver/linux64/0.36.0/geckodriver b/drivers-cache/geckodriver/linux64/0.36.0/geckodriver new file mode 100755 index 0000000..0cb5944 Binary files /dev/null and b/drivers-cache/geckodriver/linux64/0.36.0/geckodriver differ diff --git a/drivers-cache/resolution.properties b/drivers-cache/resolution.properties new file mode 100644 index 0000000..e69de29 diff --git a/fake-ip-redirect b/fake-ip-redirect new file mode 100755 index 0000000..ed57578 --- /dev/null +++ b/fake-ip-redirect @@ -0,0 +1,12 @@ +#!/bin/bash +# Redirect traffic for 192.168.31.73 to 10.0.2.15 + +# Enable IP forwarding +sudo sysctl -w net.ipv4.ip_forward=1 + +# Add NAT rule to redirect packets +sudo iptables -t nat -A OUTPUT -d 192.168.31.73 -j DNAT --to-destination 127.0.0.1 +sudo iptables -t nat -A POSTROUTING -j MASQUERADE + +echo "IP redirection set: 192.168.31.73 → 127.0.0.1" + diff --git a/geckodriver b/geckodriver new file mode 100755 index 0000000..0cb5944 Binary files /dev/null and b/geckodriver differ diff --git a/src/main/java/com/ghost/temple/ExcelUtils.java b/src/main/java/com/ghost/temple/ExcelUtils.java index b0d9a08..3793bbe 100644 --- a/src/main/java/com/ghost/temple/ExcelUtils.java +++ b/src/main/java/com/ghost/temple/ExcelUtils.java @@ -4,75 +4,76 @@ import org.apache.poi.ss.usermodel.*; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.io.FileInputStream; -import java.util.*; +import java.util.ArrayList; +import java.util.List; public class ExcelUtils { private static final boolean DEBUG = true; // your debug flag - public static List> fetchQuestDataByColumns(String sheetName) { - - List> questData = new ArrayList<>(); + public static List> fetchQuestDataByColumns(String sheetName) { - try (FileInputStream fis = new FileInputStream("src/main/resources/testData.xlsx"); - Workbook workbook = new XSSFWorkbook(fis)) { + List> questData = new ArrayList<>(); - Sheet sheet = workbook.getSheet(sheetName); + try (FileInputStream fis = new FileInputStream("src/main/resources/testData.xlsx"); + Workbook workbook = new XSSFWorkbook(fis)) { - for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) { // start from 0! - Row row = sheet.getRow(rowIndex); - if (row == null) continue; + Sheet sheet = workbook.getSheet(sheetName); - List columns = new ArrayList<>(); - for (int colIndex = 0; colIndex < 2; colIndex++) { // Only Column A and B - Cell cell = row.getCell(colIndex); - columns.add(cell != null ? cell.toString().trim() : ""); + // Start from 1 to skip header row + for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) { + Row row = sheet.getRow(rowIndex); + if (row == null) continue; + + List columns = new ArrayList<>(); + for (int colIndex = 0; colIndex < 2; colIndex++) { // Only Column A and B + Cell cell = row.getCell(colIndex); + columns.add(cell != null ? cell.toString().trim() : ""); + } + + if (DEBUG) { + System.out.println("📄 Row " + rowIndex + ": " + columns); + } + + questData.add(columns); } - if (DEBUG) { - System.out.println("📄 Row " + rowIndex + ": " + columns); - } - - questData.add(columns); + } catch (Exception e) { + e.printStackTrace(); } - } catch (Exception e) { - e.printStackTrace(); - } - - if (DEBUG) { - System.out.println("📦 Total quests fetched: " + questData.size()); - } - - return questData; -} - - -public static List> fetchQuestDropdownOptions(String sheetName) { - List> allDropdownOptions = new ArrayList<>(); - - try (FileInputStream fis = new FileInputStream("src/main/resources/testData.xlsx"); - Workbook workbook = new XSSFWorkbook(fis)) { - - Sheet sheet = workbook.getSheet(sheetName); - - for (int rowIndex = 0; rowIndex <= sheet.getLastRowNum(); rowIndex++) { - Row row = sheet.getRow(rowIndex); - if (row == null) continue; - - List dropdownRow = new ArrayList<>(); - for (int colIndex = 2; colIndex <= 12; colIndex++) { // columns C to M (dropdowns) - Cell cell = row.getCell(colIndex); - dropdownRow.add(cell != null ? cell.toString().trim() : ""); - } - allDropdownOptions.add(dropdownRow); + if (DEBUG) { + System.out.println("📦 Total quests fetched: " + questData.size()); } - } catch (Exception e) { - e.printStackTrace(); + return questData; } - return allDropdownOptions; -} + public static List> fetchQuestDropdownOptions(String sheetName) { + List> allDropdownOptions = new ArrayList<>(); -} \ No newline at end of file + try (FileInputStream fis = new FileInputStream("src/main/resources/testData.xlsx"); + Workbook workbook = new XSSFWorkbook(fis)) { + + Sheet sheet = workbook.getSheet(sheetName); + + // Skip header row by starting at 1 + for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) { + Row row = sheet.getRow(rowIndex); + if (row == null) continue; + + List dropdownRow = new ArrayList<>(); + for (int colIndex = 2; colIndex <= 12; colIndex++) { // columns C to M (dropdowns) + Cell cell = row.getCell(colIndex); + dropdownRow.add(cell != null ? cell.toString().trim() : ""); + } + allDropdownOptions.add(dropdownRow); + } + + } catch (Exception e) { + e.printStackTrace(); + } + + return allDropdownOptions; + } +} diff --git a/src/main/java/com/ghost/temple/driver/DriverManager.java b/src/main/java/com/ghost/temple/driver/DriverManager.java index 562c358..4f1c2d6 100644 --- a/src/main/java/com/ghost/temple/driver/DriverManager.java +++ b/src/main/java/com/ghost/temple/driver/DriverManager.java @@ -5,19 +5,36 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxProfile; + import java.io.File; +import java.nio.file.Paths; public class DriverManager { private static WebDriver driver; public static void initDriver() { if (driver == null) { - WebDriverManager.firefoxdriver().setup(); + try { + // Set a local cache folder for downloaded drivers + String cachePath = Paths.get(System.getProperty("user.dir"), "drivers-cache").toString(); - // Path to Firefox binary + WebDriverManager.firefoxdriver() + .cachePath(cachePath) // cache folder inside project + .avoidBrowserDetection() // skip local browser version check + .setup(); + + } catch (Exception e) { + System.err.println("[WARN] WebDriverManager failed to setup driver: " + e.getMessage()); + // Fallback to manual driver path if cached or downloaded driver is unavailable + // Change this path to your manually downloaded geckodriver executable + System.setProperty("webdriver.gecko.driver", + "/home/arul/solo-level-app-automation/geckodriver"); + } + + // Firefox binary path String firefoxBinaryPath = "/home/arul/solo-level-app-automation/firefox/firefox"; - // Path to specific profile + // Firefox profile path String profilePath = "/home/arul/solo-level-app-automation/.mozilla/firefox/b4xl9fej.default-release"; FirefoxProfile profile = new FirefoxProfile(new File(profilePath)); diff --git a/src/main/resources/.~lock.testData.xlsx# b/src/main/resources/.~lock.testData.xlsx# deleted file mode 100644 index 5a558c2..0000000 --- a/src/main/resources/.~lock.testData.xlsx# +++ /dev/null @@ -1 +0,0 @@ -,arul,devbox,08.08.2025 17:18,file:///home/arul/.config/libreoffice/4; \ No newline at end of file diff --git a/src/main/resources/testData.xlsx b/src/main/resources/testData.xlsx index e5deeba..87d6de4 100644 Binary files a/src/main/resources/testData.xlsx and b/src/main/resources/testData.xlsx differ diff --git a/storage.json b/storage.json index d63975a..46d8b03 100644 --- a/storage.json +++ b/storage.json @@ -1 +1 @@ -{"localStorage":{"soloLevelUpUserStats":"{\"name\":\"Arul\",\"level\":1,\"exp\":30,\"expToNextLevel\":100,\"job\":null,\"title\":null,\"hp\":100,\"maxHp\":100,\"mp\":10,\"maxMp\":10,\"fatigue\":0,\"gold\":0,\"stats\":{\"str\":10,\"agi\":10,\"per\":10,\"int\":10,\"vit\":10},\"statPoints\":1,\"equipment\":[],\"quests\":[{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"1eab5d73-3269-4775-b2a8-8af98d8add44\",\"active\":false,\"completed\":true,\"progress\":100,\"isCustom\":true,\"createdAt\":1754693126749,\"completedAt\":1754693246659},{\"title\":\"The Refiner - Appearance Leveling\",\"description\":\"Focusing on Skin health, Hair health, preventing Hair loss, Preventing Fat gain. Focused on Weight Loss and over all Hygiene the way we look. To Attract people and be charismatic.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"72c6bfa2-419e-4b89-b52f-e28ecad313bb\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754693134029},{\"title\":\"King of Deception - Leveling up Art of Attraction\",\"description\":\"Focused on building a solid character. that is strong.. Talented, Attract people and seductive at same time. Manipulative in good way. Positive Manipulation by doing a good job on something we do and gaining trust among other people.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"9255e741-318f-40aa-8545-f4d778b63aec\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754693142005},{\"title\":\"The Architect of Himself - Leveling up strength both physically and mentally\",\"description\":\"1. Exercise everyday Morning 1 hr (Cardio + strength) 2. Gain Knowledge on New concept or Technology, Read books. 3. Train Martial arts - Armed or Unarmed combat styles. Focus on Leveling up your Intellect, your Strength, Your Martial arts skill and your Aesthetics eventually.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"022fec2c-06e9-4e50-afd6-8f8008989966\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754693150990},{\"title\":\"The Phoenix - Rise from Ashes\",\"description\":\"Keep Moving Forward, No matter what. No matter how much pain you face. you can do take breaks to learn from failures. But never quit . Never Settle. Accept your Pain. see it as a part of life. both physical and Mental Pain. If you can cure it you can cure them. but if you can't never use them as an excuse to be Lower. Always improve from pain and be strong if possible. the Key idea is not to stop at any cost and keep moving forward. Not to embrace pain or romanticize it.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"5dc3636e-a00e-4015-89f5-18d22b4d85f6\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754693161795}],\"completedQuests\":[\"1eab5d73-3269-4775-b2a8-8af98d8add44\"],\"inventory\":[{\"id\":\"item-health-potion\",\"name\":\"Health Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 100 HP when consumed.\",\"quantity\":3},{\"id\":\"item-mana-potion\",\"name\":\"Mana Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 50 MP when consumed.\",\"quantity\":2}]}"},"sessionStorage":{}} \ No newline at end of file +{"localStorage":{"soloLevelUpUserStats":"{\"name\":\"Arul\",\"level\":1,\"exp\":0,\"expToNextLevel\":100,\"job\":null,\"title\":null,\"hp\":100,\"maxHp\":100,\"mp\":10,\"maxMp\":10,\"fatigue\":0,\"gold\":0,\"stats\":{\"str\":10,\"agi\":10,\"per\":10,\"int\":10,\"vit\":10},\"statPoints\":0,\"equipment\":[],\"quests\":[{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"A\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"d110453f-877b-46fe-8622-771d7c5fe812\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754723908926},{\"title\":\"The Refiner - Appearance Leveling\",\"description\":\"Focusing on Skin health, Hair health, preventing Hair loss, Preventing Fat gain. Focused on Weight Loss and over all Hygiene the way we look. To Attract people and be charismatic.\",\"reward\":\"Experience only\",\"difficulty\":\"C\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"aa280321-49ef-42d5-bbea-efb1d0612793\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754723916208},{\"title\":\"King of Deception - Leveling up Art of Attraction\",\"description\":\"Focused on building a solid character. that is strong.. Talented, Attract people and seductive at same time. Manipulative in good way. Positive Manipulation by doing a good job on something we do and gaining trust among other people.\",\"reward\":\"Experience only\",\"difficulty\":\"B\",\"priority\":\"Medium\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"e9eb7081-5c47-4fac-a333-dce855df5f64\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754723924455},{\"title\":\"The Architect of Himself - Leveling up strength both physically and mentally\",\"description\":\"1. Exercise everyday Morning 1 hr (Cardio + strength) 2. Gain Knowledge on New concept or Technology, Read books. 3. Train Martial arts - Armed or Unarmed combat styles. Focus on Leveling up your Intellect, your Strength, Your Martial arts skill and your Aesthetics eventually.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"318cdaa2-7aaa-4a87-a735-1a3b26fe3d37\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754723933472},{\"title\":\"The Phoenix - Rise from Ashes\",\"description\":\"Keep Moving Forward, No matter what. No matter how much pain you face. you can do take breaks to learn from failures. But never quit . Never Settle. Accept your Pain. see it as a part of life. both physical and Mental Pain. If you can cure it you can cure them. but if you can't never use them as an excuse to be Lower. Always improve from pain and be strong if possible. the Key idea is not to stop at any cost and keep moving forward. Not to embrace pain or romanticize it.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"70e20d9e-ac40-42ba-9c2d-0a6a4ad3767b\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754723944347}],\"completedQuests\":[],\"inventory\":[{\"id\":\"item-health-potion\",\"name\":\"Health Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 100 HP when consumed.\",\"quantity\":3},{\"id\":\"item-mana-potion\",\"name\":\"Mana Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 50 MP when consumed.\",\"quantity\":2}]}"},"sessionStorage":{}} \ No newline at end of file diff --git a/target/classes/.~lock.testData.xlsx# b/target/classes/.~lock.testData.xlsx# index 5a558c2..b3b0cb0 100644 --- a/target/classes/.~lock.testData.xlsx# +++ b/target/classes/.~lock.testData.xlsx# @@ -1 +1 @@ -,arul,devbox,08.08.2025 17:18,file:///home/arul/.config/libreoffice/4; \ No newline at end of file +,arul,ghostTemple,09.08.2025 12:11,file:///home/arul/.config/libreoffice/4; \ No newline at end of file diff --git a/target/classes/com/ghost/temple/ExcelUtils.class b/target/classes/com/ghost/temple/ExcelUtils.class index e0042e1..a40e439 100644 Binary files a/target/classes/com/ghost/temple/ExcelUtils.class and b/target/classes/com/ghost/temple/ExcelUtils.class differ diff --git a/target/classes/com/ghost/temple/driver/DriverManager.class b/target/classes/com/ghost/temple/driver/DriverManager.class index 0b090e0..9db5056 100644 Binary files a/target/classes/com/ghost/temple/driver/DriverManager.class and b/target/classes/com/ghost/temple/driver/DriverManager.class differ diff --git a/target/classes/testData.xlsx b/target/classes/testData.xlsx index e5deeba..87d6de4 100644 Binary files a/target/classes/testData.xlsx and b/target/classes/testData.xlsx differ diff --git a/target/cucumber-report.html b/target/cucumber-report.html index 2f85351..408c35e 100644 --- a/target/cucumber-report.html +++ b/target/cucumber-report.html @@ -40,7 +40,7 @@ body{padding:0;margin:0}.html-formatter{max-width:1600px;min-height:100vh;margin