/** * Test the 'File management -> View / edit templates' interface * * @param \AcceptanceTester $I */ public function fileManagementViewEditTemplatesTest(\AcceptanceTester $I) { $I->wantTo("Use the 'File management -> View / edit templates' interface as the 'developer' user"); // Set up the browser $I->setCookie($this->tokenNames['authtoken'], $this->cookies[$this->tokenNames['authtoken']]); $I->setCookie($this->tokenNames['session'], $this->cookies[$this->tokenNames['session']]); $I->amOnPage('/bolt/files/themes'); // Inspect the landing page $dir = 'base-2016'; $I->see('Create folder', Locator::find('a', ['href' => '#'])); $I->see($dir, Locator::href("/bolt/files/themes/{$dir}")); $I->see("Rename {$dir}", Locator::find('a', ['href' => '#'])); $I->see("Delete {$dir}", Locator::find('a', ['href' => '#'])); // Navigate into the theme and check the results $I->click("{$dir}/", Locator::href("/bolt/files/themes/{$dir}")); $I->see('css/', Locator::href("/bolt/files/themes/{$dir}/css")); $I->see('images/', Locator::href("/bolt/files/themes/{$dir}/images")); $I->see('js/', Locator::href("/bolt/files/themes/{$dir}/js")); $I->see('theme.yml', Locator::href("/bolt/file/edit/themes/{$dir}/theme.yml")); $I->see('record.twig', Locator::href("/bolt/file/edit/themes/{$dir}/record.twig")); $I->see('index.twig', Locator::href("/bolt/file/edit/themes/{$dir}/index.twig")); // Navigate into a subdirectory $I->click('css/', Locator::href("/bolt/files/themes/{$dir}/css")); $I->see('theme.css', Locator::href("/bolt/file/edit/themes/{$dir}/css/theme.css")); }
/** * Update the database after creating the Resources Contenttype * * @param \AcceptanceTester $I */ public function updateDatabaseTest(\AcceptanceTester $I) { $I->wantTo("update the database and add the new 'Resources' Contenttype"); // Set up the browser $I->setCookie('bolt_authtoken', $this->cookies['bolt_authtoken']); $I->setCookie('bolt_session', $this->cookies['bolt_session']); $I->amOnPage('/bolt/dbcheck'); $I->see('The database needs to be updated/repaired'); $I->see('is not present'); $I->see('Update the database', Locator::find('button', array('type' => 'submit'))); $I->click('Update the database', Locator::find('button', array('type' => 'submit'))); $I->see('Modifications made to the database'); $I->see('Created table'); $I->see('Your database is now up to date'); }
public function testFind() { $xml = new SimpleXMLElement("<root><a href='#' tabindex='2'>Click Me</a></root>"); $this->assertNotEmpty($xml->xpath(Locator::find('a', array('href' => '#')))); $this->assertNotEmpty($xml->xpath(Locator::find('a', array('href', 'tabindex' => '2')))); }
/** * Update the database after creating the Resources Contenttype * * @param \AcceptanceTester $I */ public function updateDatabaseTest(\AcceptanceTester $I) { $I->wantTo("update the database and add the new 'Resources' Contenttype"); // Set up the browser $this->setLoginCookies($I); $I->amOnPage('/bolt'); $I->see('The database needs to be updated/repaired'); $I->see('Check Database', 'a'); $I->click('Check Database', 'a'); // We are now on '/bolt/dbcheck'. $I->see('is not present'); $I->see('Update the database', Locator::find('button', ['type' => 'submit'])); $I->click('Update the database', Locator::find('button', ['type' => 'submit'])); $I->see('Modifications made to the database'); $I->see('Created table'); $I->see('Your database is now up to date'); }