diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-07-31 20:08:58 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-07-31 20:08:58 +0200 |
commit | d51c67440ef811082cb7e5ec9833d1511fceca54 (patch) | |
tree | 98f5a2da20fa901bc1bbd065244165b108938168 /tests | |
parent | ef132e1531858fdf0189751fd2f5de13df688358 (diff) | |
download | forums-d51c67440ef811082cb7e5ec9833d1511fceca54.tar forums-d51c67440ef811082cb7e5ec9833d1511fceca54.tar.gz forums-d51c67440ef811082cb7e5ec9833d1511fceca54.tar.bz2 forums-d51c67440ef811082cb7e5ec9833d1511fceca54.tar.xz forums-d51c67440ef811082cb7e5ec9833d1511fceca54.zip |
[ticket/14484] Properly enable extensions in UI tests
PHPBB3-14484
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_framework/phpbb_ui_test_case.php | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php index 64ad753dfb..e8b230ecbe 100644 --- a/tests/test_framework/phpbb_ui_test_case.php +++ b/tests/test_framework/phpbb_ui_test_case.php @@ -284,20 +284,27 @@ class phpbb_ui_test_case extends phpbb_test_case $ext_path = str_replace('/', '%2F', $extension); - self::$webDriver->get('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); - $this->assertNotEmpty(count(self::find_element('className', 'submit-buttons'))); + $this->visit('adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=' . $ext_path . '&sid=' . $this->sid); + $this->assertNotEmpty(count(self::find_element('cssSelector', '.submit-buttons'))); - self::find_element('cssSelector', "input[value='Enable'")->submit(); + self::find_element('cssSelector', "input[value='Enable']")->submit(); $this->add_lang('acp/extensions'); - $meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]'); - - // Wait for extension to be fully enabled - while (sizeof($meta_refresh)) + try { - preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match); - self::$webDriver->execute(array('method' => 'post', 'url' => $match[1])); $meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]'); + + // Wait for extension to be fully enabled + while (sizeof($meta_refresh)) + { + preg_match('#url=.+/(adm+.+)#', $meta_refresh->getAttribute('content'), $match); + self::$webDriver->execute(array('method' => 'post', 'url' => $match[1])); + $meta_refresh = self::find_element('cssSelector', 'meta[http-equiv="refresh"]'); + } + } + catch (\Facebook\WebDriver\Exception\NoSuchElementException $e) + { + // Probably no refresh triggered } $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', self::find_element('cssSelector', 'div.successbox')->getText()); @@ -523,6 +530,8 @@ class phpbb_ui_test_case extends phpbb_test_case { $this->add_lang('ucp'); + self::$webDriver->manage()->deleteAllCookies(); + $this->visit('ucp.php'); $this->assertContains($this->lang('LOGIN_EXPLAIN_UCP'), self::$webDriver->getPageSource()); |