/** * create archived NewsFeed and then verify its existence. * * @return void * * @test */ public function setFilter_TestFilters_ShouldFilterTags2() { $feedName_1 = 'Test Filter 1'; $feedName_2 = 'Test Filter 2'; $this->newsFeedManagerPage->addFeed($feedName_1); $message = $this->newsFeedManagerPage->getAlertMessage(); $this->assertTrue(strpos($message, 'News feed successfully saved') >= 0, 'News feed save should return success'); $state = $this->newsFeedManagerPage->getState($feedName_1); $this->assertEquals('published', $state, 'Initial state should be published'); $this->newsFeedManagerPage->addFeed($feedName_2); $message = $this->newsFeedManagerPage->getAlertMessage(); $this->assertTrue(strpos($message, 'News feed successfully saved') >= 0, 'News feed save should return success'); $state = $this->newsFeedManagerPage->getState($feedName_2); $this->assertEquals('published', $state, 'Initial state should be published'); $this->newsFeedManagerPage->changeFeedState($feedName_2, 'Archived'); $this->newsFeedManagerPage->setFilter('filter_published', 'Archived'); $this->assertFalse($this->newsFeedManagerPage->getRowNumber($feedName_1), 'News feed should not show'); $this->assertGreaterThanOrEqual(1, $this->newsFeedManagerPage->getRowNumber($feedName_2), 'Test News feed should be present'); $this->newsFeedManagerPage->setFilter('filter_published', 'Published'); $this->assertFalse($this->newsFeedManagerPage->getRowNumber($feedName_2), 'News feed should not show'); $this->assertGreaterThanOrEqual(1, $this->newsFeedManagerPage->getRowNumber($feedName_1), 'Test News feed should be present'); $this->newsFeedManagerPage->setFilter('Select Status', 'Select Status'); $this->newsFeedManagerPage->trashAndDelete($feedName_1); $this->newsFeedManagerPage->trashAndDelete($feedName_2); }
/** * @test */ public function editFeed_ChangeFields_FieldsChanged() { $salt = rand(); $feedName = 'Test_Feed' . $salt; $link = 'administrator/index.php/dummysrc' . $salt; $category = 'Uncategorised'; //other than the default value $description = 'Sample Test Feed'; $caption = 'Sample Caption'; $alt = 'Sample Alt Test'; $this->assertFalse($this->newsFeedManagerPage->getRowNumber($feedName), 'Test feed should not be present'); $this->newsFeedManagerPage->addFeed($feedName, $link, $category, $description, $caption, $alt); $this->newsFeedManagerPage->editFeed($feedName, array('Caption' => 'NewSample Caption', 'Alt text' => 'New Alt Text')); $values = $this->newsFeedManagerPage->getFieldValues('NewsFeedEditPage', $feedName, array('Caption', 'Alt text')); $this->assertEquals(array('NewSample Caption', 'New Alt Text'), $values, 'Actual values should match expected'); $this->newsFeedManagerPage->trashAndDelete($feedName); }