Exemplo n.º 1
0
 public void LaunchTest()
 {
     try
     {
         SplashScreenPage.WaitForPageToLoad(TimeSpan.FromSeconds(1));
     }
     catch
     {
         OnboardingPage.WaitForPageToLoad(TimeSpan.FromSeconds(10));
     }
 }
Exemplo n.º 2
0
        public async Task EnsureEachPageLoads()
        {
            //Arrange
            bool areNotificationsEnabled_Initial = OnboardingPage.AreNotificationsEnabeld;
            bool areNotificationsEnabled_Final;

            //Assert
            Assert.AreEqual(0, OnboardingPage.CurrentPageNumber);
            Assert.AreEqual(OnboardingConstants.GitTrendsPageTitle, OnboardingPage.TitleLabelText);

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

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

            //Assert
            Assert.AreEqual(1, OnboardingPage.CurrentPageNumber);
            Assert.AreEqual(OnboardingConstants.ChartPageTitle, OnboardingPage.TitleLabelText);

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

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

            OnboardingPage.TapEnableNotificationsButton();

            //Assert
            areNotificationsEnabled_Final = OnboardingPage.AreNotificationsEnabeld;

            Assert.AreEqual(2, OnboardingPage.CurrentPageNumber);
            Assert.AreEqual(OnboardingConstants.NotificationsPageTitle, OnboardingPage.TitleLabelText);

            Assert.IsTrue(areNotificationsEnabled_Final);
            Assert.IsFalse(areNotificationsEnabled_Initial);

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

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

            //Assert
            Assert.AreEqual(3, OnboardingPage.CurrentPageNumber);
            Assert.AreEqual(OnboardingConstants.ConnectToGitHubPageTitle, OnboardingPage.TitleLabelText);
        }
Exemplo n.º 3
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
        }
Exemplo n.º 4
0
        public override async Task BeforeEachTest()
        {
            await base.BeforeEachTest().ConfigureAwait(false);

            await OnboardingPage.WaitForPageToLoad().ConfigureAwait(false);
        }