koel/tests/e2e/ArtistsScreenTest.php

25 lines
988 B
PHP
Raw Normal View History

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