MetatagAvailableTokensTest.php in Metatag 8
File
tests/src/FunctionalJavascript/MetatagAvailableTokensTest.php
View source
<?php
namespace Drupal\Tests\metatag\FunctionalJavascript;
use Drupal\Core\Url;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
class MetatagAvailableTokensTest extends WebDriverTestBase {
public static $modules = [
'metatag',
'node',
];
protected $defaultTheme = 'stark';
function testNodeMetatagDefaultsPage() {
$this
->drupalLogin($this->rootUser);
$this
->drupalGet(Url::fromRoute('entity.metatag_defaults.edit_form', [
'metatag_defaults' => 'node',
]));
$page = $this
->getSession()
->getPage();
$token_dialog_link = $page
->find('css', '.token-dialog');
$token_dialog_link
->click();
$this
->assertSession()
->assertWaitOnAjaxRequest();
$token_dialog = $page
->find('css', '.token-tree-dialog');
$token_node_token = $token_dialog
->find('css', '#token-node');
$this
->assertNotEmpty($token_node_token);
}
}