forked from bunsenapp/go-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
heraclmene
committed
Dec 22, 2016
1 parent
7625254
commit 5582b29
Showing
4 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package integrationtests | ||
|
||
import "testing" | ||
|
||
func Test_CookieCookie_CanRetrieveCookieFromWebPage(t *testing.T) { | ||
setUp() | ||
defer tearDown() | ||
|
||
driver := createDriver(t) | ||
_, err := driver.CreateSession() | ||
if err != nil { | ||
errorAndWrap(t, "Error thrown whilst trying to create session.", err) | ||
} | ||
|
||
_, err = driver.Go("https://news.ycombinator.com") | ||
if err != nil { | ||
errorAndWrap(t, "Error was thrown whilst navigating or result was not a success.", err) | ||
} | ||
|
||
resp, err := driver.Cookie("__cfduid") | ||
if err != nil || resp.State != "success" || resp.Cookie.Name == "" { | ||
errorAndWrap(t, "Error was thrown whilst retrieving cookie", err) | ||
} | ||
|
||
printObjectResult(resp) | ||
} |
This file contains 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