diff --git a/testing_api.go b/testing_api.go index f91de7b..13093c1 100644 --- a/testing_api.go +++ b/testing_api.go @@ -61,6 +61,16 @@ func (a *Api) WithSession(s Map) *Api { } } +// AtPath 返回指向其它 API 路径的 Api(跨接口断言时用) +func (a *Api) AtPath(path string) *Api { + return &Api{ + app: a.app, + path: path, + t: a.t, + session: a.session, + } +} + // JSON 设置 JSON body,返回 ApiCase 构建器 func (a *Api) JSON(body interface{}) *ApiCase { c := a.newCase()