From fd8e38092b5f30ce5f57d37b6c0fa89acf1525e2 Mon Sep 17 00:00:00 2001 From: Niha-007 Date: Fri, 24 Jan 2025 15:35:39 +0100 Subject: [PATCH 1/3] Update README.md --- README.md | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 121 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0b74275..1345678 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,121 @@ -# askui-java -Calling askui scripts from java +# AskUI Java Integration + +This repository demonstrates how to integrate AskUI automation testing with Java, allowing you to run AskUI TypeScript tests from a Java environment. + +## 🚀 Features + +- Run AskUI automation tests from Java +- Environment configuration management +- Custom test runner implementation +- Sample login automation test + +## 📋 Prerequisites + +- Java JDK 11 or higher +- Node.js and npm +- Visual Studio Code +- Chrome browser +- AskUI account and credentials (workspace ID and token) + +## 🛠️ Installation + +1. **Clone the repository** + ```bash + git clone + cd askui-java-integration + ``` + +2. **Install Node.js dependencies** + ```bash + npm install askui @askui/jest-allure-circus ts-jest @types/jest + ``` + +3. **Set up AskUI configuration** + - Create `.askui/Settings` directory in your project root + - Create `AskuiEnvironmentSettings.json` with your credentials + - Update environment variables in `AskUIJavaRunner.java`: + - `ASKUI_TOKEN` + - `ASKUI_WORKSPACE_ID` + +## 📁 Project Structure + + +## 🔧 Configuration Files + +### AskUI Helper (askui-helper.ts) +```typescript +// Configuration for AskUI controller and client +// See helpers/askui-helper.ts in repository +``` + +### Jest Configuration (jest.config.ts) +```typescript +// Test runner configuration +// See jest.config.ts in repository +``` + +## 📝 Sample Test + +The repository includes a sample test that demonstrates logging into a website: + +```typescript +// See sample.test.ts in repository +``` + +## 🚀 Running Tests + +1. **Compile the Java runner** + ```bash + javac -d target src/AskUIJavaRunner.java + ``` + +2. **Execute tests** + ```bash + java -cp target AskUIJavaRunner + ``` + +## ⚙️ Customization + +### Modifying Test Path +Update the `projectRoot` path in `AskUIJavaRunner.java` to match your project structure: + +```java +Path projectRoot = Paths.get("YOUR_PROJECT_PATH"); +``` + +### Updating AskUI Settings +Modify the `askuiSettingsPath` in `AskUIJavaRunner.java`: + +```java +Path askuiSettingsPath = Paths.get("PATH_TO_ASKUI_SETTINGS"); +``` + +## ⚠️ Important Notes + +- Ensure all environment variables are properly set before running tests +- The Chrome browser must be installed for web automation tests +- Keep your AskUI credentials secure and never commit them to version control +- Make sure the paths in `AskUIJavaRunner.java` match your local setup + +## 🆘 Troubleshooting + +Common issues and solutions: + +1. **Java Path Issues** + - Ensure JAVA_HOME is properly set + - Verify Java version compatibility + +2. **Node.js Dependencies** + - Run `npm install` to ensure all dependencies are installed + - Check for any conflicting package versions + +3. **AskUI Connection Issues** + - Verify your workspace ID and token + - Check network connectivity + - Ensure the AskUI controller is running + +## 📚 Additional Resources + +- [AskUI Documentation](https://docs.askui.com/) +- [Jest Documentation](https://jestjs.io/docs/getting-started) +- [TypeScript Documentation](https://www.typescriptlang.org/docs/) From 846a8117895fe373800e6643bde4777105497479 Mon Sep 17 00:00:00 2001 From: Niha-007 Date: Fri, 24 Jan 2025 15:45:53 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1345678..67ce0ed 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,20 @@ This repository demonstrates how to integrate AskUI automation testing with Java ## 📁 Project Structure - -## 🔧 Configuration Files +java_askui/ +├── .vscode/ +├── src/ +│ └── AskUIJavaRunner.java # Main Java source file +├── lib/ +├── bin/ +├── target/ # Generated by javac command +│ └── AskUIJavaRunner.class # Compiled Java class file +├── settings.json +└── README.md + +## 🔧 Configuration Files in askui project + +- Make sure you change the following ts files in your askui repository ( that you have created by installing askui and wrote a sample.test.ts file) ### AskUI Helper (askui-helper.ts) ```typescript From d52d7e190a60236c5c8bd5f59aebbbfafb4dee90 Mon Sep 17 00:00:00 2001 From: Niha-007 Date: Fri, 24 Jan 2025 16:12:49 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 67ce0ed..1911251 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,6 @@ java_askui/ ├── .vscode/ ├── src/ │ └── AskUIJavaRunner.java # Main Java source file -├── lib/ -├── bin/ ├── target/ # Generated by javac command │ └── AskUIJavaRunner.class # Compiled Java class file ├── settings.json