append options in post data for extra WDA configurations#15
Open
debugtalk wants to merge 13 commits intoelectricbubble:masterfrom
Open
append options in post data for extra WDA configurations#15debugtalk wants to merge 13 commits intoelectricbubble:masterfrom
debugtalk wants to merge 13 commits intoelectricbubble:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
在体验评测中,我们需要精确度量出某些操作的耗时,例如点击启动抖音到开始播放视频的耗时(首帧)。
在 iOS 系统中,不存在类似 Android debug 模式,因此要识别操作的起始点就十分困难。为了解决该问题,可以在 WDA 中加入打点日志,针对关键的 UI 操作记录其时间戳和步骤标识(identifier),然后就可以记录得到关键步骤的起始点时间。
对应地,在 gwda 中调用 WDA 时,需要传入额外的控制参数,例如 开启日志、指定步骤标识(identifier)等。
核心修改
1、新增
DataOption,用于对请求 WDA 的 post data 进行修改:duration字段,适用于 Drag、DragFloatfrequency字段,适用于 SendKeys2、WebDriver 的方法签名调整:
pressForDuration ...float64替换为options ...DataOptionfrequency ...int替换为options ...DataOption替换可选参数的原因是可选参数可能需要传入多个。
3、调用
debugLog时,避免打印screenshot的响应内容