Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
no need to have ()=> when you are using the logInToGUPage
Browse files Browse the repository at this point in the history
  • Loading branch information
johnduffell committed Jul 18, 2014
1 parent f50fda3 commit d8493a8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
11 changes: 5 additions & 6 deletions README.md
@@ -1,13 +1,12 @@
web-automation-core-scala-api
scala-automation-web-signin
-----------------------------
To use this just edit your build.sbt as follows:

libraryDependencies ++= Seq(
"com.gu" %% "web-automation-core-scala-api" % "1.0-SNAPSHOT"
"com.gu" %% "scala-automation-web-signin" % "1.xxx"
)

AuthApi
-------
From your code, you can import com.gu.automation.api.AuthApi and then do something like
Add something to your conf file e.g. for CODE
"idApiRoot" : "https://idapi.code.dev-theguardian.com"

val future = AuthApi.authenticate(email, password)
See the example code in LoggingInTest
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -19,7 +19,7 @@ resolvers ++= Seq(
libraryDependencies ++= Seq(
//"org.scalatest" % "scalatest_2.10" % "2.0",
//"com.typesafe.play" %% "play-ws" % "2.3.0"
"com.gu" %% "scala-automation" % "1.0",
"com.gu" %% "scala-automation" % "1.16",
"com.gu" %% "scala-automation-api-client" % "1.0"
)

Expand Down
Expand Up @@ -25,10 +25,10 @@ trait LoggingIn {
}
}

def logInToGUPage[P](goto: () => P, user: Option[String] = None)(implicit driver: WebDriver): P = {
goto()
def logInToGUPage[P](goto: => P, user: Option[String] = None)(implicit driver: WebDriver): P = {
goto
addGULoginCookies(user)
goto()
goto
}

}
1 change: 1 addition & 0 deletions src/test/resources/project.conf
@@ -0,0 +1 @@
"idApiRoot" : "https://idapi.code.dev-theguardian.com"
12 changes: 12 additions & 0 deletions src/test/scala/com/gu/automation/signin/LoggingInTest.scala
@@ -0,0 +1,12 @@
package com.gu.automation.signin

import com.gu.automation.support.LoggingIn
import org.scalatest.FlatSpec

class LoggingInTest extends FlatSpec with LoggingIn {

"loggingIn" should "compile the example code" in {
// logInToGUPage(ExamplePage.goto(), Some("user"))
}

}

0 comments on commit d8493a8

Please sign in to comment.