From 82f051d34df72cbf4f9983d46ce55d77f1549db3 Mon Sep 17 00:00:00 2001 From: Aryamanz29 Date: Sun, 28 May 2023 17:26:31 +0530 Subject: [PATCH] [fix] Fixed non-admin view visualizer disappears on resizing the window #193 Fixes #193 --- .../static/netjsongraph/css/style.css | 4 +++ .../tests/test_selenium.py | 26 ------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/openwisp_network_topology/static/netjsongraph/css/style.css b/openwisp_network_topology/static/netjsongraph/css/style.css index c7dad539..216f7208 100644 --- a/openwisp_network_topology/static/netjsongraph/css/style.css +++ b/openwisp_network_topology/static/netjsongraph/css/style.css @@ -62,6 +62,10 @@ box-sizing: border-box; } +.djnjg-overlay { + position: fixed !important; +} + .djnjg-overlay .closeBtn { border: none; outline: none; diff --git a/openwisp_network_topology/tests/test_selenium.py b/openwisp_network_topology/tests/test_selenium.py index 392d14ad..c85cc3a9 100644 --- a/openwisp_network_topology/tests/test_selenium.py +++ b/openwisp_network_topology/tests/test_selenium.py @@ -1,13 +1,10 @@ -from django.conf import settings from django.contrib.staticfiles.testing import StaticLiveServerTestCase from django.urls import reverse -from selenium import webdriver from selenium.common.exceptions import ( ElementClickInterceptedException, TimeoutException, ) from selenium.webdriver.common.by import By -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.common.keys import Keys from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait @@ -40,29 +37,6 @@ class TestTopologyGraphVisualizer( def prefix(self): return f'admin:{self.app_label}' - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.web_driver.quit() - # Workaround for https://github.com/openwisp/openwisp-network-topology/issues/193 - # The "automation" info-bar causes the visualizer to error. - # TODO: Remove this when the bug is fixed. - chrome_options = webdriver.ChromeOptions() - if getattr(settings, 'SELENIUM_HEADLESS', True): - chrome_options.add_argument('--headless') - chrome_options.add_argument('--window-size=1366,768') - chrome_options.add_argument('--ignore-certificate-errors') - chrome_options.add_argument('--remote-debugging-port=9222') - # Disable the info-bar in chrome browser - chrome_options.add_experimental_option("useAutomationExtension", False) - chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"]) - capabilities = DesiredCapabilities.CHROME - capabilities['goog:loggingPrefs'] = {'browser': 'ALL'} - cls.web_driver = webdriver.Chrome( - options=chrome_options, - desired_capabilities=capabilities, - ) - def setUp(self): org = self._create_org() self.admin = self._create_admin(