mkorpela / pabot

Parallel executor for Robot Framework test cases.
https://pabot.org
Apache License 2.0
462 stars 151 forks source link

reports error when robot case section headers use other languages #585

Open heyinling opened 3 weeks ago

heyinling commented 3 weeks ago

since RF 6.0 it supports localization of section headers. For example, I'm writing my case file in Chinese:

*** 设置 ***    # Settings
资源文件    aa.resource

*** 用例 ***    # Test Cases
CASE_00001
    Sleep    5s

I'm using pabot to execute the suite, with arg --language zh-CN. It still reports error invalid section headers:

[ ERROR ] Error in file 'example.robot' on line 1: Unrecognized section header '*** 设置 ***'. Valid sections: 'Settings', 'Variables', 'Test Cases', 'Tasks', 'Keywords' and 'Comments'.

In pabot.py function generate_suite_names_with_builder, when calling TestSuiteBuilder, it didn't pass arg lang even language arg is set in command line. After passing language to TestSuiteBuilder it works as expected:

builder = TestSuiteBuilder(
    included_extensions=settings.extension, rpa=settings.rpa, lang=opts["language"]
)

Hope it can be fixed in next release.

heyinling commented 3 weeks ago

Have created a PR: https://github.com/mkorpela/pabot/pull/586