openwisp/openwisp-network-topology

[bug] Visualizer disappears on resizing window for published topology

pandafy opened this issue · 1 comments

Steps to replicate

  1. Create a network topology
  2. Open http:127.0.0.1:8000/topology/ and click on the topology created in above step
  3. Resize the browser window

Expected Result
The topology visualizer appears in the resized window

Actual Result
The webpage becomes blank

network-topology-published-topology.mp4

Remove this workaround after fixing this bug

@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,
)