Skip to content

Instantly share code, notes, and snippets.

@MasseGuillaume
Created October 22, 2012 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasseGuillaume/3934188 to your computer and use it in GitHub Desktop.
Save MasseGuillaume/3934188 to your computer and use it in GitHub Desktop.
package ca.polymtl.log4420
package test
package systeme
import org.scalatest._
import matchers.ShouldMatchers
import selenium.{WebBrowser, Chrome}
@EquipeDeQuatre
class AfficherUaTest
extends JettySpec with ShouldMatchers with WebBrowser
{
describe( "[H] Calculer et Afficher les UA[][]" )
{
it("")
{
go to ( host + "cheminement" )
}
}
}
package ca.polymtl.log4420
package test.systeme
import org.scalatest._
import org.eclipse.jetty._
import selenium.Chrome
import server.Server
import server.nio.SelectChannelConnector
import webapp.WebAppContext
import org.openqa.selenium.WebDriver
import java.util.concurrent.TimeUnit
// based on https://www.assembla.com/spaces/liftweb/wiki/Testing_With_Selenium
trait JettySpec extends FunSpec with BeforeAndAfterEach with Chrome
{
private var server: Server = null
private val PORT = 8080
protected val host = "http://localhost:" + PORT + "/"
override def beforeEach()
{
server = new Server( PORT )
val context = new WebAppContext()
context.setServer(server)
context.setContextPath("/")
context.setWar("src/main/webapp")
server.setHandler(context)
server.start()
webDriver.manage().timeouts().implicitlyWait( 10, TimeUnit.SECONDS )
}
override def afterEach()
{
server.stop()
webDriver.close()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment