Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/wda connection #36

Merged
merged 3 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/bug------bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug 报告 | Bug report
about: Create a report to help us improve
title: "【Bug】"
labels: bug
assignees: ''

---

**在提出此issue时,我确认了以下几点(保存后请点击复选框):**

- [ ] 我已自己确认这是Sonic自身的Bug。
- [ ] 我接受此issue可能被关闭,并查看开发人员的建议。

**Bug 描述**
清晰地描述Bug的情况与详细复现步骤 | A clear and concise description of what the bug is.

**版本**
Sonic的版本号 | Sonic's Version.
部署的系统(mac,windows32...) | System

9 changes: 9 additions & 0 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**在提出此拉取请求时,我确认了以下几点(保存后请点击复选框):**

- [ ] 我已检查没有与此请求重复的拉取请求。
- [ ] 我已经考虑过,并确认这份呈件对其他人很有价值。
- [ ] 我接受此提交可能不会被使用,并根据维护人员的意愿关闭拉取请求。

**填写PR内容:**

-
29 changes: 21 additions & 8 deletions cmd/run/wda.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,26 @@ var wdaCmd = &cobra.Command{
shutWdaDown := make(chan os.Signal, syscall.SIGTERM)
signal.Notify(shutWdaDown, os.Interrupt, os.Kill)

go func() {
for s := range output {
fmt.Print(s)
if strings.Contains(s, "ServerURLHere->") {
fmt.Println("WebDriverAgent server start successful")
if !disableShowLog {
go func() {
for {
select {
case s, ok := <-output:
if ok {
fmt.Print(s)
if strings.Contains(s, "ServerURLHere->") {
fmt.Println("WebDriverAgent server start successful")
}
} else {
return
}
case <-shutWdaDown:
return
}
}
}
shutWdaDown <- os.Interrupt
}()
shutWdaDown <- os.Interrupt
}()
}

<-shutWdaDown
stopTest()
Expand All @@ -120,11 +131,13 @@ var (
serverLocalPort int
mjpegLocalPort int
disableMjpegProxy bool
disableShowLog bool
)

func initWda() {
runRootCMD.AddCommand(wdaCmd)
wdaCmd.Flags().BoolVarP(&disableMjpegProxy, "disable-mjpeg-proxy", "", false, "disable mjpeg-server proxy")
wdaCmd.Flags().BoolVarP(&disableShowLog, "disable-show-log", "", false, "disable print wda logs")
wdaCmd.Flags().StringVarP(&udid, "udid", "u", "", "device's serialNumber ( default first device )")
wdaCmd.Flags().StringVarP(&wdaBundleID, "bundleId", "b", "com.facebook.WebDriverAgentRunner.xctrunner", "WebDriverAgentRunner bundleId")
wdaCmd.Flags().IntVarP(&serverRemotePort, "server-remote-port", "", 8100, "WebDriverAgentRunner server remote port")
Expand Down