Scheduled Execution

CukeTest does not currently provide a built-in scheduled task function, but you can use the system's scheduled task tools to execute CukeTest Commands. Use "Task Scheduler" in Windows and "cron" in Linux.

Windows Operating System

Using Task Scheduler

  1. Open "Task Scheduler", which can be found by typing "Task Scheduler" in the Windows search box.
  2. In the Task Scheduler window, click "Create Basic Task".
  3. In the wizard, enter the name and description of the task, then click "Next".
  4. Select the task trigger frequency, which can be "Daily", "Weekly", "Monthly" or "One time", then click "Next".
  5. Enter the time and date for the task to start, then click "Next".
  6. Select "Start a program" as the task action type, then click "Next".
  7. In the "Program/script" field, select the CukeTest executable file (default is C:\Program Files\LeanPro\CukeTest\Cuke.exe). If you want to execute a project located at C:/your/project/path/, enter run in the "Add arguments" field, and select the path C:/your/project/path/ in the "Start in" field.
  8. Click "Finish" to complete the setting of the scheduled task.

Linux Operating System

Using Cron

Cron is a commonly used scheduled task tool in Linux systems.

  1. Open a terminal.
  2. Enter the command crontab -e to edit scheduled tasks. If it is your first time using it, you may need to select an editor; simply press Enter to use the default nano editor.
  3. In the opened text editor, add the scheduled task in the following format:
# Minute Hour Day Month Week Command
* * * * * cd /your/project/path && DISPLAY=:0 cuketest run

DISPLAY=:0 is to ensure that cron uses the graphical interface environment when executing the command, which CukeTest requires. Usually, :0 represents the default desktop environment. If it is a multi-user environment, you can run echo $DISPLAY in the current environment to get the current value and replace :0 in the cron command. Alternatively, run the project in headless mode, refer to Command Line Description --headless for details.

The above example means executing the command every minute. You can adjust the time interval and command as needed. For example, the following command means executing at 5:30 every day:

# Minute Hour Day Month Week Command
30 5 * * * cd /your/project/path && DISPLAY=:0 cuketest run

After editing, press Ctrl+X, then press Y to save changes.