Skip to content

Commit

Permalink
Merge pull request #36 from SonicCloudOrg/fix/wda_connection
Browse files Browse the repository at this point in the history
Fix/wda connection
  • Loading branch information
ZhouYixun committed Sep 3, 2022
2 parents 9cb559e + 716fed8 commit d82c004
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
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

0 comments on commit d82c004

Please sign in to comment.