Excel Util is refined to ignore headings in data sheet

This commit is contained in:
arul 2025-08-09 12:51:27 +05:30
parent fbaf830731
commit 7d13ea9adf
18 changed files with 96 additions and 67 deletions

Binary file not shown.

View File

12
fake-ip-redirect Executable file
View File

@ -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"

BIN
geckodriver Executable file

Binary file not shown.

View File

@ -4,75 +4,76 @@ import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.*; import java.util.ArrayList;
import java.util.List;
public class ExcelUtils { public class ExcelUtils {
private static final boolean DEBUG = true; // your debug flag private static final boolean DEBUG = true; // your debug flag
public static List<List<String>> fetchQuestDataByColumns(String sheetName) { public static List<List<String>> fetchQuestDataByColumns(String sheetName) {
List<List<String>> questData = new ArrayList<>();
try (FileInputStream fis = new FileInputStream("src/main/resources/testData.xlsx"); List<List<String>> questData = new ArrayList<>();
Workbook workbook = new XSSFWorkbook(fis)) {
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! Sheet sheet = workbook.getSheet(sheetName);
Row row = sheet.getRow(rowIndex);
if (row == null) continue;
List<String> columns = new ArrayList<>(); // Start from 1 to skip header row
for (int colIndex = 0; colIndex < 2; colIndex++) { // Only Column A and B for (int rowIndex = 1; rowIndex <= sheet.getLastRowNum(); rowIndex++) {
Cell cell = row.getCell(colIndex); Row row = sheet.getRow(rowIndex);
columns.add(cell != null ? cell.toString().trim() : ""); if (row == null) continue;
List<String> 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) { } catch (Exception e) {
System.out.println("📄 Row " + rowIndex + ": " + columns); e.printStackTrace();
}
questData.add(columns);
} }
} catch (Exception e) { if (DEBUG) {
e.printStackTrace(); System.out.println("📦 Total quests fetched: " + questData.size());
}
if (DEBUG) {
System.out.println("📦 Total quests fetched: " + questData.size());
}
return questData;
}
public static List<List<String>> fetchQuestDropdownOptions(String sheetName) {
List<List<String>> 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<String> 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) { return questData;
e.printStackTrace();
} }
return allDropdownOptions; public static List<List<String>> fetchQuestDropdownOptions(String sheetName) {
} List<List<String>> allDropdownOptions = new ArrayList<>();
} 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<String> 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;
}
}

View File

@ -5,19 +5,36 @@ import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.firefox.FirefoxProfile;
import java.io.File; import java.io.File;
import java.nio.file.Paths;
public class DriverManager { public class DriverManager {
private static WebDriver driver; private static WebDriver driver;
public static void initDriver() { public static void initDriver() {
if (driver == null) { 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"; 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"; String profilePath = "/home/arul/solo-level-app-automation/.mozilla/firefox/b4xl9fej.default-release";
FirefoxProfile profile = new FirefoxProfile(new File(profilePath)); FirefoxProfile profile = new FirefoxProfile(new File(profilePath));

View File

@ -1 +0,0 @@
,arul,devbox,08.08.2025 17:18,file:///home/arul/.config/libreoffice/4;

Binary file not shown.

View File

@ -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":{}} {"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":{}}

View File

@ -1 +1 @@
,arul,devbox,08.08.2025 17:18,file:///home/arul/.config/libreoffice/4; ,arul,ghostTemple,09.08.2025 12:11,file:///home/arul/.config/libreoffice/4;

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -24,7 +24,7 @@
<property name="os.name" value="Linux"/> <property name="os.name" value="Linux"/>
<property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/> <property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/> <property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/tmp/.mount_eDEX-ULmT5Uv/usr/lib::/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/> <property name="java.library.path" value="/tmp/.mount_eDEX-Ui96UNI/usr/lib::/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
<property name="maven.conf" value="/usr/share/maven/conf"/> <property name="maven.conf" value="/usr/share/maven/conf"/>
<property name="jdk.debug" value="release"/> <property name="jdk.debug" value="release"/>
<property name="java.class.version" value="61.0"/> <property name="java.class.version" value="61.0"/>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="com.ghost.temple.TestRunner" time="66.838" errors="0" skipped="0"> <testsuite tests="1" failures="0" name="com.ghost.temple.TestRunner" time="67.44" errors="0" skipped="0">
<properties> <properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/> <property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="17.0.15+6-Debian-1deb12u1"/> <property name="java.vm.version" value="17.0.15+6-Debian-1deb12u1"/>
@ -24,7 +24,7 @@
<property name="os.name" value="Linux"/> <property name="os.name" value="Linux"/>
<property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/> <property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/> <property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/tmp/.mount_eDEX-ULmT5Uv/usr/lib::/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/> <property name="java.library.path" value="/tmp/.mount_eDEX-Ui96UNI/usr/lib::/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
<property name="maven.conf" value="/usr/share/maven/conf"/> <property name="maven.conf" value="/usr/share/maven/conf"/>
<property name="jdk.debug" value="release"/> <property name="jdk.debug" value="release"/>
<property name="java.class.version" value="61.0"/> <property name="java.class.version" value="61.0"/>
@ -58,5 +58,5 @@
<property name="sun.cpu.endian" value="little"/> <property name="sun.cpu.endian" value="little"/>
<property name="sun.stdout.encoding" value="UTF-8"/> <property name="sun.stdout.encoding" value="UTF-8"/>
</properties> </properties>
<testcase classname="Solo Leveling Quest Management" name="Open Solo Leveling page and click Add Quest" time="66.838"/> <testcase classname="Solo Leveling Quest Management" name="Open Solo Leveling page and click Add Quest" time="67.44"/>
</testsuite> </testsuite>

View File

@ -1,4 +1,4 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Test set: com.ghost.temple.AppTest Test set: com.ghost.temple.AppTest
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec

View File

@ -1,4 +1,4 @@
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Test set: com.ghost.temple.TestRunner Test set: com.ghost.temple.TestRunner
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 67.454 sec Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 68.072 sec