From e29461e27907ddec5fdf4d60dfc08aca103d3399 Mon Sep 17 00:00:00 2001 From: Ajay Tripathi Date: Sun, 2 Aug 2020 02:02:14 +0530 Subject: [PATCH] [ci/tests] Update travis & testcase --- .travis.yml | 6 +++--- setup.cfg | 3 --- tests/runtests.py | 12 ++++++------ tests/utils.py | 17 +++++++++++++++++ 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 251c8c02..fc25c219 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ --- os: linux -dist: xenial +dist: bionic services: docker language: python python: 3.7 @@ -12,8 +12,8 @@ branches: before_script: - sudo apt update - - sudo apt --yes install google-chrome-stable=73.0.3683.86-1 - - wget https://chromedriver.storage.googleapis.com/73.0.3683.68/chromedriver_linux64.zip + - sudo apt --yes install google-chrome-stable=83.0.4103.116-1 + - wget https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip - unzip chromedriver_linux64.zip -d /home/travis/bin jobs: diff --git a/setup.cfg b/setup.cfg index e217f40d..02ad7f50 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,5 @@ [isort] line_length=88 -diff = 1 -check_only = 1 -recursive = 1 multi_line_output=3 use_parentheses=True include_trailing_comma=True diff --git a/tests/runtests.py b/tests/runtests.py index a9f5de29..db949ab2 100644 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -8,7 +8,6 @@ from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.chrome.options import Options as ChromiumOptions from selenium.webdriver.common.desired_capabilities import DesiredCapabilities - from utils import TestConfig, TestUtilities @@ -185,7 +184,11 @@ def test_console_errors(self): '/accounts/password/reset/', '/admin/config/device/add/', '/admin/config/template/add/', + '/admin/openwisp_radius/radiuscheck/add/', '/admin/openwisp_radius/radiusgroup/add/', + '/admin/openwisp_radius/radiusbatch/add/', + '/admin/openwisp_radius/nas/add/', + '/admin/openwisp_radius/radiusreply/', '/admin/geo/floorplan/add/', '/admin/topology/link/add/', '/admin/topology/node/add/', @@ -232,13 +235,10 @@ def test_websocket_marker(self): self.get_resource( location_name, '/admin/geo/location/', driver=self.second_driver ) + self.base_driver.find_element_by_name('is_mobile').click() mark = len(self.base_driver.find_elements_by_class_name('leaflet-marker-icon')) self.assertEqual(mark, 0) - self.second_driver.find_element_by_class_name( - 'leaflet-draw-draw-marker' - ).click() - self.second_driver.find_element_by_id('id_geometry-map').click() - self.second_driver.find_element_by_name('_save').click() + self.add_mobile_location_point(location_name, driver=self.second_driver) mark = len(self.base_driver.find_elements_by_class_name('leaflet-marker-icon')) self.assertEqual(mark, 1) diff --git a/tests/utils.py b/tests/utils.py index b676203a..c88aa43e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -160,6 +160,23 @@ def create_mobile_location(self, location_name, driver=None): self.objects_to_delete.append(driver.current_url) driver.get('{}/admin/geo/location/'.format(self.config['app_url'])) + def add_mobile_location_point(self, location_name, driver=None): + """ + Adds a point on map for an existing mobile location. + Argument: + location_name: location to use for operation + driver: selenium driver (default: cls.base_driver) + """ + if not driver: + driver = self.base_driver + self.get_resource(location_name, '/admin/geo/location/', driver=driver) + driver.find_element_by_name('is_mobile').click() + driver.find_element_by_class_name('leaflet-draw-draw-marker').click() + driver.find_element_by_id('id_geometry-map').click() + driver.find_element_by_name('is_mobile').click() + driver.find_element_by_name('_save').click() + self.get_resource(location_name, '/admin/geo/location/', driver=driver) + def create_network_topology( self, label='automated-selenium-test-01',