mirror of
https://github.com/koel/koel
synced 2024-12-22 10:33:16 +00:00
25 lines
1.1 KiB
PHP
25 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace E2E;
|
|
|
|
use Facebook\WebDriver\WebDriverBy;
|
|
|
|
class AlbumsScreenTest extends TestCase
|
|
{
|
|
public function testAlbumsScreen()
|
|
{
|
|
$this->loginAndWait()->goto('albums');
|
|
|
|
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
|
|
$this->click('#albumsWrapper > h1.heading > span.view-modes > a:nth-child(2)');
|
|
static::assertCount(1, $this->els('#albumsWrapper > div.albums.as-list'));
|
|
$this->click('#albumsWrapper > h1.heading > span.view-modes > a:nth-child(1)');
|
|
static::assertCount(1, $this->els('#albumsWrapper > div.albums.as-thumbnails'));
|
|
}
|
|
}
|