PageManagerIntegrationTest.php in Panels 8.4
File
panels_ipe/tests/src/FunctionalJavascript/PageManagerIntegrationTest.php
View source
<?php
namespace Drupal\Tests\panels_ipe\FunctionalJavascript;
class PageManagerIntegrationTest extends PanelsIPETestBase {
protected $defaultTheme = 'stark';
public static $modules = [
'panels',
'panels_ipe',
'page_manager',
'panels_ipe_page_manager_test_config',
'system',
];
protected $user1;
protected $user2;
protected function setUp() {
parent::setUp();
$this->user1 = $this
->drupalCreateUser([
'access panels in-place editing',
'administer blocks',
'administer pages',
]);
$this->user2 = $this
->drupalCreateUser([
'access panels in-place editing',
'administer blocks',
'administer pages',
]);
$this
->drupalLogin($this->user1);
$this->test_route = 'test-page';
}
public function testUserEditSession() {
$this
->visitIPERoute();
$this
->assertSession()
->elementExists('css', '.layout--onecol');
$this
->changeLayout('Columns: 2', 'layout_twocol');
$this
->assertSession()
->elementExists('css', '.layout--twocol');
$this
->assertSession()
->elementNotExists('css', '.layout--onecol');
$this
->assertSession()
->elementExists('css', '[data-tab-id="save"]');
$this
->drupalLogin($this->user2);
$this
->visitIPERoute();
$this
->assertSession()
->elementExists('css', '.layout--onecol');
$this
->assertSession()
->elementNotExists('css', '.layout--twocol');
$this
->assertSession()
->elementNotExists('css', '[data-tab-id="edit"]');
$this
->assertSession()
->elementExists('css', '[data-tab-id="locked"]');
$this
->breakLock();
$this
->assertSession()
->waitForElementVisible('css', '[data-tab-id="edit"]');
$this
->drupalLogin($this->user1);
$this
->visitIPERoute();
$this
->assertSession()
->elementExists('css', '[data-tab-id="edit"]');
$this
->assertSession()
->elementNotExists('css', '[data-tab-id="save"]');
$this
->assertSession()
->elementExists('css', '.layout--onecol');
}
}