Fix few issues found in menu rendering code and GUI test cases

This commit is contained in:
Aditya Toshniwal 2024-11-14 14:49:07 +05:30
parent 296befc881
commit 9a8d520abd
6 changed files with 11 additions and 4 deletions

View File

@ -73,6 +73,10 @@ define('pgadmin.node.server', [
this.initialized = true;
pgBrowser.add_menu_category({
name: 'server', label: gettext('Server'), priority: 1
});
pgBrowser.add_menus([{
name: 'create_server_on_sg', node: 'server_group', module: this,
applies: ['object', 'context'], callback: 'show_obj_properties',

View File

@ -49,8 +49,8 @@ export default class MainMenuFactory {
MAIN_MENUS.forEach((_menu) => {
let menuObj = Menu.create(_menu.name, _menu.label, _menu.id, _menu.index, _menu.addSeprator, _menu.hasDynamicMenuItems);
pgAdmin.Browser.MainMenus.push(menuObj);
// Don't add menuItems for Object menu as it's menuItems get changed on tree selection.
if(_menu.name !== 'object') {
// Don't add menuItems for hasDynamicMenuItems true as it's menuItems get changed on tree selection.
if(!_menu.hasDynamicMenuItems) {
menuObj.clearMenuItems();
menuObj.addMenuItems(MainMenuFactory.createMenuItems(pgAdmin.Browser.all_menus_cache[_menu.name]));
}

View File

@ -314,6 +314,7 @@ define('pgadmin.browser', [
add_menu_category: function({name, ...options}) {
this.menu_categories[name] = {
name: name,
label: '(No Label)',
priority: 10,
icon: '',

View File

@ -44,7 +44,6 @@ export default class SearchObjectModule {
enable: this.search_objects_enabled,
priority: 3,
label: gettext('Search Objects...'),
below: true,
data: {
data_disabled: gettext('Please select a database from the object explorer to search the database objects.'),
},

View File

@ -9,6 +9,7 @@
import sys
import secrets
import time
from regression.python_test_utils import test_utils
from regression.feature_utils.locators import BrowserToolBarLocators
@ -86,6 +87,7 @@ class BrowserToolBarFeatureTest(BaseFeatureTest):
table_node = self.page.check_if_element_exists_with_scroll(
TreeAreaLocators.table_node(self.test_table_name))
table_node.click()
time.sleep(2)
self.assertTrue(self.page.retry_click(
(By.CSS_SELECTOR,

View File

@ -1253,7 +1253,8 @@ class PgadminPage:
WebDriverWait(self.driver, 10).until(
EC.visibility_of_element_located(verify_locator))
click_status = True
except Exception:
except Exception as e:
print(e)
attempt += 1
return click_status