-
Notifications
You must be signed in to change notification settings - Fork 33
/
GoogleAnalyticsTestappIT.scala
35 lines (27 loc) · 1.26 KB
/
GoogleAnalyticsTestappIT.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.wixpress.common.petri
import com.github.tomakehurst.wiremock.client.VerificationException
import com.wixpress.petri.laboratory.BiPetriEvent
import com.wixpress.petri.test.SampleAppRunner
class GoogleAnalyticsTestappIT extends BaseTestapp {
val sampleAppViewDriver = new SampleAppViewDriver(webappPort, "testGoogleAnalytics")
val googleAnalyticsUrl = s"http://localhost:$biServerPort/collect"
val appRunner = new SampleAppRunner(webappPort, webappPath, 1, true, null, googleAnalyticsUrl)
override def beforeAll(): Unit = {
super.beforeAll()
appRunner.start()
}
override def afterAll(): Unit = {
super.afterAll()
appRunner.stop()
}
"GoogleAnalyticsTestapp" should {
"enter the page, click the button and check that petri event + business bi event were logged in google analytics" in {
petriDriver.addSpecAndExperiment("BUTTON_COLOR_SPEC")
sampleAppViewDriver.enterThePageAndClickButton()
eventually {
biServerDriver.assertThatBiServerWasCalledWith(partialBody = ButtonClickedEvent.eventType, "collect") must not(throwA[VerificationException])
biServerDriver.assertThatBiServerWasCalledWith(partialBody = BiPetriEvent.petriBiEventType, "collect") must not(throwA[VerificationException])
}
}
}
}