2014-12-04 18:20:15 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class pageFirstFeedTest extends minifluxTestCase
|
|
|
|
{
|
|
|
|
const DEFAULT_COUNTER_PAGE = 8;
|
2014-11-15 14:32:31 +01:00
|
|
|
const DEFAULT_COUNTER_UNREAD = 6;
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
public function setUpPage()
|
|
|
|
{
|
|
|
|
$url = $this->getURLPageFirstFeed();
|
2015-01-04 22:25:28 +01:00
|
|
|
$this->doLoginIfRequired($url);
|
|
|
|
|
|
|
|
$this->basePageHeading = $this->getBasePageHeading();
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->expectedPageUrl = $url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getExpectedPageTitle()
|
|
|
|
{
|
|
|
|
return "($this->expectedCounterPage) $this->basePageHeading";
|
|
|
|
}
|
|
|
|
|
2015-01-15 02:01:54 +01:00
|
|
|
public function testNoAlertShown()
|
|
|
|
{
|
|
|
|
$alertBox = $this->getAlertBox();
|
|
|
|
$this->assertEmpty($alertBox, 'Unexpected alert box found');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
|
|
|
$this->expectedDataSet = static::$databaseTester->getDataSet();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAlertOnParsingError()
|
|
|
|
{
|
|
|
|
// load different fixture and reload the page
|
|
|
|
$backupDataTester = static::$databaseTester;
|
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
static::$databaseTester = null;
|
2015-01-15 02:01:54 +01:00
|
|
|
|
|
|
|
$dataset = $this->getDataSet('fixture_feed1_parsing_error', 'fixture_feed2');
|
|
|
|
$this->getDatabaseTester($dataset)->onSetUp();
|
|
|
|
|
|
|
|
static::$databaseTester = $backupDataTester;
|
|
|
|
$this->refresh();
|
|
|
|
|
|
|
|
$alertBox = $this->getAlertBox();
|
|
|
|
$this->assertCount(1, $alertBox, 'No alert box found');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
|
|
|
$this->expectedDataSet = $dataset;
|
|
|
|
}
|
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testOnlyItemsFromFirstFeed()
|
|
|
|
{
|
|
|
|
$articles = $this->getArticlesNotFromFeedOne();
|
|
|
|
$this->assertEmpty($articles, 'found articles from other feeds on page for first feed.');
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = static::$databaseTester->getDataSet();
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testMarkReadNotBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadNotBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkReadStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$visible = $this->waitForIconMarkReadVisible($article);
|
|
|
|
$this->assertTrue($visible, 'read icon is not visible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD - 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkReadNotBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testMarkReadNotBookmarkedArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadNotBookmarked();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleReadStatus());
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$visible = $this->waitForIconMarkReadVisible($article);
|
|
|
|
$this->assertTrue($visible, 'read icon is not visible');
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD - 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkReadNotBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testMarkReadBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkReadStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$visible = $this->waitForIconMarkReadVisible($article);
|
|
|
|
$this->assertTrue($visible, 'read icon is not visible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD - 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkReadBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testMarkReadBookmarkedArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadBookmarked();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleReadStatus());
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$visible = $this->waitForIconMarkReadVisible($article);
|
|
|
|
$this->assertTrue($visible, 'read icon is not visible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD - 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkReadBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testMarkUnreadNotBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadNotBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkReadStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconMarkReadInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'read icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD + 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkUnreadNotBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testMarkUnreadNotBookmarkedArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadNotBookmarked();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleReadStatus());
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconMarkReadInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'read icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD + 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkUnreadNotBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testMarkUnreadBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkReadStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconMarkReadInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'read icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD + 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkUnreadBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testMarkUnreadBookmarkedArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadBookmarked();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleReadStatus());
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconMarkReadInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'read icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD + 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkUnreadBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testBookmarkReadArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadNotBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkBookmarkStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$visible = $this->waitForIconBookmarkVisible($article);
|
|
|
|
$this->assertTrue($visible, 'bookmark icon is not visible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_BookmarkReadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testBookmarkReadArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadNotBookmarked();
|
|
|
|
|
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleBookmarkStatus());
|
|
|
|
|
|
|
|
$visible = $this->waitForIconBookmarkVisible($article);
|
|
|
|
$this->assertTrue($visible, 'bookmark icon is not visible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_BookmarkReadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testBookmarkUnreadArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadNotBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkBookmarkStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$visible = $this->waitForIconBookmarkVisible($article);
|
|
|
|
$this->assertTrue($visible, 'bookmark icon is not visible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_BookmarkUnreadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testBookmarkUnreadArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadNotBookmarked();
|
|
|
|
|
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleBookmarkStatus());
|
|
|
|
|
|
|
|
$visible = $this->waitForIconBookmarkVisible($article);
|
|
|
|
$this->assertTrue($visible, 'bookmark icon is not visible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_BookmarkUnreadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testUnbookmarkReadArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkBookmarkStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconBookmarkInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'bookmark icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_UnbookmarkReadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testUnbookmarkReadArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadBookmarked();
|
|
|
|
|
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleBookmarkStatus());
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconBookmarkInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'bookmark icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_UnbookmarkReadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testUnbookmarkUnreadArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkBookmarkStatusToogle($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconBookmarkInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'bookmark icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_UnbookmarkUnreadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
2015-04-05 22:27:25 +02:00
|
|
|
/**
|
|
|
|
* @group moz_unsupported
|
|
|
|
*/
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testUnbookmarkUnreadArticleKeyboard()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadBookmarked();
|
|
|
|
|
|
|
|
$this->setArticleAsCurrentArticle($article);
|
|
|
|
$this->keys($this->getShortcutToogleBookmarkStatus());
|
|
|
|
|
|
|
|
$invisible = $this->waitForIconBookmarkInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'bookmark icon is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_UnbookmarkUnreadArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testRemoveReadNotBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadNotBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkRemove($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForArticleInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'article is is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE - 1;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_RemoveReadNotBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testRemoveReadBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleReadBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkRemove($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForArticleInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'article is is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE - 1;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_RemoveReadBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testRemoveUnreadNotBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadNotBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkRemove($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForArticleInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'article is is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE - 1;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD - 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_RemoveUnreadNotBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testRemoveUnreadBookmarkedArticleLink()
|
|
|
|
{
|
|
|
|
$article = $this->getArticleUnreadBookmarked();
|
|
|
|
|
|
|
|
$link = $this->getLinkRemove($article);
|
|
|
|
$link->click();
|
|
|
|
|
|
|
|
$invisible = $this->waitForArticleInvisible($article);
|
|
|
|
$this->assertTrue($invisible, 'article is is not invisible');
|
|
|
|
|
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE - 1;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = static::DEFAULT_COUNTER_UNREAD - 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_RemoveUnreadBookmarkedArticle', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testMarkFeedReadHeaderLink()
|
|
|
|
{
|
2015-03-08 12:56:59 +01:00
|
|
|
// load different fixture and reload the page
|
|
|
|
$backupDataTester = static::$databaseTester;
|
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
static::$databaseTester = null;
|
2015-03-08 12:56:59 +01:00
|
|
|
|
|
|
|
$dataset = $this->getDataSet('fixture_feed1_extra_long', 'fixture_feed2');
|
|
|
|
$this->getDatabaseTester($dataset)->onSetUp();
|
|
|
|
|
|
|
|
static::$databaseTester = $backupDataTester;
|
|
|
|
$this->refresh();
|
|
|
|
|
|
|
|
// start the "real" test
|
2014-12-04 18:20:15 +01:00
|
|
|
$link = $this->getLinkFeedMarkReadHeader();
|
|
|
|
$link->click();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$read = $this->waitForArticlesMarkRead();
|
|
|
|
$this->assertTrue($read, 'there are still unread articles');
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2015-03-08 12:56:59 +01:00
|
|
|
$this->expectedCounterPage = 120;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = 2;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkFeedRead', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testMarkFeedReadBottomLink()
|
|
|
|
{
|
2015-03-08 12:56:59 +01:00
|
|
|
// load different fixture and reload the page
|
|
|
|
$backupDataTester = static::$databaseTester;
|
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
static::$databaseTester = null;
|
2015-03-08 12:56:59 +01:00
|
|
|
|
|
|
|
$dataset = $this->getDataSet('fixture_feed1_extra_long', 'fixture_feed2');
|
|
|
|
$this->getDatabaseTester($dataset)->onSetUp();
|
|
|
|
|
|
|
|
static::$databaseTester = $backupDataTester;
|
|
|
|
$this->refresh();
|
|
|
|
|
|
|
|
// start the "real" test
|
2014-12-04 18:20:15 +01:00
|
|
|
$link = $this->getLinkFeedMarkReadBottom();
|
|
|
|
$link->click();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$read = $this->waitForArticlesMarkRead();
|
|
|
|
$this->assertTrue($read, 'there are still unread articles');
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2015-03-08 12:56:59 +01:00
|
|
|
$this->expectedCounterPage = 120;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = 2;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_MarkFeedRead', 'fixture_feed2');
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
public function testUnreadCounterFromNothingToValue()
|
|
|
|
{
|
|
|
|
// load different fixture and reload the page
|
|
|
|
$backupDataTester = static::$databaseTester;
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
static::$databaseTester = null;
|
2015-01-15 02:01:54 +01:00
|
|
|
|
|
|
|
$dataset = $this->getDataSet('fixture_OnlyReadArticles');
|
|
|
|
$this->getDatabaseTester($dataset)->onSetUp();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
static::$databaseTester = $backupDataTester;
|
|
|
|
$this->refresh();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
// start the "real" test
|
|
|
|
// dont't trust the name! The Article is read+bookmarked here
|
|
|
|
$article = $this->getArticleUnreadBookmarked();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
$link = $this->getLinkReadStatusToogle($article);
|
|
|
|
$link->click();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->waitForIconMarkReadInvisible($article);
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
|
|
|
$this->expectedCounterUnread = 1;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('fixture_OneUnreadArticle');
|
2014-11-15 14:32:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testUnreadCounterFromValueToNothing()
|
|
|
|
{
|
|
|
|
// load different fixture and reload the page
|
|
|
|
$backupDataTester = static::$databaseTester;
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
static::$databaseTester = null;
|
2015-01-15 02:01:54 +01:00
|
|
|
|
|
|
|
$dataset = $this->getDataSet('fixture_OneUnreadArticle');
|
|
|
|
$this->getDatabaseTester($dataset)->onSetUp();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
static::$databaseTester = $backupDataTester;
|
|
|
|
$this->refresh();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
// start the "real" test
|
|
|
|
$article = $this->getArticleUnreadBookmarked();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
$link = $this->getLinkReadStatusToogle($article);
|
|
|
|
$link->click();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->waitForIconMarkReadVisible($article);
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterPage = static::DEFAULT_COUNTER_PAGE;
|
|
|
|
$this->expectedCounterUnread = '';
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('fixture_OnlyReadArticles');
|
2014-11-15 14:32:31 +01:00
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
public function testRedirectWithZeroArticles()
|
|
|
|
{
|
|
|
|
$articles = $this->getArticles();
|
|
|
|
$this->assertGreaterThanOrEqual(1, count($articles), 'no articles found');
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
foreach ($articles as $article) {
|
2014-12-04 18:20:15 +01:00
|
|
|
$link = $this->getLinkRemove($article);
|
|
|
|
$link->click();
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$this->waitForArticleInvisible($article);
|
|
|
|
}
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2014-12-04 18:20:15 +01:00
|
|
|
$visible = $this->waitForAlert();
|
|
|
|
$this->assertTrue($visible, 'alert box did not appear');
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
$this->expectedCounterPage = null;
|
2014-11-15 14:32:31 +01:00
|
|
|
$this->expectedCounterUnread = 2;
|
2015-01-15 02:01:54 +01:00
|
|
|
$this->expectedDataSet = $this->getDataSet('expected_FirstFeedAllRemoved', 'fixture_feed2');
|
2015-01-04 22:25:28 +01:00
|
|
|
|
2016-04-18 01:44:45 +02:00
|
|
|
$this->ignorePageTitle = true;
|
2014-12-04 18:20:15 +01:00
|
|
|
}
|
|
|
|
}
|