https://github.com/katalon-studio/katalon-agent
  
  
     
    https://github.com/katalon-studio/katalon-agent
  
critical katalon-testops
        Last synced: 7 months ago 
        JSON representation
    
- Host: GitHub
 - URL: https://github.com/katalon-studio/katalon-agent
 - Owner: katalon-studio
 - Created: 2019-04-19T08:17:57.000Z (over 6 years ago)
 - Default Branch: master
 - Last Pushed: 2024-10-31T15:42:05.000Z (about 1 year ago)
 - Last Synced: 2025-03-24T11:21:29.578Z (7 months ago)
 - Topics: critical, katalon-testops
 - Language: JavaScript
 - Homepage:
 - Size: 15 MB
 - Stars: 7
 - Watchers: 7
 - Forks: 6
 - Open Issues: 1
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
README
          # Katalon TestOps Agent
## Build Katalon Agent docker image
Run the following command with the version to build the image
```
./buid-image.sh 1.7.6
```
## Start the Katalon Agent
### Prerequisites
- Node.js >= 10.x
- Run the `npm install` command in the Katalon Agent's root directory to install the dependencies
### Configuration
- Create the `agentconfig` file in the Katalon Agent's root directory and configure it:
```ini
agentName=My Agent
email=
apikey=
serverUrl=https://analytics.katalon.com/
organizationId=
```
- Supported options:
| Mandatory Option | Description |
|------------------|-------------|
| agentName | The name of the Katalon Agent displayed on the Katalon TestOps CI page. It should be human-readable and distinguishable among multiple agents. |
| email     | The email of the Katalon account used to log into the Katalon TestOps. |
| apikey    | The API Key used to log into the Katalon TestOps. The API key can be generated and retrieved from [here](https://analytics.katalon.com/user/apikey). For more info read the [docs](https://docs.katalon.com/katalon-analytics/docs/ka-api-key.html#katalon-api-keys-usage). |
| serverUrl | The Katalon TestOps' URL. |
| organizationId    | The ID of the Katalon TestOps organization to integrate the Katalon Agent into. The agent is shared among members and projects within an organization that the agent linked to. |
| uuid      | The ID used to identify the agent. It is generated by the Katalon Agent on the first run and should not be specified manually or modified for any reason. |
| Optional Option | Description |
|-----------------|-------------|
| xvfbRun    | Xvfb-run supported options. Linux only. E.g. `xvfbRun=-a -n 0 -s "-screen 0 1024x768x24"` |
| x11Display | x11 DISPLAY environment variable. Linux only. E.g. `x11Display=:0.0` |
| proxy      | The proxy server. E.g. `proxy=http://localhost:3000` |
| proxyExcludedUrls | E.g. `proxyExcludedUrls=testops.katalon.io` |
| logLevel   | The logging level (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF). Default: `INFO`. |
| keepFiles  | Whether to keep the test project's temporary files. Default: `false`. |
### Start the Katalon Agent with Node from CLI
- Navigate to the Katalon Agent directory
- Run the `npm start` or `node cli.js start-agent` command to start the agent.
### Start the Katalon Agent with the packaged executable from CLI
- Download the suitable package from the Katalon Agent [Releases](https://github.com/katalon-studio/katalon-agent/releases).
- Extract the downloaded package.
- Depending on the platform a start script can be found inside the extracted directory, 
  - `start.bat` on Windows 
  - `start.sh` on Linux and MacOS.
- Open your CLI and execute the start script.
Note: On Linux and MacOS, you might need to add execute permission (`chmode u+x `) to the following files, if present:
- `cli-linux-x64`
- `cli-macos-x64`
- `start.sh`
- `service.sh`
## Package the Katalon Agent
- Checkout the code
- Make sure the dependencies in the `package.json` is installed and up-to-date by running `npm install` command
- Run `npm run build` command
- The build artifacts are available inside the `bin` directory.
## Generate the configuration file
- The `agentconfig` file can be generated or updated by running `config` command with additional arguments.
- E.g. `node cli.js config --server-url https://analytics.katalon.com --username  --apikey  --organizationid  --agent-name my-agent`
- If an `agentconfig` has been created, the existing configuration will be overridden with the new value.
- Show the usage of the `config` command with `-h` option. E.g. `node cli.js config -h`.
## Run the Katalon Agent as a service
- Download the suitable package from the Katalon Agent [Releases](https://github.com/katalon-studio/katalon-agent/releases).
- Extract the downloaded package.
- Depending on the platform a script can be found inside the extracted directory, 
  - `service.bat` on Windows 
  - `service.sh` on Linux and MacOS.
- Open your CLI and execute the script.
## Develop the Katalon Agent
### Debug with IntelliJ IDEA
- Checkout the code
- Open the Katalon Agent's directory with Intellij IDEA
- `Run --> Edit Configurations... -> + (Add New Configuration) --> 'npm'`
- Set the following values:
  - package.json: The location of the package.json in Katalon Agent's directory
  - Command: Select `start`
  - Node interpreter: Select your Node.js location
  - Package manager: Select your npm location
  - Environment: Input `NODE_ENV=debug`
- Click OK
- Choose the configuration and start debugging
### Debug with Visual Studio Code
- Checkout the code
- Open the Katalon Agent's directory with Visual Studio Code
- Select the Run icon in the Activity Bar on the side of VS Code
- Configure the `launch.json` file following the [guide](https://code.visualstudio.com/docs/editor/debugging#_start-debugging)
- Add the following configuration to the `launch.json` file:
```json5
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Start Agent",
            "skipFiles": [
              "/**"
            ],
            "program": "${workspaceFolder}\\cli.js",
            "args": [
              "start-agent"
            ],
            "env": {
              "NODE_ENV": "debug"
            },
            "console": "integratedTerminal"
        }
    ]
}
```
- In Run view, select `Start Agent` launch configuration and start debugging