public void Castr_ResetAndFeatureAPost() { var feedUrl = _params["PremierLeague"].ToString(); var feedUrl2 = _params["ChampionLeague"].ToString(); _browser.Navigate(_config.Url); HomePage homePage = new HomePage(_browser); homePage.Login(_config.ConfigObject.Users.AdminUser); PostCreator postCreator = new PostCreator(_browser); postCreator.Create(); CastrPage castrPage = homePage.GoToCastr(); CastrPage newPosts = castrPage.SelectStatus(Statuses.New); CastrPost post = newPosts.ClickOnPost(postCreator.Title); post.UnCheckLeague(0); post.PublishPostToFeed(Platforms.ftbpro, 1); CastrPage publishedPosts = newPosts.SelectStatus(Statuses.published); post = publishedPosts.ClickOnPost(postCreator.Title); post.ResetPost(); newPosts = newPosts.SelectStatus(Statuses.New); post = newPosts.ClickOnPost(postCreator.Title); post.PublishPostToFeed(Platforms.ftbpro, 0); _browser.Navigate($"{_config.Url}/{feedUrl}"); FeedPage feedPage = new FeedPage(_browser); Assert.True(feedPage.ValidateArticleByTitle(postCreator.Title), $"Post {postCreator.Title} was not shown on {feedUrl} after it was reseted."); feedPage = new FeedPage(_browser); _browser.Navigate($"{_config.Url}/{feedUrl2}"); Assert.True(feedPage.ValidateArticleByTitle(postCreator.Title), $"Post {postCreator.Title} was not shown on {feedUrl2} after it was reseted."); }
/// <summary> /// Gets the feeds. /// </summary> /// <param name="user">The user for which feeds are retrieved.</param> /// <returns>The list of feeds.</returns> public Feed[] GetFeeds(AdWordsUser user) { using (FeedService feedService = (FeedService)user.GetService(AdWordsService.v201809.FeedService)) { Selector selector = new Selector() { fields = new string[] { Feed.Fields.Id, Feed.Fields.Name, Feed.Fields.Origin, Feed.Fields.Attributes, Feed.Fields.SystemFeedGenerationData, Feed.Fields.FeedStatus }, predicates = new Predicate[] { Predicate.Contains(Feed.FilterableFields.Name, "sitelink") }, paging = Paging.Default }; FeedPage page = feedService.get(selector); if (page.totalNumEntries > 0) { return(page.entries); } return(null); } }
public void MyFirstTest() { LoginPage loginPage = new LoginPage(); loginPage.LogInTheAccount(); FeedPage feedPage = new FeedPage(); string userId = feedPage.GetUserId(); feedPage.GetMainMenuForm().MainMenuButtonClick(NavButtons.MyProfile); ProfilePage profilePage = new ProfilePage(); string postId = Api.GetPostIdFromResponse(userId, RandomMessage); Log.Info($"Checks if post is {userId}'s"); Banner wallPostBanner = profilePage.GetWallPostForm().GetWallPostBanner(userId, postId); Assert.True(wallPostBanner.IsDisplayed(), "The Post is not from the right user"); Log.Info($"Checks if message matches {RandomMessage}"); Assert.AreEqual(RandomMessage, profilePage.GetWallPostForm().GetWallPostText(userId, postId), $"Message do not matches {RandomMessage}"); Api.EditPostMessage(userId, NewMessage, postId); Log.Info($"Checks if message matches {NewMessage}"); Browser.SetExplicitWaitUntilContentChanged(wallPostBanner, NewMessage); Assert.AreEqual(NewMessage, profilePage.GetWallPostForm().GetWallPostText(userId, postId), $"Message do not matches {NewMessage}"); string commentId = Api.GetCommentIdFromResponse(postId, RandomMessage); profilePage.GetWallPostForm().GetLikeButton(userId, postId).Click(); Log.Info($"Checks if Comment is from {userId}"); Assert.True(profilePage.GetWallPostForm().CommentIsFromRightUser(userId, commentId), $"Comment is not from id{userId}"); string likeStatus = Api.GetLikeStatusFromResponse(postId, userId, userId, ResponseFields.Post); Log.Info("Checks if like status is 'LIKED'"); Assert.AreEqual(likeStatus, StatusLiked, $"User id{userId} did not like item id{postId}"); }
/// <summary> /// Gets the feeds. /// </summary> /// <param name="user">The user for which feeds are retrieved.</param> /// <returns>The list of feeds.</returns> private Feed[] GetFeeds(AdWordsUser user) { FeedService feedService = (FeedService)user.GetService(AdWordsService.v201609.FeedService); FeedPage page = feedService.query("SELECT Id, Name, Attributes where " + "Origin='USER' and FeedStatus='ENABLED'"); return(page.entries); }
public BaseStepDefenition(ScenarioContext scenarioContext) { WebDriver driver = scenarioContext.Get <WebDriver>(); loginPage = new LoginPage(driver); startPage = new FeedPage(driver); testDataGenerator = new TestDataGenerator(); }
public void ExtractContractEventsFromFeedPageAsyncTest() { //Arrange var dummyPayload = @"<?xml version=""1.0"" encoding=""utf-8""?> <feed xmlns=""http://www.w3.org/2005/Atom""> <title type=""text"">Test</title> <id>uuid:d2619398-19dc-44e8-b4a9-917796baf6c2</id> <updated>2021-01-01T01:01:01Z</updated> <author> <name>Contract Management Service</name> </author> <link rel=""next-archive"" type=""application/vnd.test.v1+atom+xml"" href=""https://localhost/notifications/3"" /> <link rel=""prev-archive"" type=""application/vnd.test.v1+atom+xml"" href=""https://localhost/notifications/1"" /> <link rel=""self"" type=""application/vnd.test.v1+atom+xml"" href=""https://localhost/notifications"" /> <link rel=""current"" type=""application/vnd.test.v1+atom+xml"" href=""https://localhost/notifications/2"" /> <archive xmlns=""http://purl.org/syndication/history/1.0""></archive> <entry> <id>uuid:d2619398-19dc-44e8-b4a9-917796baf6c2</id> <title type=""text"">Test title</title> <summary type=""text"">Test summary</summary> <published>2021-01-01T01:01:01Z</published> <updated>2021-01-01T01:01:01Z</updated> <category term=""Test category"" label=""A test category"" /> <content type=""application/vnd.test.v1+atom+xml"">Test content string</content> </entry> </feed>"; var expectedFeedPage = new FeedPage { CurrentPageNumber = 2, PreviousPageNumber = 1, NextPageNumber = 3, IsSelfPage = false, Entries = new[] { new FeedEntry { Id = new Guid("d2619398-19dc-44e8-b4a9-917796baf6c2"), Updated = DateTime.Parse("2021-01-01T01:01:01Z"), Content = @"<Content type=""application/vnd.test.v1+atom+xml"">Test content string</Content>" } } }; Mock.Get(_mockMapper) .Setup(m => m.Map <IList <FeedEntry> >(It.IsAny <IEnumerable <SyndicationItem> >())) .Returns(expectedFeedPage.Entries); //Act var reader = new FcsFeedReaderService(_mockAuthService, _mockHttpClient, _mockMapper, _mockOptions); var results = reader.ExtractContractEventsFromFeedPageAsync(dummyPayload); //Assert results.Should().BeEquivalentTo(expectedFeedPage); }
public FeedPage GenerateCharacters(int characters, IWebDriver driver) { HomePage homePage = new HomePage(driver); homePage.EnterNumberInInput(characters) .ClickCharactersRadioButton(); FeedPage feedPage = homePage.PressGenerateLoremIpsum(); return(feedPage); }
public FeedPage GenerateParagraphs(int paragraphs, IWebDriver driver) { HomePage homePage = new HomePage(driver); homePage.EnterNumberInInput(paragraphs) .ClickParagraphButton(); FeedPage feedPage = homePage.PressGenerateLoremIpsum(); return(feedPage); }
/// <summary> /// Setups the mocks. /// </summary> /// <param name="xmlContent">Content of the XML.</param> /// <param name="expectedFeedPage">The expected feed page.</param> /// <param name="page">The page.</param> private void SetupMocks(string xmlContent, FeedPage expectedFeedPage, int page = -1) { Mock.Get(_mockMapper) .Setup(m => m.Map <IList <FeedEntry> >(It.IsAny <IEnumerable <SyndicationItem> >())) .Returns(expectedFeedPage.Entries); _mockHttpMessageHandler .Expect($"{_mockOptions.Value.ApiBaseAddress}{_mockOptions.Value.FcsAtomFeedSelfPageEndpoint}{(page >= 0 ? "/" + page.ToString() : string.Empty)}") .Respond("application/atom+xml", xmlContent); }
public double WhenIPressGenerateLoremIpsumTimesAndCountTheAverageResult(int p0) { int paragraphs_Sum = 0; for (int i = 0; i < p0; i++) { FeedPage feed = homePage.PressGenerateLoremIpsum(); paragraphs_Sum += feed.CountParagraphsContainingWord("lorem"); feed.GoBack(); } return((double)paragraphs_Sum / p0); }
public async Task ReadSelfPageAsyncTestAsync() { //Arrange var dummyPayload = @"<?xml version=""1.0"" encoding=""utf-8""?> <feed xmlns=""http://www.w3.org/2005/Atom""> <title type=""text"">Test</title> <id>uuid:d2619398-19dc-44e8-b4a9-917796baf6c2</id> <updated>2021-01-01T01:01:01Z</updated> <author> <name>Contract Management Service</name> </author> <link rel=""prev-archive"" type=""application/vnd.test.v1+atom+xml"" href=""https://localhost/notifications/1"" /> <link rel=""self"" type=""application/vnd.test.v1+atom+xml"" href=""https://localhost/notifications"" /> <archive xmlns=""http://purl.org/syndication/history/1.0""></archive> <entry> <id>uuid:d2619398-19dc-44e8-b4a9-917796baf6c2</id> <title type=""text"">Test title</title> <summary type=""text"">Test summary</summary> <published>2021-01-01T01:01:01Z</published> <updated>2021-01-01T01:01:01Z</updated> <category term=""Test category"" label=""A test category"" /> <content type=""application/vnd.test.v1+atom+xml"">Test content string</content> </entry> </feed>"; var expectedFeedPage = new FeedPage { CurrentPageNumber = 2, PreviousPageNumber = 1, IsSelfPage = true, Entries = new[] { new FeedEntry { Id = new Guid("d2619398-19dc-44e8-b4a9-917796baf6c2"), Updated = DateTime.Parse("2021-01-01T01:01:01Z"), Content = @"<Content type=""application/vnd.test.v1+atom+xml"">Test content string</Content>" } } }; SetupMocks(dummyPayload, expectedFeedPage); //Act var reader = new FcsFeedReaderService(_mockAuthService, _mockHttpClient, _mockMapper, _mockOptions); var results = await reader.ReadSelfPageAsync(); //Assert results.Should().BeEquivalentTo(expectedFeedPage); VerifyMocks(); }
public double CountWordsInParagraphs(int timesReload, IWebDriver driver) { HomePage homePage = new HomePage(driver); int paragraphs_Sum = 0; for (int i = 0; i < timesReload; i++) { FeedPage feedPage = homePage.PressGenerateLoremIpsum(); paragraphs_Sum += feedPage.CountParagraphsContainingWord("lorem"); feedPage.GoBack(); } return((double)paragraphs_Sum / timesReload); }
public void Photos() { LoginPage loginPage = new LoginPage(driver); loginPage.goToPage(); loginPage.Email.SendKeys("375445150780"); loginPage.Password.SendKeys("password"); loginPage.Login.Click(); FeedPage feedPage = new FeedPage(driver); feedPage.goToPage(); feedPage.Photos.Click(); }
/// <summary> /// Deletes the enabled GMB feeds. /// </summary> /// <param name="user">The AdWords user.</param> public void DeleteEnabledGmbFeeds(AdWordsUser user) { FeedService feedService = (FeedService)user.GetService(AdWordsService.v201806.FeedService); List <Feed> feedsToDelete = new List <Feed>(); string query = "Select Id, SystemFeedGenerationData, FeedStatus where FeedStatus=ENABLED"; FeedPage page = feedService.query(query); for (int i = 0; i < page.entries.Length; i++) { Feed f = page.entries[i]; PlacesLocationFeedData systemData = (f.systemFeedGenerationData as PlacesLocationFeedData); if (systemData != null) { feedsToDelete.Add(f); } } if (feedsToDelete.Count > 0) { List <FeedOperation> operations = new List <FeedOperation>(); for (int i = 0; i < feedsToDelete.Count; i++) { FeedOperation operation = new FeedOperation() { @operator = Operator.REMOVE, operand = new Feed() { id = feedsToDelete[i].id } }; operations.Add(operation); } feedService.mutate(operations.ToArray()); } return; }
public App() { InitializeComponent(); InitializeServices(); MainPage mainPage = new MainPage(); mainPage.BindingContext = new MainViewModel(); FeedPage feedPage = new FeedPage(); feedPage.BindingContext = new FeedViewModel(); mainPage.Children.Add(feedPage); MapPage mapPage = new MapPage(); mapPage.BindingContext = new MapViewModel(); mainPage.Children.Add(mapPage); MainPage = new NavigationPage(mainPage); }
public App() { // Register dependencies. //DependencyService.Register<IPushTheWorldWifiService, PushTheWorldWifiService>(); //Registers the PTW WiFi Service // Register standard XamU services var serviceLocator = XamUInfrastructure.Init(); //Settings.Current.ServiceLocater = serviceLocator; //var navSerivice = (FormsNavigationPageService)Settings.Current.ServiceLocater.Get<INavigationService>(); /*TODO: Uncomment when adding VS App Center Support */ //AppCenter.Start("android=" + ApiKeys.AppCenterAndroid + ";ios=" + ApiKeys.AppCenteriOS + ";uwp=" + ApiKeys.AppCenterUWP, // typeof(Analytics), typeof(Crashes), typeof(Distribute)); //Analytics.SetEnabledAsync(true); //AppCenter.LogLevel = LogLevel.Verbose; InitializeComponent(); MainPage = new FeedPage(); /* TDOD: Uncomment when adding root pages * and platform specific code for navigation */ //switch (Xamarin.Forms.Device.RuntimePlatform) //{ // case Xamarin.Forms.Device.Android: // MainPage = new RootPageAndroid(); // break; // case Xamarin.Forms.Device.iOS: // MainPage = new NavigationPage(new RootPageiOS()); // break; // case Xamarin.Forms.Device.UWP: // MainPage = new RootPageWindows(); // break; // default: // throw new NotImplementedException(); //} }
private void SetupMocks(Guid dummyLastReadBookmarkId, FeedPage dummyFeedPage) { Mock.Get(_mockLogger) .Setup(l => l.Log(LogLevel.Information, 0, It.IsAny <It.IsAnyType>(), null, It.IsAny <Func <It.IsAnyType, Exception, string> >())); Mock.Get(_mockFeedProcessorConfiguration) .Setup(c => c.GetLastReadBookmarkId()) .ReturnsAsync(dummyLastReadBookmarkId); Mock.Get(_mockFeedProcessorConfiguration) .Setup(c => c.GetLastReadPage()) .ReturnsAsync(10); Mock.Get(_mockFeedProcessorConfiguration) .Setup(c => c.GetNumberOfPagesToProcess()) .ReturnsAsync(6); Mock.Get(_mockFeedReader) .Setup(r => r.ReadSelfPageAsync()) .ReturnsAsync(dummyFeedPage); Mock.Get(_mockQueuePopulator) .Setup(q => q.PopulateSessionQueue(It.IsAny <IAsyncCollector <Message> >(), It.IsAny <IEnumerable <FeedEntry> >())) .Returns(Task.CompletedTask); }
public void Echo_RepublishPostToNewAFeed() { var channelIndex1 = _params["ChannelIndex1"].AsInt32; var channelIndex2 = _params["ChannelIndex2"].AsInt32; _browser.Navigate(_config.ConfigObject.Echo); Auth0LoginPage loginPage = new Auth0LoginPage(_browser); NewsRoomPage newsRoomPage = loginPage.LoginNewsRoom(_config.ConfigObject.Users.AdminUser); PostCreatorEcho postCreatorEcho = new PostCreatorEcho(_browser); string title = postCreatorEcho.CreatePost(); PostPage postPage = new PostPage(_browser); _browser.SwitchToFirstTab(); _browser.Refresh(); EchoPage echoPage = new EchoPage(_browser); DistributionPage distributionPage = echoPage.SelectPost(title); distributionPage.SelectChannelByIndex(channelIndex1); distributionPage.ClickOnPublishBtn(); distributionPage.WaitForPublishedSatatus(); _browser.OpenNewTab(_config.Url); HomePage homePage = new HomePage(_browser); Assert.True(homePage.ValidateMoreNewsTitle(title), $"Expected {title} was not found"); _browser.SwitchToFirstTab(); _browser.Refresh(); echoPage = new EchoPage(_browser); distributionPage.ClickOnNewButton(); distributionPage.SelectChannelByIndex(channelIndex2); distributionPage.ClickOnPublishBtn(); _browser.OpenNewTab($"{_config.Url}/channels/latest"); FeedPage feedPage = new FeedPage(_browser); _browser.Refresh(); Assert.True(feedPage.ValidatePostTitleInFeedPage(title), $"Expected {title} was not found"); }
private async void server6_Clicked(object sender, EventArgs e) { //Briggs 25 FeedPage feedPage = new FeedPage(25); await Navigation.PushAsync(feedPage); }
private async void server7_Clicked(object sender, EventArgs e) { //SolTech 40 FeedPage feedPage = new FeedPage(40); await Navigation.PushAsync(feedPage); }
public void WhenIPressGenerate() { feedPage = homePage.PressGenerateLoremIpsum(); }
public void SetFeedPage() { MainPage = new FeedPage(); }
private async void server2_Clicked(object sender, EventArgs e) { //Miller 10 FeedPage feedPage = new FeedPage(10); await Navigation.PushAsync(feedPage); }
//Need to add some way to tell the CheckMissedEvents method on MainActivity.cs which world_id //we are subscribed to MainActivity private async void server1_Clicked(object sender, EventArgs e) { //Connery 1 FeedPage feedPage = new FeedPage(1); await Navigation.PushAsync(feedPage); }
private async void server5_Clicked(object sender, EventArgs e) { //Jaeger 19 FeedPage feedPage = new FeedPage(19); await Navigation.PushAsync(feedPage); }
private async void server4_Clicked(object sender, EventArgs e) { //Emerald 17 FeedPage feedPage = new FeedPage(17); await Navigation.PushAsync(feedPage); }
private async void debug_Clicked(object sender, EventArgs e) { //debug, all servers FeedPage feedPage = new FeedPage(100); await Navigation.PushAsync(feedPage); }
private async void server3_Clicked(object sender, EventArgs e) { //Cobalt 13 FeedPage feedPage = new FeedPage(13); await Navigation.PushAsync(feedPage); }
public App() { InitializeComponent(); MainPage = new FeedPage(); }