Files
httprunner/pkg/uixt/driver_screenshot_test.go
2025-02-11 18:13:49 +08:00

24 lines
519 B
Go

//go:build localtest
package uixt
import (
"path/filepath"
"testing"
"github.com/httprunner/httprunner/v5/internal/config"
"github.com/httprunner/httprunner/v5/pkg/uixt/option"
)
func TestGetScreenShot(t *testing.T) {
setupAndroidAdbDriver(t)
imagePath := filepath.Join(config.ScreenShotsPath, "test_screenshot")
_, err := driverExt.IDriver.ScreenShot(option.WithScreenShotFileName(imagePath))
if err != nil {
t.Fatalf("GetScreenShot failed: %v", err)
}
t.Logf("screenshot saved at: %s", imagePath)
}