Skip to content
Snippets Groups Projects
Commit d0696344 authored by Sean Adams-Hiett's avatar Sean Adams-Hiett
Browse files

Added comments to test for additional clarity.

parent b7e2dcda
No related branches found
No related tags found
No related merge requests found
......@@ -17,25 +17,32 @@ class LayoutBuilderDirectAddDropbuttonTest extends LayoutBuilderDirectAddTestBas
$this->drupalGet(static::FIELD_UI_PREFIX . '/display/default/layout');
$page = $this->getSession()->getPage();
// The basic block link should exist and be visible.
$dropbutton_action = $page->findLink('Basic block');
static::assertNotNull($dropbutton_action);
static::assertTrue($dropbutton_action->isVisible());
static::assertStringEndsWith(static::BASIC_BLOCK_HREF, $dropbutton_action->getAttribute('href'));
static::assertTrue($dropbutton_action->isVisible());
// Make sure the more option is not visible by default.
// More options should exist, but not be visible.
$dropbutton_more = $page->findLink('More options');
static::assertNotNull($dropbutton_more);
static::assertFalse($dropbutton_more->isVisible());
static::assertStringEndsWith(static::CHOOSE_BLOCK_HREF, $dropbutton_more->getAttribute('href'));
static::assertFalse($dropbutton_more->isVisible());
// Dropbutton should exist and be visible.
$dropbutton_toggle = $page->findButton('List additional actions');
static::assertNotNull($dropbutton_toggle);
static::assertTrue($dropbutton_toggle->isVisible());
// Click the dropbutton arrow.
$dropbutton_toggle->click();
// More options should be visible now.
static::assertTrue($dropbutton_more->isVisible());
// Click the dropbutton arrow again.
$dropbutton_toggle->click();
// More options should not be visible again.
static::assertFalse($dropbutton_more->isVisible());
}
......
......@@ -13,45 +13,56 @@ class LayoutBuilderDirectAddPopoverTest extends LayoutBuilderDirectAddTestBase {
* Test case for popover functionality.
*/
public function testPopover() {
// We use the label for this version.
$this->setUseLabel(1);
$this->drupalLogin($this->drupalCreateUser([], NULL, TRUE));
$this->drupalGet(static::FIELD_UI_PREFIX . '/display/default/layout');
$page = $this->getSession()->getPage();
// The link with the default label should exist and be visible.
$add_block = $page->findLink('Add block');
static::assertNotNull($add_block);
static::assertTrue($add_block->isVisible());
// Change the label.
$this->setLabel('Add a block');
$this->drupalGet(static::FIELD_UI_PREFIX . '/display/default/layout');
// The default label should no longer exist.
$add_block = $page->findLink('Add block');
static::assertNull($add_block);
// The link with the new label should exist and be visible.
$add_block = $page->findLink('Add a block');
static::assertNotNull($add_block);
static::assertTrue($add_block->isVisible());
// Basic block link should exist but not be visible.
$basic_block = $page->findLink('Basic block');
$more = $page->findLink('More options');
static::assertNotNull($basic_block);
static::assertNotNull($more);
static::assertStringEndsWith(static::BASIC_BLOCK_HREF, $basic_block->getAttribute('href'));
static::assertStringEndsWith(static::CHOOSE_BLOCK_HREF, $more->getAttribute('href'));
static::assertFalse($basic_block->isVisible());
// More options link should exist but not be visible.
$more = $page->findLink('More options');
static::assertNotNull($more);
static::assertStringEndsWith(static::CHOOSE_BLOCK_HREF, $more->getAttribute('href'));
static::assertFalse($more->isVisible());
// Click the link to show blocks.
$add_block->click();
// Basic block and more options links should be visible now.
static::assertTrue($basic_block->isVisible());
static::assertTrue($more->isVisible());
// Click the link again to hide blocks.
$add_block->click();
// Basic block and more options links should not be visible now.
static::assertFalse($basic_block->isVisible());
static::assertFalse($more->isVisible());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment