Create Project
Overview
WebRunner can generate a quick-start project structure with sample files, including example JSON keyword files and Python executor scripts.
Usage
from je_web_runner import create_project_dir
# Create on current working directory
create_project_dir()
# Create at a specific path
create_project_dir(project_path="./my_project")
# Create with a custom parent name
create_project_dir(project_path="./my_project", parent_name="MyTest")
CLI Method
python -m je_web_runner --create_project ./my_project
Generated Structure
my_project/WebRunner/
├── keyword/
│ ├── keyword1.json # Sample action file (success case)
│ ├── keyword2.json # Sample action file (success case)
│ └── bad_keyword_1.json # Sample action file (failure case)
└── executor/
├── executor_one_file.py # Execute a single JSON file
├── executor_folder.py # Execute all JSON files in a folder
└── executor_bad_file.py # Execute failure case file
Template Details
keyword1.json / keyword2.json: Sample action lists that demonstrate correct usage of WebRunner commands (launching a browser, navigating, quitting).
bad_keyword_1.json: An intentionally broken action list to demonstrate error handling.
executor_one_file.py: Reads and executes a single keyword JSON file using
execute_action(read_action_json(path)).
executor_folder.py: Uses execute_files(get_dir_files_as_list(path)) to
execute all .json files in the keyword/ directory.
executor_bad_file.py: Executes the bad keyword file to demonstrate how errors are captured and reported.
Parameters
Parameter |
Default |
Description |
|---|---|---|
|
Current working directory |
Path where the project will be created |
|
|
Name of the top-level project directory |