Exemplo n.º 1
0
        public void EnsureLegendIsInteractive()
        {
            //Arrange
            bool isViewsSeriesVisible_Initial        = TrendsPage.IsSeriesVisible(TrendsChartConstants.TotalViewsTitle);
            bool isUniqueViewsSeriesVisible_Initial  = TrendsPage.IsSeriesVisible(TrendsChartConstants.UniqueViewsTitle);
            bool isClonesSeriesVisible_Initial       = TrendsPage.IsSeriesVisible(TrendsChartConstants.TotalClonesTitle);
            bool isUniqueClonesSeriesVisible_Initial = TrendsPage.IsSeriesVisible(TrendsChartConstants.UniqueClonesTitle);

            //Act
            TrendsPage.TapViewsLegendIcon();

            //Assert
            Assert.AreNotEqual(isViewsSeriesVisible_Initial, TrendsPage.IsSeriesVisible(TrendsChartConstants.TotalViewsTitle));

            //Act
            TrendsPage.TapUniqueViewsLegendIcon();

            //Assert
            Assert.AreNotEqual(isUniqueViewsSeriesVisible_Initial, TrendsPage.IsSeriesVisible(TrendsChartConstants.UniqueViewsTitle));

            //Act
            TrendsPage.TapClonesLegendIcon();

            //Assert
            Assert.AreNotEqual(isClonesSeriesVisible_Initial, TrendsPage.IsSeriesVisible(TrendsChartConstants.TotalClonesTitle));

            //Act
            TrendsPage.TapUniqueClonesLegendIcon();

            //Assert
            Assert.AreNotEqual(isUniqueClonesSeriesVisible_Initial, TrendsPage.IsSeriesVisible(TrendsChartConstants.UniqueClonesTitle));
        }
Exemplo n.º 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
        }
Exemplo n.º 3
0
        public override async Task BeforeEachTest()
        {
            await base.BeforeEachTest().ConfigureAwait(false);

            var selectedRepository = RepositoryPage.GetVisibleRepositoryList().First();

            RepositoryPage.TapRepository(selectedRepository.Name);

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

            Assert.IsTrue(App.Query(selectedRepository.Name).Any());
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
0
        public async Task ViewStarsChart()
        {
            //Arrange
            Assert.IsTrue(TrendsPage.IsViewsClonesChartVisible);

            //Act
            await TrendsPage.MoveToNextPage();

            await TrendsPage.WaitForPageToLoad();

            //Assert
            Assert.IsTrue(TrendsPage.IsStarsChartVisible);
            Assert.AreEqual(_selectedRepository !.StarCount.ToAbbreviatedText(), TrendsPage.StarsStatisticsLabelText);
            Assert.AreEqual(_selectedRepository !.StarCount > 1 ? TrendsChartTitleConstants.KeepItUp.ToUpper() : TrendsChartTitleConstants.YouGotThis.ToUpper(), TrendsPage.StarsHeaderMessageLabelText);
        }
Exemplo n.º 6
0
        public override async Task BeforeEachTest()
        {
            await base.BeforeEachTest().ConfigureAwait(false);

            var selectedRepository = RepositoryPage.VisibleCollection.First();

            RepositoryPage.TapRepository(selectedRepository.Name);

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

            Assert.IsTrue(App.Query(selectedRepository.Name).Any());

            Assert.AreEqual(selectedRepository.TotalViews.ConvertToAbbreviatedText(), TrendsPage.ViewsStatisticsLabelText);
            Assert.AreEqual(selectedRepository.TotalUniqueViews.ConvertToAbbreviatedText(), TrendsPage.UniqueViewsStatisticsLabelText);
            Assert.AreEqual(selectedRepository.TotalClones.ConvertToAbbreviatedText(), TrendsPage.ClonesStatisticsLabelText);
            Assert.AreEqual(selectedRepository.TotalUniqueClones.ConvertToAbbreviatedText(), TrendsPage.UniqueClonesStatisticsLabelText);
        }
Exemplo n.º 7
0
        public async Task VerifyChartSettingsOptions()
        {
            //Arrange

            //Assert
            Assert.AreEqual(TrendsChartOption.All, SettingsPage.CurrentTrendsChartOption);

            //Act
            await SettingsPage.SetTrendsChartOption(TrendsChartOption.JustUniques).ConfigureAwait(false);

            //Assert
            Assert.AreEqual(TrendsChartOption.JustUniques, SettingsPage.CurrentTrendsChartOption);

            //Act
            await SettingsPage.SetTrendsChartOption(TrendsChartOption.All).ConfigureAwait(false);

            //Assert
            Assert.AreEqual(TrendsChartOption.All, SettingsPage.CurrentTrendsChartOption);

            //Act
            await SettingsPage.SetTrendsChartOption(TrendsChartOption.NoUniques);

            //Assert
            Assert.AreEqual(TrendsChartOption.NoUniques, SettingsPage.CurrentTrendsChartOption);

            //Act
            SettingsPage.TapBackButton();

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

            await RepositoryPage.WaitForNoPullToRefreshIndicator().ConfigureAwait(false);

            var visibleRepositories = RepositoryPage.VisibleCollection;

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

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

            //Assert
            Assert.IsTrue(TrendsPage.IsSeriesVisible(TrendsChartTitleConstants.TotalViewsTitle));
            Assert.IsTrue(TrendsPage.IsSeriesVisible(TrendsChartTitleConstants.TotalClonesTitle));
            Assert.IsFalse(TrendsPage.IsSeriesVisible(TrendsChartTitleConstants.UniqueViewsTitle));
            Assert.IsFalse(TrendsPage.IsSeriesVisible(TrendsChartTitleConstants.UniqueClonesTitle));
        }
Exemplo n.º 8
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);
                }
            }
        }
Exemplo n.º 9
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
        }