adminUser = $this->drupalCreateUser(static::$adminUserPermissions); $this->nonAdminUser = $this->drupalCreateUser([]); // Start off logged in as admin. $this->drupalLogin($this->adminUser); $this->storage = $this->container->get('entity_type.manager')->getStorage('media'); } /** * Waits and asserts that a given element is visible. * * @param string $selector * The CSS selector. * @param int $timeout * (Optional) Timeout in milliseconds, defaults to 1000. * @param string $message * (Optional) Message to pass to assertJsCondition(). */ protected function waitUntilVisible($selector, $timeout = 1000, $message = '') { $condition = "jQuery('" . $selector . ":visible').length > 0"; $this->assertJsCondition($condition, $timeout, $message); } }