mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 08:49:37 +08:00
refactor: move hrp/ to root folder
This commit is contained in:
38
internal/config/config.go
Normal file
38
internal/config/config.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
ResultsDirName = "results"
|
||||
ScreenshotsDirName = "screenshots"
|
||||
ActionLogDireName = "action_log"
|
||||
)
|
||||
|
||||
var (
|
||||
RootDir string
|
||||
ResultsDir string
|
||||
ResultsPath string
|
||||
ScreenShotsPath string
|
||||
StartTime = time.Now()
|
||||
StartTimeStr = StartTime.Format("20060102150405")
|
||||
ActionLogFilePath string
|
||||
DeviceActionLogFilePath string
|
||||
)
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
RootDir, err = os.Getwd()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
ResultsDir = filepath.Join(ResultsDirName, StartTimeStr)
|
||||
ResultsPath = filepath.Join(RootDir, ResultsDir)
|
||||
ScreenShotsPath = filepath.Join(ResultsPath, ScreenshotsDirName)
|
||||
ActionLogFilePath = filepath.Join(ResultsDir, ActionLogDireName)
|
||||
DeviceActionLogFilePath = "/sdcard/Android/data/io.appium.uiautomator2.server/files/hodor"
|
||||
}
|
||||
Reference in New Issue
Block a user