Skip to content

Commit ac7a1aa

Browse files
committed
[fix] Fix selenium tests and css
1 parent 7b23798 commit ac7a1aa

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

openwisp_monitoring/device/static/monitoring/css/floorplan.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
z-index: 9998;
88
display: flex;
99
justify-content: center;
10-
align-items: center;
1110
pointer-events: auto;
1211
}
1312
#floorplan-container {
1413
position: relative;
14+
top: 5%;
1515
width: 90%;
1616
height: 80%;
1717
background: white;
@@ -88,7 +88,7 @@
8888
#floorplan-navigation {
8989
position: absolute;
9090
left: 50%;
91-
bottom: -57px;
91+
bottom: -65px;
9292
transform: translateX(-50%);
9393
height: auto;
9494
z-index: 9999;

openwisp_monitoring/tests/test_selenium.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,7 @@ def test_filtering_on_device_popup(self):
351351
sleep(0.5)
352352
table_entries = self.find_elements(By.CSS_SELECTOR, ".map-detail tbody tr")
353353
self.assertEqual(len(table_entries), 1)
354-
self.assertIn(
355-
"Test-Device2",
356-
table_entries[0].text,
357-
)
354+
self.assertIn(d2.name,table_entries[0].text)
358355
health_ok.click()
359356
self.wait_for_invisibility(
360357
By.CSS_SELECTOR, ".map-detail .ow-loading-spinner"
@@ -372,7 +369,7 @@ def test_filtering_on_device_popup(self):
372369
sleep(0.5)
373370
table_entries = self.find_elements(By.CSS_SELECTOR, ".map-detail tbody tr")
374371
self.assertEqual(len(table_entries), 1)
375-
self.assertIn("Test-Device1", table_entries[0].text)
372+
self.assertIn(d1.name, table_entries[0].text)
376373

377374
with self.subTest("Test filtering to get no results"):
378375
input_field.clear()
@@ -423,23 +420,23 @@ def test_floorplan_overlay(self):
423420
self.assertIsNotNone(canvases)
424421

425422
with self.subTest("Test floorplan navigation"):
426-
up_arrow = self.find_element(
427-
By.CSS_SELECTOR, "#floorplan-navigation .up-arrow"
423+
right_arrow = self.find_element(
424+
By.CSS_SELECTOR, "#floorplan-navigation .right-arrow"
428425
)
429-
up_arrow.click()
426+
right_arrow.click()
430427
floor_heading = self.find_element(By.CSS_SELECTOR, "#floorplan-heading")
431-
self.assertIn("2nd Floor", floor_heading.text)
428+
self.assertIn("2nd floor", floor_heading.text.lower())
432429
canvases = self.find_elements(
433430
By.CSS_SELECTOR, "#floor-content-2 canvas", timeout=5
434431
)
435432
self.assertIsNotNone(canvases)
436433

437-
down_arrow = self.find_element(
438-
By.CSS_SELECTOR, "#floorplan-navigation .down-arrow"
434+
left_arrow = self.find_element(
435+
By.CSS_SELECTOR, "#floorplan-navigation .left-arrow"
439436
)
440-
down_arrow.click()
437+
left_arrow.click()
441438
floor_heading = self.find_element(By.CSS_SELECTOR, "#floorplan-heading")
442-
self.assertIn("1st Floor", floor_heading.text)
439+
self.assertIn("1st floor", floor_heading.text.lower())
443440
canvases = self.find_elements(
444441
By.CSS_SELECTOR, "#floor-content-1 canvas", timeout=5
445442
)
@@ -450,7 +447,7 @@ def test_floorplan_overlay(self):
450447
)
451448
second_floor_btn.click()
452449
floor_heading = self.find_element(By.CSS_SELECTOR, "#floorplan-heading")
453-
self.assertIn("2nd Floor", floor_heading.text)
450+
self.assertIn("2nd floor", floor_heading.text.lower())
454451
canvases = self.find_elements(
455452
By.CSS_SELECTOR, "#floor-content-2 canvas", timeout=5
456453
)

0 commit comments

Comments
 (0)