Created
October 22, 2012 20:54
-
-
Save MasseGuillaume/3934188 to your computer and use it in GitHub Desktop.
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
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" ) | |
} | |
} | |
} |
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
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