private void LogIn() { logonStrategy = Scope.Resolve <LogOnFrame>(); var user = UserPool.GetUser(); logonStrategy.LogOn(user); Logger.Info($"User {user.Login} is logged in."); }
public void TestSetUp() { var mainPage = Scope.Resolve <IMainPage>(); mainPage.Open(); mainPage.WaitForLoad(); logonStrategy = Scope.Resolve <LogOnFrame>(); var user = UserPool.GetUser(); logonStrategy.LogOn(user); Logger.Info($"User {user.Login} is logged in."); var bookmarksPage = Scope.Resolve <IBookmarkPage>(); bookmarksPage.Open(); bookmarksPage.WaitForLoad(); }
public void CheckTileBookmarks() { var pageHeader = Scope.Resolve <IPageHeader>().WaitForLoading(); pageHeader.OpenLogonFrame(); logonStrategy.LogOn(UserPool.GetUser()); var tutorialNavigator = Scope.Resolve <ITutorialNavigator>().WaitForLoading(); var tiles = tutorialNavigator.GetAllTilesCache(); CollectionAssert.IsNotEmpty(tiles); foreach (var tile in tiles) { Logger.Info($"{tile.Title} {(tile.BookMarkDisplayed() ? "has" : "does NOT have")} a bookmark"); Assert.That(tile.BookMarkDisplayed(), Is.True); } }
public void CompareUserProgress() { logonStrategy.LogOn(UserPool.GetUser()); var progress = Scope.Resolve <IUserService>().GetStatistics(BaseDriver.GetBrowserCookies()).UserProgress; var statistics = Scope.Resolve <ITutorialSection>().WaitForLoading(); var groups = statistics.GetStatsByType(StatisticsType.Groups); var tutorials = statistics.GetStatsByType(StatisticsType.Tutorials); var missions = statistics.GetStatsByType(StatisticsType.Missions); Assert.Multiple(() => { Logger.Info($"From User service {progress.GroupsTotal}, from the main page {groups.Total}"); Assert.That( progress.GroupsTotal.Equals(groups.Total), $"{progress.GroupsTotal} not equals to {groups.Total}"); Logger.Info($"From User service {progress.GroupsCompleted}, from the main page {groups.Completed}"); Assert.That( progress.GroupsCompleted.Equals(groups.Completed), $"{progress.GroupsCompleted} not equals to {groups.Completed}"); Logger.Info($"From User service {progress.MissionsTotal}, from the main page {missions.Total}"); Assert.That( progress.MissionsTotal.Equals(missions.Total), $"{progress.MissionsTotal} not equals to {missions.Total}"); Logger.Info($"From User service {progress.MissionsCompleted}, from the main page {missions.Completed}"); Assert.That( progress.MissionsCompleted.Equals(missions.Completed), $"{progress.MissionsCompleted} not equals to {missions.Completed}"); Logger.Info($"From User service {progress.TutorialTotal}, from the main page {tutorials.Total}"); Assert.That( progress.TutorialTotal.Equals(tutorials.Total), $"{progress.TutorialTotal} not equals to {tutorials.Total}"); Logger.Info($"From User service {progress.TutorialCompleted}, from the main page {tutorials.Completed}"); Assert.That( progress.TutorialCompleted.Equals(tutorials.Completed), $"{progress.TutorialCompleted} not equals to {tutorials.Completed}"); }); }
public void CompareUserHistory() { logonStrategy.LogOn(UserPool.GetUser()); var cookies = BaseDriver.GetBrowserCookies(); var userService = Scope.Resolve <IUserService>(); string path = $"{TestContext.CurrentContext.Test.Name} ({_browser})"; userService.DownloadHistory(cookies, path); var userFileHistory = UserHistoryData.GetUserHistory(path); var userHistory = userService.GetUserHistory(cookies); CollectionAssert.IsNotEmpty(userHistory); CollectionAssert.IsNotEmpty(userFileHistory); CompareHistories(userFileHistory, userHistory); }