Skip to content

Commit

Permalink
[tests] Fixed flaky selenium test: test_unsaved_changes #902
Browse files Browse the repository at this point in the history
Fixes #902
  • Loading branch information
nemesifier committed Aug 2, 2024
1 parent 16a396a commit e544242
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openwisp_controller/config/tests/test_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,15 @@ def test_unsaved_changes(self):
self.fail('Unsaved changes alert displayed without any change')

with self.subTest('Alert should be displayed after making changes'):
# simulate hand gestures
self.web_driver.find_element(by=By.TAG_NAME, value='body').click()
self.web_driver.find_element(by=By.NAME, value='name').click()
# set name
self.web_driver.find_element(by=By.NAME, value='name').send_keys(
'new.device.name'
)
# simulate hand gestures
self.web_driver.find_element(by=By.TAG_NAME, value='body').click()
self.web_driver.refresh()
try:
WebDriverWait(self.web_driver, 1).until(EC.alert_is_present())
Expand Down

0 comments on commit e544242

Please sign in to comment.