intimate/tasks/twitch/twitch_task1/task_twitch_test.go

32 lines
681 B
Go
Raw Normal View History

2020-07-22 12:00:02 +00:00
package main
import (
"fmt"
"testing"
"github.com/tebeka/selenium"
"github.com/tebeka/selenium/chrome"
)
func TestCase1(t *testing.T) {
caps := selenium.Capabilities{"browserName": "chrome"}
chromecaps := chrome.Capabilities{}
err := chromecaps.AddExtension("/home/eson/test/ssh-key/0.1.2_0.crx")
if err != nil {
panic(err)
}
caps.AddChrome(chromecaps)
_, err = selenium.NewChromeDriverService("/usr/bin/chromedriver", 3030)
if err != nil {
panic(err)
}
wd, err := selenium.NewRemote(caps, fmt.Sprintf("http://localhost:%d/wd/hub", 3030))
if err != nil {
panic(err)
}
err = wd.Get("https://www.twitch.tv/directory/all")
if err != nil {
panic(err)
}
}