Giter Site home page Giter Site logo

jimsung / gobot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pojol/gobot

0.0 0.0 0.0 14.7 MB

Universal game server testing bot; 通用游戏服务器测试机器人

License: MIT License

Shell 0.41% JavaScript 2.48% Lua 3.69% Go 48.60% TypeScript 41.78% CSS 2.76% HTML 0.09% Dockerfile 0.20%

gobot's Introduction

gobot

Gobot is a powerful stateful API testing robot. It provides a graphical interface for building test scenarios, allows for easy test script writing, step-by-step debugging and pressure testing, and can share and store states between each stage of the testing process.

Go Report Card CI

中文

Quick Installation

Note: Enable local running mode. All changes are recorded in memory (not saved permanently). If you need to save, download the files to your local machine or use the formal deployment method.

  • windows
  1. Go to the release page and download the executable program.
  2. Run the server by executing the run.bat file in the gobot_driver_win_x64_v0.3.8 directory.
    • Run the editor program by executing gobot.ext in the gobot_editor_win_x64_v0.3.8 directory.
  3. Fill in the address input window that pops up or the address bar on the config page with http://127.0.0.1:8888, the local server address.
  4. Switch to the bots panel in the editor, and drag in the two test cases, http_sample.txt and tcp_sample.txt.
  5. Select a test case, click load to load the robot into the editing interface.
    • Click the debug (spider) button below to debug (create a new debugging robot).
    • Click the adjacent run button to execute step by step (run behavior tree nodes).
    • Click on any node in the editor to view its settings.
    • The Meta panel displays all data of the robot.
    • Response displays the return values of each node.
    • RuntimeErr displays any error messages encountered during node execution (automatically switches to it).

Feature

  • Utilizes the 'behavior tree' to control the robot's execution order and uses 'scripts' for specific node behaviors, such as making HTTP requests.
  • Provides graphical editing and debugging capabilities.
  • Allows creating and reusing 'prefab' template nodes in the configuration page.
  • Supports driving via HTTP API (post /bot.run -d '{"Name":"a robot"}'), making it easy to integrate into CI.
  • Supports multiple protocol formats (HTTP, TCP, WebSocket...) and supports pack/unpack of byte streams at the script layer
  • Offers 'stress testing' with configurable concurrency settings on the configuration page.

NodeScript

Through built-in modules and scripts, we can have rich logical expression capabilities. We can also use global (single bot) meta structures to maintain various state changes of the bot.

--[[
    Each node has its own independent .lua script for execution. When a node is executed, the script is loaded and run using dostring.
    Users can load desired 'modules' into the script for additional functionalities. For more information, refer to the documentation.
    The script allows defining node execution logic, like sending an HTTP request.
]]--

-- Users can load "modules" they want to use in the script.
-- document https://pojol.gitee.io/gobot/#/zh-cn/script/meta
local http = require("http")

-- request body
req = {
    body = {},       -- post body
    timeout = "10s", -- http timeout  
    headers = {},    -- http headers
}

-- When the robot runs to a node, the execute function will be executed.
function execute()

    -- Here, users can define the execution logic of nodes themselves (for example, sending an HTTP request)
    res, err = http.post("url", req)

    -- todo

    --  state - State code
    --  res - Information displayed in the Response panel
    return state.Succ, res
end

Script Module

Module interface Description
base64 encode decode Provides base64 encoding/decoding functionality.
http post get put Support HTTP connection.
tcp dail close write read Support TCP connection.
protobuf marshal unmarshal Provides Protobuf operations.
mongoDB insert find update delete ... Provides MongoDB operations.
json encode decode Offers JSON functionalities.
md5 sum Calculates MD5 hashes.
utils uuid random Generates random values, UUIDs.
... More modules available.

Try it out

Try the editor out on website driver server address http://43.134.38.169:8888

Preview

image.png

gobot's People

Contributors

pojol avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.