sclevine / agouti

A WebDriver client and acceptance testing library for Go
MIT License
822 stars 105 forks source link

Documentation and examples for appium package #175

Open chordabmx opened 5 years ago

chordabmx commented 5 years ago

@abourget @sclevine Hello guys, first of all thanks for the great library! We are using agouti for Web automation and it works like a charm, so we've decided to use it for mobile automation as well. But unfortunately we've faced with same issue "failed to connect to WebDriver: failed to connect to WebDriver: failed to retrieve a session ID", Is there any sort of affordable documentation for appium package or get started example as for agouti? line causing error is : err = device.InstallApp( "./installed-release.apk") Code we are trying to run:


import (
    "fmt"
    . "github.com/onsi/ginkgo"
    . "github.com/onsi/gomega"
    "github.com/sclevine/agouti"
    ."github.com/sclevine/agouti/appium"

    "testing"
)

func TestAndroid(t *testing.T) {
    RegisterFailHandler(Fail)
    RunSpecs(t, "Android")
}

var options = Desired(agouti.Capabilities{
"platformName":    "Android",
"platformVersion": "7.0",
"deviceName":      "TECNO SPARK CM",
"Debug":           true,
"automationName": "UiAutomator2",

})
var wd = New(options)

var _ = BeforeSuite(func() {
    err := wd.Start()
    device, err := wd.NewDevice()
    if err != nil {
        fmt.Println(err)
    }
    err = device.InstallApp( "./installed-release.apk")
    err = device.LaunchApp()
    if err != nil {
        fmt.Println(err)
    }

})

var _ = AfterSuite(func() {
         err = device.CloseApp()
    Expect(wd.Stop()).To(Succeed())
})
chordabmx commented 5 years ago

@abourget @sclevine

polite bump

sclevine commented 5 years ago

@abourget contributed the appium integration and may be able to assist.

mpermperpisang commented 4 years ago

hi i also read this one https://github.com/sclevine/agouti/issues/72 this is my code and this is work https://gist.github.com/mpermperpisang/dca9c6b6611092e9b04da0b316fc5545

maybe you can try it :)