merged solo level wrapper and create quest automation into one project. Inbuilt Firefox browser in the project source

This commit is contained in:
arul 2025-08-09 04:19:00 +05:30
parent fc401b03c9
commit fbaf830731
80 changed files with 320 additions and 28 deletions

Binary file not shown.

20
festival-tts Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# Check if festival is installed
if ! command -v festival &> /dev/null; then
echo "🎤 Festival not found. Installing now (requires sudo)..."
sudo apt update
sudo apt install -y festival
fi
# Check if user provided text
if [ $# -eq 0 ]; then
echo "Usage: $0 \"text to speak\""
exit 1
fi
TEXT="$1"
# Speak text using festival
echo "$TEXT" | festival --tts

0
firefox/.parentlock Normal file
View File

26
firefox/application.ini Normal file
View File

@ -0,0 +1,26 @@
; This file is not used. If you modify it and want the application to use
; your modifications, move it under the browser/ subdirectory and start with
; the "-app /path/to/browser/application.ini" argument.
[App]
Vendor=Mozilla
Name=Firefox
RemotingName=firefox
Version=141.0.3
BuildID=20250806102122
SourceRepository=https://hg.mozilla.org/releases/mozilla-release
SourceStamp=f3e8f920d75245874ec3bb5c0d9b865129fe7f38
ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
[Gecko]
MinVersion=141.0.3
MaxVersion=141.0.3
[XRE]
EnableProfileMigrator=1
[Crash Reporter]
Enabled=1
ServerURL=https://crash-reports.mozilla.com/submit?id={ec8030f7-c20a-464f-9b0e-13a3a9e97384}&version=141.0.3&buildid=20250806102122
[AppUpdate]
URL=https://aus5.mozilla.org/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
firefox/browser/omni.ja Normal file

Binary file not shown.

BIN
firefox/crashhelper Executable file

Binary file not shown.

BIN
firefox/crashreporter Executable file

Binary file not shown.

View File

@ -0,0 +1,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//
// This pref is in its own file for complex reasons. See the comment in
// browser/app/Makefile.in, bug 756325, and bug 1431342 for details. Do not add
// other prefs to this file.
pref("app.update.channel", "release");

View File

@ -0,0 +1,14 @@
libnspr4.so
libplc4.so
libplds4.so
libmozsandbox.so
libgkcodecs.so
liblgpllibs.so
libnssutil3.so
libnss3.so
libsmime3.so
libmozsqlite3.so
libssl3.so
libmozgtk.so
libmozwayland.so
libxul.so

BIN
firefox/firefox Executable file

Binary file not shown.

BIN
firefox/firefox-bin Executable file

Binary file not shown.

BIN
firefox/firefox-bin.sig Normal file

Binary file not shown.

BIN
firefox/firefox.sig Normal file

Binary file not shown.

Binary file not shown.

BIN
firefox/glxtest Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,9 @@
{
"name": "clearkey",
"description": "ClearKey Gecko Media Plugin",
"version": "1",
"x-cdm-module-versions": "4",
"x-cdm-interface-versions": "10",
"x-cdm-host-versions": "10",
"x-cdm-codecs": ""
}

BIN
firefox/icons/updater.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
firefox/libfreeblpriv3.so Executable file

Binary file not shown.

BIN
firefox/libgkcodecs.so Executable file

Binary file not shown.

BIN
firefox/liblgpllibs.so Executable file

Binary file not shown.

BIN
firefox/libmozavcodec.so Executable file

Binary file not shown.

BIN
firefox/libmozavutil.so Executable file

Binary file not shown.

BIN
firefox/libmozgtk.so Executable file

Binary file not shown.

BIN
firefox/libmozsandbox.so Executable file

Binary file not shown.

BIN
firefox/libmozsqlite3.so Executable file

Binary file not shown.

BIN
firefox/libmozwayland.so Executable file

Binary file not shown.

BIN
firefox/libnspr4.so Executable file

Binary file not shown.

BIN
firefox/libnss3.so Executable file

Binary file not shown.

BIN
firefox/libnssutil3.so Executable file

Binary file not shown.

BIN
firefox/libonnxruntime.so Executable file

Binary file not shown.

BIN
firefox/libplc4.so Executable file

Binary file not shown.

BIN
firefox/libplds4.so Executable file

Binary file not shown.

BIN
firefox/libsmime3.so Executable file

Binary file not shown.

BIN
firefox/libsoftokn3.so Executable file

Binary file not shown.

BIN
firefox/libssl3.so Executable file

Binary file not shown.

BIN
firefox/libxul.so Executable file

Binary file not shown.

BIN
firefox/libxul.so.sig Normal file

Binary file not shown.

BIN
firefox/omni.ja Normal file

Binary file not shown.

BIN
firefox/pingsender Executable file

Binary file not shown.

5
firefox/platform.ini Normal file
View File

@ -0,0 +1,5 @@
[Build]
BuildID=20250806102122
Milestone=141.0.3
SourceRepository=https://hg.mozilla.org/releases/mozilla-release
SourceStamp=f3e8f920d75245874ec3bb5c0d9b865129fe7f38

58
firefox/precomplete Normal file
View File

@ -0,0 +1,58 @@
remove "vaapitest"
remove "updater.ini"
remove "updater"
remove "removed-files"
remove "precomplete"
remove "platform.ini"
remove "pingsender"
remove "omni.ja"
remove "libxul.so.sig"
remove "libxul.so"
remove "libssl3.so"
remove "libsoftokn3.so"
remove "libsmime3.so"
remove "libplds4.so"
remove "libplc4.so"
remove "libonnxruntime.so"
remove "libnssutil3.so"
remove "libnss3.so"
remove "libnspr4.so"
remove "libmozwayland.so"
remove "libmozsqlite3.so"
remove "libmozsandbox.so"
remove "libmozgtk.so"
remove "libmozavutil.so"
remove "libmozavcodec.so"
remove "liblgpllibs.so"
remove "libgkcodecs.so"
remove "libfreeblpriv3.so"
remove "icons/updater.png"
remove "gmp-clearkey/0.1/manifest.json"
remove "gmp-clearkey/0.1/libclearkey.so.sig"
remove "gmp-clearkey/0.1/libclearkey.so"
remove "glxtest"
remove "fonts/TwemojiMozilla.ttf"
remove "firefox.sig"
remove "firefox-bin.sig"
remove "firefox-bin"
remove "firefox"
remove "dependentlibs.list"
remove "crashreporter"
remove "crashhelper"
remove "browser/omni.ja"
remove "browser/chrome/icons/default/default64.png"
remove "browser/chrome/icons/default/default48.png"
remove "browser/chrome/icons/default/default32.png"
remove "browser/chrome/icons/default/default16.png"
remove "browser/chrome/icons/default/default128.png"
remove "application.ini"
rmdir "icons/"
rmdir "gmp-clearkey/0.1/"
rmdir "gmp-clearkey/"
rmdir "fonts/"
rmdir "defaults/pref/"
rmdir "defaults/"
rmdir "browser/chrome/icons/default/"
rmdir "browser/chrome/icons/"
rmdir "browser/chrome/"
rmdir "browser/"

0
firefox/removed-files Normal file
View File

View File

@ -0,0 +1,5 @@
; If you modify this file updates may fail.
; Do not modify this file.
[Settings]
ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release

BIN
firefox/updater Executable file

Binary file not shown.

9
firefox/updater.ini Normal file
View File

@ -0,0 +1,9 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; This file is in the UTF-8 encoding
[Strings]
Title=Firefox Update
Info=Firefox is installing your updates and will start in a few moments…
MozillaMaintenanceDescription=The Mozilla Maintenance Service ensures that you have the latest and most secure version of Mozilla Firefox on your computer. Keeping Firefox up to date is very important for your online security, and Mozilla strongly recommends that you keep this service enabled.

BIN
firefox/vaapitest Executable file

Binary file not shown.

10
pom.xml
View File

@ -70,6 +70,16 @@
<target>17</target>
</configuration>
</plugin>
<!-- Exec Plugin to run Java main -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>com.ghost.temple.BrowserLauncher</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>

4
solo-level Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
/usr/bin/mvn exec:java

View File

@ -0,0 +1,113 @@
package com.ghost.temple;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.FirefoxProfile;
import java.io.File;
import java.util.Scanner;
public class BrowserLauncher {
private static WebDriver driver;
private static final String APP_URL = "http://192.168.31.73:3000/";
public static void main(String[] args) {
// IMPORTANT: Remove WebDriverManager setup here if you already manage drivers elsewhere
// WebDriverManager.firefoxdriver().setup(); // uncomment if you want dynamic driver management
String projectDir = System.getProperty("user.dir");
// Paths customize if your automation project has different structure
String firefoxBinaryPath = projectDir + "/firefox/firefox";
String profilePath = projectDir + "/.mozilla/firefox/b4xl9fej.default-release";
File firefoxBinary = new File(firefoxBinaryPath);
if (!firefoxBinary.exists() || !firefoxBinary.canExecute()) {
System.err.println("❌ Firefox binary missing or not executable at: " + firefoxBinaryPath);
System.exit(1);
}
File profileDir = new File(profilePath);
if (!profileDir.exists() || !profileDir.isDirectory()) {
System.err.println("❌ Firefox profile directory missing or invalid at: " + profilePath);
System.exit(1);
}
FirefoxProfile profile = new FirefoxProfile(profileDir);
FirefoxOptions options = new FirefoxOptions();
options.setBinary(new FirefoxBinary(firefoxBinary));
options.setProfile(profile);
driver = new FirefoxDriver(options);
driver.manage().window().maximize();
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
System.out.println("\n⚠ JVM Shutdown detected. Saving data before exit...");
saveAll();
}));
try {
StorageManager.loadStorage(driver, APP_URL);
CookieManager.loadCookies(driver, APP_URL);
System.out.println("🔥 Browser launched with persisted cookies and storage!");
Scanner scanner = new Scanner(System.in);
String input = "";
while (!input.equalsIgnoreCase("save")) {
speakPrompt("Please type save and press Enter to save your work before closing the browser.");
System.out.print("> ");
input = scanner.nextLine().trim();
if (!input.equalsIgnoreCase("save")) {
System.out.println("❌ You must save before quitting. Try again.");
}
}
Thread.sleep(500);
saveAll();
System.out.println("💾 Storage and cookies saved. Closing browser now...");
} catch (Exception e) {
e.printStackTrace();
} finally {
if (driver != null) {
driver.quit();
driver = null;
}
}
}
private static void speakPrompt(String message) {
System.out.println(message);
try {
ProcessBuilder pb = new ProcessBuilder("./festival-tts", message);
pb.redirectErrorStream(true);
Process process = pb.start();
try (var reader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()))) {
while (reader.readLine() != null) {}
}
process.waitFor();
} catch (Exception e) {
System.err.println("❌ Failed to run festival-tts:");
e.printStackTrace();
}
}
private static void saveAll() {
if (driver != null) {
CookieManager.saveCookies(driver);
StorageManager.saveStorage(driver);
}
}
}

View File

@ -4,6 +4,7 @@ import io.github.bonigarcia.wdm.WebDriverManager;
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;
public class DriverManager {
@ -13,17 +14,16 @@ public class DriverManager {
if (driver == null) {
WebDriverManager.firefoxdriver().setup();
// 🌟 Point to your existing Firefox profile
String userProfile = System.getProperty("user.home") + "/.mozilla/firefox/";
File profilesDir = new File(userProfile);
File[] profiles = profilesDir.listFiles((dir, name) -> name.endsWith(".default-release"));
// Path to Firefox binary
String firefoxBinaryPath = "/home/arul/solo-level-app-automation/firefox/firefox";
if (profiles == null || profiles.length == 0) {
throw new RuntimeException("No Firefox profile found 😭");
}
// Path to specific profile
String profilePath = "/home/arul/solo-level-app-automation/.mozilla/firefox/b4xl9fej.default-release";
FirefoxProfile profile = new FirefoxProfile(new File(profilePath));
FirefoxOptions options = new FirefoxOptions();
options.setProfile(new org.openqa.selenium.firefox.FirefoxProfile(profiles[0]));
options.setBinary(firefoxBinaryPath);
options.setProfile(profile);
driver = new FirefoxDriver(options);
driver.manage().window().maximize();

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,7 @@
com/ghost/temple/BrowserLauncher.class
com/ghost/temple/StorageManager.class
com/ghost/temple/driver/DriverManager.class
com/ghost/temple/CookieManager.class
com/ghost/temple/ExcelUtils.class
com/ghost/temple/hooks/Hooks.class
com/ghost/temple/ReusableFunctions.class

View File

@ -1,5 +1,6 @@
/home/arul/solo-level-app-automation/src/main/java/com/ghost/temple/StorageManager.java
/home/arul/solo-level-app-automation/src/main/java/com/ghost/temple/ExcelUtils.java
/home/arul/solo-level-app-automation/src/main/java/com/ghost/temple/BrowserLauncher.java
/home/arul/solo-level-app-automation/src/main/java/com/ghost/temple/driver/DriverManager.java
/home/arul/solo-level-app-automation/src/main/java/com/ghost/temple/hooks/Hooks.java
/home/arul/solo-level-app-automation/src/main/java/com/ghost/temple/CookieManager.java

View File

@ -1,3 +1,7 @@
com/ghost/temple/stepdefs/HomePageStepDefs.class
com/ghost/temple/pages/Quests.class
com/ghost/temple/BaseTest.class
com/ghost/temple/TestRunner.class
com/ghost/temple/AppTest.class
com/ghost/temple/pages/HomePage.class
com/ghost/temple/stepdefs/QuestsStepDefs.class

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="com.ghost.temple.AppTest" time="0" errors="0" skipped="0">
<testsuite tests="1" failures="0" name="com.ghost.temple.AppTest" time="0.001" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="17.0.15+6-Debian-1deb12u1"/>
@ -24,13 +24,13 @@
<property name="os.name" value="Linux"/>
<property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/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-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="maven.conf" value="/usr/share/maven/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="61.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="6.1.0-37-amd64"/>
<property name="os.version" value="6.5.0-0.deb12.4-amd64"/>
<property name="library.jansi.path" value="/usr/share/maven/lib/jansi-native"/>
<property name="user.home" value="/home/arul"/>
<property name="user.timezone" value="Asia/Kolkata"/>
@ -58,5 +58,5 @@
<property name="sun.cpu.endian" value="little"/>
<property name="sun.stdout.encoding" value="UTF-8"/>
</properties>
<testcase classname="com.ghost.temple.AppTest" name="basicTest" time="0"/>
<testcase classname="com.ghost.temple.AppTest" name="basicTest" time="0.001"/>
</testsuite>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="com.ghost.temple.TestRunner" time="81.58" errors="0" skipped="0">
<testsuite tests="1" failures="0" name="com.ghost.temple.TestRunner" time="66.838" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="17.0.15+6-Debian-1deb12u1"/>
@ -24,13 +24,13 @@
<property name="os.name" value="Linux"/>
<property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/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-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="maven.conf" value="/usr/share/maven/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="61.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="6.1.0-37-amd64"/>
<property name="os.version" value="6.5.0-0.deb12.4-amd64"/>
<property name="library.jansi.path" value="/usr/share/maven/lib/jansi-native"/>
<property name="user.home" value="/home/arul"/>
<property name="user.timezone" value="Asia/Kolkata"/>
@ -58,5 +58,5 @@
<property name="sun.cpu.endian" value="little"/>
<property name="sun.stdout.encoding" value="UTF-8"/>
</properties>
<testcase classname="Solo Leveling Quest Management" name="Open Solo Leveling page and click Add Quest" time="81.58"/>
<testcase classname="Solo Leveling Quest Management" name="Open Solo Leveling page and click Add Quest" time="66.838"/>
</testsuite>

View File

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

View File

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