mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 11:29:48 +08:00
fix: EventTracking ev field type
This commit is contained in:
@@ -8,6 +8,7 @@ func TestSendEvents(t *testing.T) {
|
||||
event := EventTracking{
|
||||
Category: "unittest",
|
||||
Action: "SendEvents",
|
||||
Value: "123",
|
||||
}
|
||||
err := gaClient.SendEvent(event)
|
||||
if err != nil {
|
||||
@@ -20,9 +21,10 @@ func TestStructToUrlValues(t *testing.T) {
|
||||
Category: "unittest",
|
||||
Action: "convert",
|
||||
Label: "StructToUrlValues",
|
||||
Value: "123",
|
||||
}
|
||||
val := structToUrlValues(event)
|
||||
if val.Encode() != "ea=convert&ec=unittest&el=StructToUrlValues" {
|
||||
if val.Encode() != "ea=convert&ec=unittest&el=StructToUrlValues&ev=123" {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type EventTracking struct {
|
||||
Category string `form:"ec"` // Required. Event Category.
|
||||
Action string `form:"ea"` // Required. Event Action.
|
||||
Label string `form:"el"` // Optional. Event label
|
||||
Value int `form:"ev"` // Optional. Event value
|
||||
Value string `form:"ev"` // Optional. Event value, must be digits, "123"
|
||||
}
|
||||
|
||||
func (e EventTracking) StartTiming(variable string) UserTimingTracking {
|
||||
|
||||
Reference in New Issue
Block a user