Skip to content

Commit

Permalink
[ci/tests] Update travis & testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
atb00ker committed Aug 2, 2020
1 parent 47a4102 commit e29461e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
os: linux
dist: xenial
dist: bionic
services: docker
language: python
python: 3.7
Expand All @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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/',
Expand Down Expand Up @@ -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)

Expand Down
17 changes: 17 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit e29461e

Please sign in to comment.