use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class RequestChecksumTest method shouldFlagMissingChecksumAsCorrupted.
@Test
public void shouldFlagMissingChecksumAsCorrupted() throws IOException, InterruptedException {
request(URL_QUERY_CHECKSUM_MISSING);
Preconditions.checkState(null != server);
final EventPayload payload = server.waitForEvent();
assertTrue(payload.event.corruptEvent);
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class SeleniumJavaScriptTest method shouldSignalWhenLateLoaded.
@Test
public void shouldSignalWhenLateLoaded() throws Exception {
doSetUp();
Preconditions.checkState(null != driver && null != server);
// Go to the page but don't load Divolte immediately.
gotoPage(PAGE_VIEW_DEFERRED_LOAD, false);
final WebDriverWait wait = new WebDriverWait(driver, 30);
final WebElement loadButton = wait.until(ExpectedConditions.presenceOfElementLocated(By.id("load_divolte")));
logger.info("Triggering deferred loading of Divolte");
loadButton.click();
// Wait for the page-view event to arrive.
final EventPayload payload = server.waitForEvent();
final DivolteEvent eventData = payload.event;
assertEquals(Optional.of("pageView"), eventData.eventType);
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class SeleniumJavaScriptTest method shouldSendCustomEvent.
@Test
public void shouldSendCustomEvent() throws Exception {
doSetUp();
Preconditions.checkState(null != driver && null != server);
gotoPage(BASIC);
server.waitForEvent();
driver.findElement(By.id("custom")).click();
final EventPayload payload = server.waitForEvent();
final DivolteEvent eventData = payload.event;
assertTrue(eventData.eventType.isPresent());
assertEquals("custom", eventData.eventType.get());
final Optional<String> customEventParameters = eventData.eventParametersProducer.get().map(Object::toString);
assertTrue(customEventParameters.isPresent());
assertEquals("{\"a\":{}," + "\"b\":\"c\"," + "\"d\":{\"a\":[],\"b\":\"g\"}," + "\"e\":[\"1\",\"2\"]," + "\"f\":42," + "\"g\":53.2," + "\"h\":-37," + "\"i\":-7.83E-9," + "\"j\":true," + "\"k\":false," + "\"l\":null," + "\"m\":\"2015-06-13T15:49:33.002Z\"," + "\"n\":{}," + "\"o\":[{},{\"a\":\"b\"},{\"c\":\"d\"}]," + "\"p\":[null,null,{\"a\":\"b\"},\"custom\",null,{}]," + "\"q\":{}}", customEventParameters.get());
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class SeleniumJavaScriptTest method shouldUseConfiguredEventSuffix.
@Test
public void shouldUseConfiguredEventSuffix() throws Exception {
doSetUp("selenium-test-custom-event-suffix.conf");
Preconditions.checkState(null != server);
gotoPage(BASIC);
final EventPayload payload = server.waitForEvent();
final DivolteEvent eventData = payload.event;
assertEquals(Optional.of("pageView"), eventData.eventType);
}
use of io.divolte.server.ServerTestUtils.EventPayload in project divolte-collector by divolte.
the class SeleniumJavaScriptTest method shouldPickupProvidedPageViewIdFromHash.
@Test
public void shouldPickupProvidedPageViewIdFromHash() throws Exception {
doSetUp();
Preconditions.checkState(null != server);
gotoPage(PAGE_VIEW_SUPPLIED);
final EventPayload payload = server.waitForEvent();
final DivolteEvent eventData = payload.event;
assertEquals(Optional.of("supercalifragilisticexpialidocious"), eventData.browserEventData.map(bed -> bed.pageViewId));
assertEquals("supercalifragilisticexpialidocious0", eventData.eventId);
}
Aggregations