koel/tests/e2e/DefaultsTest.php

32 lines
973 B
PHP
Raw Normal View History

2016-11-15 10:03:59 +00:00
<?php
namespace E2E;
class KoelTest extends TestCase
{
public function testDefaults()
{
static::assertContains('Koel', $this->driver->getTitle());
$formSelector = '#app > div.login-wrapper > form';
// Our login form should be there.
static::assertCount(1, $this->els($formSelector));
// We submit rubbish and expect an error class on the form.
2016-11-23 13:22:47 +00:00
$this->login('foo@bar.com', 'ThisIsWongOnSoManyLevels')
->waitUntilSeen("$formSelector.error");
2016-11-15 10:03:59 +00:00
// Now we submit good stuff and make sure we're in.
2016-11-23 13:22:47 +00:00
$this->login()
->waitUntilTextSeenIn('Koel Admin', '#userBadge > a.view-profile.control > span');
2016-11-15 10:03:59 +00:00
// Default URL must be Home
static::assertEquals($this->url.'/#!/home', $this->driver->getCurrentURL());
// While we're at this, test logging out as well.
$this->click('#userBadge > a.logout');
2016-11-23 13:22:47 +00:00
$this->waitUntilSeen($formSelector);
2016-11-15 10:03:59 +00:00
}
}