feat: add SetupDirPath() for summary

This commit is contained in:
lilong.129
2024-11-03 18:30:33 +08:00
parent 9915ddd11d
commit 0055e90e38
2 changed files with 12 additions and 5 deletions
+11 -4
View File
@@ -66,9 +66,17 @@ func (s *Summary) AddCaseSummary(caseSummary *TestCaseSummary) {
}
}
func (s *Summary) SetupDirPath() (path string, err error) {
dirPath := filepath.Join(s.rootDir, config.ResultsDir)
err = builtin.EnsureFolderExists(dirPath)
if err != nil {
return "", err
}
return dirPath, nil
}
func (s *Summary) GenHTMLReport() error {
reportsDir := filepath.Join(s.rootDir, config.ResultsDir)
err := builtin.EnsureFolderExists(reportsDir)
reportsDir, err := s.SetupDirPath()
if err != nil {
return err
}
@@ -97,8 +105,7 @@ func (s *Summary) GenHTMLReport() error {
}
func (s *Summary) GenSummary() (path string, err error) {
reportsDir := filepath.Join(s.rootDir, config.ResultsDir)
err = builtin.EnsureFolderExists(reportsDir)
reportsDir, err := s.SetupDirPath()
if err != nil {
return "", err
}