extent-framework / extentreports-csharp

Extent Reporting Library, .NET
http://extentreports.com
Apache License 2.0
50 stars 39 forks source link

How to generate report file with Japanese SpecFlow keyword (Given, when, then, ...) #205

Open duy123a opened 10 months ago

duy123a commented 10 months ago

I try to generate a Japanese report but no idea how to do that

What I haved tried

I am using .NET 8 with SpecFlow The feature file is Japanese (followed this keyword https://github.com/cucumber/gherkin/blob/main/gherkin-languages.json)

var sparkReporter = new ExtentSparkReporter(...) _extentReports = new ExtentReports(); _extentReports.GherkinDialect = "ja"; _extentReports.AttachReporter(sparkReporter);

...

_feature = _extentReports.CreateTest( new GherkinKeyword(Feature.Name.MapToLocaleKeyword()), // change "Feature" to "フィーチャ" FeatureContext.FeatureInfo.Title, string.Empty);

...

_extentReports.Flush();

But the report file still have SpecFlow keyword as English

Can you help me about that. Thanks

namilkimfree commented 7 months ago

@duy123a Hi, I checked it in the mater branch, but it is displayed normally in Japanese.

master branch

5.0.3-beta
  _path = DateTime.Now.Millisecond + FileName;

  _extent = new ExtentReports();
  _spark = new ExtentSparkReporter(_path);

  _spark.Config.Theme = AventStack.ExtentReports.Reporter.Config.Theme.Dark;
  _extent.GherkinDialect = "ja";

  _extent.AttachReporter( _spark);

_extent.CreateTest(new GherkinKeyword("フィーチャ"), // change "Feature" to "フィーチャ"
"フィーチャ  ",
 string.Empty);
_extent.Flush();

image