Skip to content

Commit cf50319

Browse files
committed
[fix] Fixed tests
1 parent 2e2c5e2 commit cf50319

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
uses: openwisp/openwisp-utils/.github/actions/retry-command@master
7979
with:
8080
delay_seconds: 30
81-
max_attempts: 5
81+
max_attempts: 1
8282
# The auto-install script installs docker-openwisp by default in
8383
# /opt/openwisp/docker-openwisp. To ensure the test runs correctly
8484
# and environment variables remain intact, it is essential to

tests/runtests.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,13 @@ def test_create_prefix_users(self):
309309
prefix_pdf_file_path = self.base_driver.find_element(
310310
By.XPATH, '//a[text()="Download User Credentials"]'
311311
).get_property("href")
312-
reqHeader = {
313-
"Cookie": f"sessionid={self.base_driver.get_cookies()[0]['value']}"
314-
}
312+
reqHeader = {}
313+
for cookies in self.base_driver.get_cookies():
314+
if cookies["name"] == "sessionid":
315+
reqHeader = {
316+
"Cookie": f"sessionid={cookies['value']}"
317+
}
318+
break
315319
curlRequest = request.Request(prefix_pdf_file_path, headers=reqHeader)
316320
try:
317321
if request.urlopen(curlRequest, context=self.ctx).getcode() != 200:
@@ -394,6 +398,7 @@ def test_websocket_marker(self):
394398
By.CLASS_NAME, "leaflet-marker-icon", wait_for="presence"
395399
)
396400
)
401+
import ipdb; ipdb.set_trace()
397402
self.assertEqual(mark, 1)
398403

399404
def test_add_superuser(self):
@@ -570,3 +575,7 @@ def test_containers_down(self):
570575

571576
if __name__ == "__main__":
572577
unittest.main(verbosity=2)
578+
# suite = unittest.TestSuite()
579+
# suite.addTest(TestServices("test_forgot_password"))
580+
# runner = unittest.TextTestRunner(verbosity=2)
581+
# runner.run(suite)

0 commit comments

Comments
 (0)