Files
xiaohongshu-mcp/xiaohongshu/publish_test.go
zy 86224dcaa3 update find content element (#10)
- Updated the getContentElement function to utilize the Race method for improved efficiency in finding content elements.
- Added error handling for cases where no elements are found, ensuring better logging and debugging capabilities.
2025-08-13 02:34:50 +08:00

33 lines
605 B
Go

package xiaohongshu
import (
"context"
"testing"
"github.com/xpzouying/xiaohongshu-mcp/browser"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPublish(t *testing.T) {
t.Skip("SKIP: 测试发布")
_ = browser.Init(false)
defer browser.Close()
page := browser.NewPage()
defer page.Close()
action, err := NewPublishImageAction(page)
require.NoError(t, err)
err = action.Publish(context.Background(), PublishImageContent{
Title: "Hello World",
Content: "Hello World",
ImagePaths: []string{"/tmp/1.jpg"},
})
assert.NoError(t, err)
}