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
- Open "Task Scheduler", which can be found by typing "Task Scheduler" in the Windows search box.
- In the Task Scheduler window, click "Create Basic Task".
- In the wizard, enter the name and description of the task, then click "Next".
- Select the task trigger frequency, which can be "Daily", "Weekly", "Monthly" or "One time", then click "Next".
- Enter the time and date for the task to start, then click "Next".
- Select "Start a program" as the task action type, then click "Next".
- 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 atC:/your/project/path/, enterrunin the "Add arguments" field, and select the pathC:/your/project/path/in the "Start in" field. - 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.
- Open a terminal.
- Enter the command
crontab -eto 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. - 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=:0is to ensure that cron uses the graphical interface environment when executing the command, which CukeTest requires. Usually,:0represents the default desktop environment. If it is a multi-user environment, you can runecho $DISPLAYin the current environment to get the current value and replace:0in the cron command. Alternatively, run the project in headless mode, refer to Command Line Description--headlessfor 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.