Example #1
0
        public void SendEventWithAnalyticsDisabled()
        {
            app.Screenshot("SendEventWithAnalyticsDisabled - Ready for tests");
            /* Disable Analytics */
            ServiceStateHelper.app = app;
            app.WaitForElement(TestStrings.GoToTogglePageButton);
            app.Tap(TestStrings.GoToTogglePageButton);
            ServiceStateHelper.AnalyticsEnabled = false;
            app.Tap(TestStrings.DismissButton);

            app.Tap(TestStrings.GoToAnalyticsPageButton);
            app.WaitForElement(TestStrings.GoToAnalyticsResultsPageButton);

            int numProperties = 1;

            SendEvent(numProperties);
            app.Tap(TestStrings.GoToAnalyticsResultsPageButton);
            app.WaitForElement(TestStrings.EventPropertiesLabel);

            /* Verify that the event was not sent */
            AnalyticsResultsHelper.app = app;
            Assert.IsFalse(AnalyticsResultsHelper.SendingEventWasCalled);
            Assert.IsFalse(AnalyticsResultsHelper.VerifyEventName());
            Assert.IsFalse(AnalyticsResultsHelper.VerifyNumProperties(numProperties));
            Assert.IsFalse(AnalyticsResultsHelper.SentEventWasCalled);
            Assert.IsFalse(AnalyticsResultsHelper.FailedToSendEventWasCalled);
        }
Example #2
0
        public void SendEventWithNoProperties()
        {
            app.Tap(TestStrings.GoToAnalyticsPageButton);
            int numProperties = 0;

            SendEvent(numProperties);
            app.Tap(TestStrings.GoToAnalyticsResultsPageButton);

            /* Verify that the event was sent properly */
            AnalyticsResultsHelper.app = app;
            Assert.IsTrue(AnalyticsResultsHelper.SendingEventWasCalled);
            Assert.IsTrue(AnalyticsResultsHelper.VerifyEventName());
            Assert.IsTrue(AnalyticsResultsHelper.VerifyNumProperties(numProperties));
            Assert.IsTrue(AnalyticsResultsHelper.SentEventWasCalled);
            Assert.IsFalse(AnalyticsResultsHelper.FailedToSendEventWasCalled);
        }
Example #3
0
        public void SendEventWithProperties()
        {
            app.Screenshot("SendEventWithProperties - Ready for tests");
            app.WaitForElement(TestStrings.GoToAnalyticsPageButton);
            app.Tap(TestStrings.GoToAnalyticsPageButton);
            app.WaitForElement(TestStrings.GoToAnalyticsResultsPageButton);

            int numProperties = 5;

            SendEvent(numProperties);
            app.Tap(TestStrings.GoToAnalyticsResultsPageButton);

            /* Verify that the event was sent properly */
            AnalyticsResultsHelper.app = app;
            Assert.IsTrue(AnalyticsResultsHelper.SendingEventWasCalled);
            Assert.IsTrue(AnalyticsResultsHelper.VerifyEventName());

            /* The SDK already has retry logic. So, give it a second try. */
            Assert.IsTrue(AnalyticsResultsHelper.SentEventWasCalled || AnalyticsResultsHelper.SentEventWasCalled);
            Assert.IsFalse(AnalyticsResultsHelper.FailedToSendEventWasCalled);
        }
Example #4
0
        public void SendEventWithProperties()
        {
            app.Screenshot("SendEventWithProperties - Ready for tests");
            app.WaitForElement(TestStrings.GoToAnalyticsPageButton);
            app.Tap(TestStrings.GoToAnalyticsPageButton);
            app.WaitForElement(TestStrings.GoToAnalyticsResultsPageButton);

            int numProperties = 5;

            SendEvent(numProperties);
            app.Tap(TestStrings.GoToAnalyticsResultsPageButton);
            app.WaitForElement(TestStrings.EventPropertiesLabel);

            /* Verify that the event was sent properly */
            AnalyticsResultsHelper.app = app;
            Assert.IsTrue(AnalyticsResultsHelper.SendingEventWasCalled);
            Assert.IsTrue(AnalyticsResultsHelper.VerifyEventName());
            Assert.IsTrue(AnalyticsResultsHelper.VerifyNumProperties(numProperties));
            Assert.IsTrue(AnalyticsResultsHelper.SentEventWasCalled);
            Assert.IsFalse(AnalyticsResultsHelper.FailedToSendEventWasCalled);
        }