예제 #1
0
        public void ReferringSitesPageDoesLoad()
        {
            //Arrange
            IReadOnlyList <ReferringSiteModel> referringSites;

            //Act

            //Assert
            referringSites = ReferringSitesPage.GetVisibleReferringSitesList();
            Assert.IsTrue(referringSites.Any());
        }
예제 #2
0
        public async Task AppStoreScreenShotsTest()
        {
            //Arrange
            var screenRect = App.Query().First().Rect;

            //Act
            App.Screenshot("Repository Page Light");

            RepositoryPage.TapRepository(RepositoryPage.VisibleCollection.First().Name);

            await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

            App.TouchAndHoldCoordinates(screenRect.CenterX, screenRect.CenterY);
            App.Screenshot("Trends Page Light");

            TrendsPage.TapReferringSitesButton();
            await ReferringSitesPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Referring Sites Page Light");

            ReferringSitesPage.ClosePage();
            await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

            TrendsPage.TapBackButton();
            await RepositoryPage.WaitForPageToLoad().ConfigureAwait(false);

            RepositoryPage.TapSettingsButton();
            await SettingsPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Settings Page Light");

            await SettingsPage.SelectTheme(Mobile.Shared.PreferredTheme.Dark).ConfigureAwait(false);

            App.Screenshot("Settings Page Dark");

            SettingsPage.TapBackButton();
            await RepositoryPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Repository Page Dark");

            RepositoryPage.TapRepository(RepositoryPage.VisibleCollection.First().Name);

            await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

            App.TouchAndHoldCoordinates(screenRect.CenterX, screenRect.CenterY);
            App.Screenshot("Trends Page Dark");

            TrendsPage.TapReferringSitesButton();
            await ReferringSitesPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Referring Sites Page Dark");

            //Assert
        }
예제 #3
0
        public override async Task BeforeEachTest()
        {
            await base.BeforeEachTest().ConfigureAwait(false);

            var repositories = RepositoryPage.GetVisibleRepositoryList();

            RepositoryPage.TapRepository(repositories.First().Name);

            await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

            TrendsPage.TapReferringSitesButton();

            await ReferringSitesPage.WaitForPageToLoad().ConfigureAwait(false);
        }
예제 #4
0
        public void VerifyStoreRequest(ReviewAction firstAction, ReviewAction secondAction)
        {
            //Arrange
            string firstTitleText, secondTitleText, firstNoButtonText, secondNoButtonText, firstYesButtonText, secondYesButtonText;

            //Act
            ReferringSitesPage.TriggerReviewRequest();
            ReferringSitesPage.WaitForReviewRequest();

            firstTitleText     = ReferringSitesPage.StoreRatingRequestTitleLabelText;
            firstNoButtonText  = ReferringSitesPage.StoreRatingRequestNoButtonText;
            firstYesButtonText = ReferringSitesPage.StoreRatingRequestYesButtonText;

            PerformReviewAction(firstAction);

            secondTitleText     = ReferringSitesPage.StoreRatingRequestTitleLabelText;
            secondNoButtonText  = ReferringSitesPage.StoreRatingRequestNoButtonText;
            secondYesButtonText = ReferringSitesPage.StoreRatingRequestYesButtonText;

            //Assert
            Assert.AreEqual(ReviewServiceConstants.TitleLabel_EnjoyingGitTrends, firstTitleText);
            Assert.AreEqual(ReviewServiceConstants.NoButton_NotReally, firstNoButtonText);
            Assert.AreEqual(ReviewServiceConstants.YesButton_Yes, firstYesButtonText);
            Assert.AreEqual(ReviewServiceConstants.NoButton_NoThanks, secondNoButtonText);
            Assert.AreEqual(ReviewServiceConstants.YesButton_OkSure, secondYesButtonText);

            if (firstAction is ReviewAction.NoButtonTapped)
            {
                Assert.AreEqual(ReviewServiceConstants.TitleLabel_Feedback, secondTitleText);
            }
            else
            {
                Assert.AreEqual(ReferringSitesPage.ExpectedAppStoreRequestTitle, secondTitleText);
            }

            //Act
            PerformReviewAction(secondAction);

            if (secondAction is ReviewAction.NoButtonTapped)
            {
                ReferringSitesPage.WaitForNoReviewRequest();
            }
        }
예제 #5
0
        public override async Task BeforeEachTest()
        {
            await base.BeforeEachTest().ConfigureAwait(false);

            IReadOnlyList <ReferringSiteModel> referringSites = Array.Empty <ReferringSiteModel>();

            var repositories           = RepositoryPage.VisibleCollection;
            var repositoriesEnumerator = repositories.GetEnumerator();

            while (!referringSites.Any())
            {
                repositoriesEnumerator.MoveNext();
                RepositoryPage.TapRepository(repositoriesEnumerator.Current.Name);

                await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

                TrendsPage.TapReferringSitesButton();

                await ReferringSitesPage.WaitForPageToLoad().ConfigureAwait(false);

                referringSites = ReferringSitesPage.VisibleCollection;

                if (!referringSites.Any())
                {
                    Assert.IsTrue(ReferringSitesPage.IsEmptyDataViewVisible);

                    ReferringSitesPage.ClosePage();

                    await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

                    TrendsPage.TapBackButton();

                    await RepositoryPage.WaitForPageToLoad().ConfigureAwait(false);
                }
            }
        }
예제 #6
0
        public async Task AppStoreScreenShotsTest()
        {
            //Arrange
            var screenRect = App.Query().First().Rect;

            //Act
            await OnboardingPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("GitTrends Onboarding Page");

            await OnboardingPage.MoveToNextPage().ConfigureAwait(false);

            App.Screenshot("Charts Onboarding Page");

            await OnboardingPage.MoveToNextPage().ConfigureAwait(false);

            App.Screenshot("Notifications Onboarding Page");

            await OnboardingPage.MoveToNextPage().ConfigureAwait(false);

            App.Screenshot("Connect to GitHub Onboarding Page");

            await SetupLoggedInUser().ConfigureAwait(false);

            App.Screenshot("Repository Page Light");

            RepositoryPage.TapRepository(nameof(GitTrends));

            await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

            App.TouchAndHoldCoordinates(screenRect.CenterX, screenRect.CenterY);
            App.Screenshot("Trends Page Light");

            TrendsPage.TapReferringSitesButton();
            await ReferringSitesPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Referring Sites Page Light");

            ReferringSitesPage.ClosePage();
            await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

            TrendsPage.TapBackButton();
            await RepositoryPage.WaitForPageToLoad().ConfigureAwait(false);

            RepositoryPage.TapSettingsButton();
            await SettingsPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Settings Page Light");

            await SettingsPage.SelectTheme(PreferredTheme.Dark).ConfigureAwait(false);

            App.Screenshot("Settings Page Dark");

            SettingsPage.TapBackButton();
            await RepositoryPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Repository Page Dark");

            RepositoryPage.TapRepository(nameof(GitTrends));

            await TrendsPage.WaitForPageToLoad().ConfigureAwait(false);

            App.TouchAndHoldCoordinates(screenRect.CenterX, screenRect.CenterY);
            App.Screenshot("Trends Page Dark");

            TrendsPage.TapReferringSitesButton();
            await ReferringSitesPage.WaitForPageToLoad().ConfigureAwait(false);

            App.Screenshot("Referring Sites Page Dark");

            //Assert
        }