Skip to content

Commit

Permalink
Updating google colab link in readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
shriyanshagnihotri committed Nov 19, 2024
1 parent 559d644 commit f1c4ac6
Show file tree
Hide file tree
Showing 2 changed files with 234 additions and 44 deletions.
94 changes: 50 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,14 @@ Our mission? To **democratize and disrupt test automation**, making top-tier tes



## ⚡️ Features

Hercules is production ready, and packs a punch with features:

### Gherkin In, Results Out

Hercules makes testing as simple as Gherkin in, results out. Just feed your end-to-end tests in Gherkin format, and watch Hercules spring into action. It takes care of the heavy lifting by running your tests automatically and presenting results in a neat JUnit format. No manual steps, no fuss—just efficient, seamless testing.

### Free and Open Source

With Hercules, you're harnessing the power of open source with zero licensing fees. Feel free to dive into the code, contribute, or customize it to your heart's content. Hercules is as free as it is mighty, giving you the flexibility and control you need.

### Salesforce Ready

Built to handle the most intricate UIs, Hercules conquers Salesforce and other complex platforms with ease. Whether it's complicated DOM or running your SOQL or Apex, Hercules is ready and configurable.

### No Code Required

Say goodbye to complex scripts and elusive locators. Hercules is here to make your life easier with its no-code approach, taking care of the automation of Gherkin features so you can focus on what matters most—building quality software.

### Multilingual

With multilingual support right out of the box, Hercules is ready to work with teams across the globe. Built to bridge language gaps, it empowers diverse teams to collaborate effortlessly on a unified testing platform.

### Precisely Accurate

Hercules records video of the execution, and captures network logs as well, so that you dont have to deal with "It works on my computer".


### No Maintenance

Autonomous and adaptive, Hercules takes care of itself with auto-healing capabilities. Forget about tedious maintenance—Hercules adjusts to changes and stays focused on achieving your testing goals.

### UI Assertions

Grounded in the powerful foundations of TestZeus, Hercules tackles UI assertions with unwavering focus, ensuring that no assertion goes unchecked and no bug goes unnoticed. It's thorough, it's sharp, and it's ready for action.

### CI/CD Ready

Run Hercules locally or integrate it seamlessly into your CI/CD pipeline. Docker-native and one-command ready, Hercules fits smoothly into your deployment workflows, keeping testing quick, consistent, and hassle-free.

With Hercules, testing is no longer just a step in the process—it's a powerful, streamlined experience that brings quality to the forefront.

---

## ⚙️ Installation and Usage

Hercules offers multiple ways to get started, catering to different user preferences and requirements.

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1YiZsXem1POTwkcr17QqflXnihhuSqwM2?usp=sharing)
- **Note**: Colab might ask you to restart the session as python3.11 and some libs are installed during the installation of testzeus-hercules. Please restart the session if required and continue the execution.

### Approach 1: Using PyPI Package

#### Installation
Expand Down Expand Up @@ -378,6 +337,53 @@ To configure Hercules in detail:

---


## ⚡️ Features

Hercules is production ready, and packs a punch with features:

### Gherkin In, Results Out

Hercules makes testing as simple as Gherkin in, results out. Just feed your end-to-end tests in Gherkin format, and watch Hercules spring into action. It takes care of the heavy lifting by running your tests automatically and presenting results in a neat JUnit format. No manual steps, no fuss—just efficient, seamless testing.

### Free and Open Source

With Hercules, you're harnessing the power of open source with zero licensing fees. Feel free to dive into the code, contribute, or customize it to your heart's content. Hercules is as free as it is mighty, giving you the flexibility and control you need.

### Salesforce Ready

Built to handle the most intricate UIs, Hercules conquers Salesforce and other complex platforms with ease. Whether it's complicated DOM or running your SOQL or Apex, Hercules is ready and configurable.

### No Code Required

Say goodbye to complex scripts and elusive locators. Hercules is here to make your life easier with its no-code approach, taking care of the automation of Gherkin features so you can focus on what matters most—building quality software.

### Multilingual

With multilingual support right out of the box, Hercules is ready to work with teams across the globe. Built to bridge language gaps, it empowers diverse teams to collaborate effortlessly on a unified testing platform.

### Precisely Accurate

Hercules records video of the execution, and captures network logs as well, so that you dont have to deal with "It works on my computer".


### No Maintenance

Autonomous and adaptive, Hercules takes care of itself with auto-healing capabilities. Forget about tedious maintenance—Hercules adjusts to changes and stays focused on achieving your testing goals.

### UI Assertions

Grounded in the powerful foundations of TestZeus, Hercules tackles UI assertions with unwavering focus, ensuring that no assertion goes unchecked and no bug goes unnoticed. It's thorough, it's sharp, and it's ready for action.

### CI/CD Ready

Run Hercules locally or integrate it seamlessly into your CI/CD pipeline. Docker-native and one-command ready, Hercules fits smoothly into your deployment workflows, keeping testing quick, consistent, and hassle-free.

With Hercules, testing is no longer just a step in the process—it's a powerful, streamlined experience that brings quality to the forefront.

---


## 🦾 Architecture

### Multi-Agentic Solution
Expand Down
184 changes: 184 additions & 0 deletions statics/Testzeus_Hercules_Demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"source": [
"# checking python version, we need 3.11+\n",
"!python3.11 --version\n",
"!pip3 --version"
],
"metadata": {
"id": "xo0QI38L7QsF"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# install python3.11 and pip\n",
"!apt-get install python3.11 python3.11-distutils\n",
"!curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11"
],
"metadata": {
"id": "zly0aU8B7GdZ"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "rCp_mqGLvJPT"
},
"outputs": [],
"source": [
"# Install testzeus-hercules from PyPI\n",
"!pip3 install testzeus-hercules\n",
"\n",
"# Install Playwright and its dependencies\n",
"!pip3 install playwright\n",
"!playwright install --with-deps"
]
},
{
"cell_type": "code",
"source": [
"# Set the LLM model and API key\n",
"llm_model = \"gpt-4o\" # Replace with your model name\n",
"llm_model_api_key = \"sk-proj-.......\" # Replace with your API key"
],
"metadata": {
"id": "rbTNgolryUKC"
},
"execution_count": 2,
"outputs": []
},
{
"cell_type": "code",
"source": [
"import os\n",
"import tempfile\n",
"\n",
"# Create temporary directories for input, output, and test data\n",
"project_base = tempfile.mkdtemp(prefix=\"hercules_project_\")\n",
"input_dir = os.path.join(project_base, \"input\")\n",
"test_data_dir = os.path.join(project_base, \"test_data\")\n",
"output_dir = os.path.join(project_base, \"output\")\n",
"\n",
"os.makedirs(input_dir, exist_ok=True)\n",
"os.makedirs(output_dir, exist_ok=True)\n",
"os.makedirs(test_data_dir, exist_ok=True)\n",
"\n",
"# Create a sample Gherkin feature file\n",
"feature_content = \"\"\"\n",
"Feature: Open Google homepage\n",
"\n",
" Scenario: User opens Google homepage\n",
" Given I have a web browser open\n",
" When I navigate to \"https://www.google.com\"\n",
" Then I should see the Google homepage\n",
"\"\"\"\n",
"\n",
"feature_file_path = os.path.join(input_dir, \"test.feature\")\n",
"with open(feature_file_path, \"w\") as feature_file:\n",
" feature_file.write(feature_content)\n",
"\n",
"print(f\"Project base directory: {project_base}\")\n",
"print(f\"Feature file created at: {feature_file_path}\")\n"
],
"metadata": {
"id": "mGfEXUZSxpUe"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"with open(feature_file_path, \"r\") as fp:\n",
" print(fp.read())"
],
"metadata": {
"id": "NPO8NZvPxt9K"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"import subprocess\n",
"\n",
"# Define the command to run Hercules\n",
"command = \" \".join([\n",
" \"testzeus-hercules\",\n",
" \"--project-base\", project_base,\n",
" \"--llm-model\", llm_model,\n",
" \"--llm-model-api-key\", llm_model_api_key\n",
"])\n",
"try:\n",
" # Execute the command\n",
" result = subprocess.run(\n",
" command,\n",
" check=True,\n",
" env=dict(os.environ),\n",
" capture_output=True,\n",
" encoding=\"utf-8\",\n",
" text=True,\n",
" errors=\"replace\", shell=True\n",
" )\n",
"\n",
" # Display the output and errors, if any\n",
" print(\"Hercules execution output:\")\n",
" print(f\"Standard Output:\\n{result.stdout}\")\n",
" print(f\"Standard Error:\\n{result.stderr}\")\n",
" print(f\"Return Code: {result.returncode}\")\n",
"except subprocess.CalledProcessError as e:\n",
" print(e.returncode)\n",
" print(e.cmd)\n",
" print(e.output)\n",
" print(e.stderr)\n",
" print(e.stdout)"
],
"metadata": {
"id": "IOLKB9swxw2a"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"import os\n",
"\n",
"# List the contents of the output directory\n",
"print(\"Output directory contents:\")\n",
"print(\"The output is: \")\n",
"path = os.path.join(output_dir, \"test.feature_result.xml\")\n",
"with open(path, 'r') as fp:\n",
" print(fp.read())\n"
],
"metadata": {
"id": "CyaVaDtjxzdR"
},
"execution_count": null,
"outputs": []
}
]
}

0 comments on commit f1c4ac6

Please sign in to comment.