Exemplo n.º 1
0
 /**
  * create archived banners and then verify its existence.
  *
  * @return void
  *
  * @test
  */
 public function setFilter_TestFilters_ShouldFilterTags2()
 {
     $bannerName_1 = 'Test Filter 1';
     $bannerName_2 = 'Test Filter 2';
     $this->bannerManagerPage->addBanner($bannerName_1, false);
     $message = $this->bannerManagerPage->getAlertMessage();
     $this->assertTrue(strpos($message, 'Banner successfully saved') >= 0, 'Banner save should return success');
     $state = $this->bannerManagerPage->getState($bannerName_1);
     $this->assertEquals('published', $state, 'Initial state should be published');
     $this->bannerManagerPage->addBanner($bannerName_2, false);
     $message = $this->bannerManagerPage->getAlertMessage();
     $this->assertTrue(strpos($message, 'Banner successfully saved') >= 0, 'Banner save should return success');
     $state = $this->bannerManagerPage->getState($bannerName_2);
     $this->assertEquals('published', $state, 'Initial state should be published');
     $this->bannerManagerPage->changeBannerState($bannerName_2, 'Archived');
     $this->bannerManagerPage->setFilter('filter_state', 'Archived');
     $this->assertFalse($this->bannerManagerPage->getRowNumber($bannerName_1), 'banner should not show');
     $this->assertGreaterThanOrEqual(1, $this->bannerManagerPage->getRowNumber($bannerName_2), 'Test banner should be present');
     $this->bannerManagerPage->setFilter('filter_state', 'Published');
     $this->assertFalse($this->bannerManagerPage->getRowNumber($bannerName_2), 'Banner should not show');
     $this->assertGreaterThanOrEqual(1, $this->bannerManagerPage->getRowNumber($bannerName_1), 'Test banner should be present');
     $this->bannerManagerPage->setFilter('Select Status', 'Select Status');
     $this->bannerManagerPage->trashAndDelete($bannerName_1);
     $this->bannerManagerPage->trashAndDelete($bannerName_2);
 }
Exemplo n.º 2
0
 /**
  * @test
  */
 public function editBanner_ChangeFields_FieldsChanged()
 {
     $salt = rand();
     $bannerName = 'Banner' . $salt;
     $client = 'Joomla!';
     $TrackClicks = 'Yes';
     $width = '35';
     $this->assertFalse($this->bannerManagerPage->getRowNumber($bannerName), 'Test banner should not be present');
     $this->bannerManagerPage->addBanner($bannerName, false);
     $this->bannerManagerPage->editBanner($bannerName, array('Client' => $client, 'Track Clicks' => $TrackClicks, 'Width' => $width));
     $values = $this->bannerManagerPage->getFieldValues('BannerEditPage', $bannerName, array('Name', 'Client', 'Track Clicks', 'Width'));
     $this->assertEquals(array($bannerName, $client, $TrackClicks, $width), $values, 'Actual name, client, track clicks and width should match expected');
     $this->bannerManagerPage->trashAndDelete($bannerName);
 }