2016-11-15 10:03:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace E2E;
|
|
|
|
|
|
|
|
use Facebook\WebDriver\WebDriverBy;
|
|
|
|
|
|
|
|
class AlbumsScreenTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testAlbumsScreen()
|
|
|
|
{
|
2016-11-23 13:22:47 +00:00
|
|
|
$this->loginAndGoTo('albums');
|
2016-11-15 10:03:59 +00:00
|
|
|
|
|
|
|
static::assertNotEmpty($this->els('#albumsWrapper .albums article.item'));
|
|
|
|
$firstAlbum = $this->el('#albumsWrapper .albums article.item:nth-child(1)');
|
|
|
|
static::assertNotEmpty($firstAlbum->findElement(WebDriverBy::cssSelector('.info .name'))->getText());
|
|
|
|
static::assertNotEmpty($firstAlbum->findElement(WebDriverBy::cssSelector('.info .artist'))->getText());
|
|
|
|
static::assertContains('10 songs', $firstAlbum->findElement(WebDriverBy::cssSelector('.meta'))->getText());
|
|
|
|
|
|
|
|
// test the view modes
|
2016-11-17 09:25:58 +00:00
|
|
|
$this->click('#albumsWrapper > h1.heading > span.view-modes > a.list');
|
2016-11-15 10:03:59 +00:00
|
|
|
static::assertCount(1, $this->els('#albumsWrapper > div.albums.as-list'));
|
2016-11-17 09:25:58 +00:00
|
|
|
$this->click('#albumsWrapper > h1.heading > span.view-modes > a.thumbnails');
|
2016-11-15 10:03:59 +00:00
|
|
|
static::assertCount(1, $this->els('#albumsWrapper > div.albums.as-thumbnails'));
|
|
|
|
}
|
|
|
|
}
|