Skip to content

Commit

Permalink
Merge pull request #386 from localcontexts/868a26upu-fix-create-commu…
Browse files Browse the repository at this point in the history
…nity-gis-ui-testcase

#868a26upu fix failing testcase
  • Loading branch information
lc-hd authored Oct 25, 2024
2 parents 7d12280 + e6a07de commit 9b2f93d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions tests/functional/test_create_community_gis_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time
import urllib.parse
from pathlib import Path
from unittest.mock import patch

import faker
import pytest
Expand Down Expand Up @@ -53,8 +54,11 @@ def select_native_land_method_and_submit(self):
# pick NLD add boundary radio button
self.py.get(f"[data-next='{self.select_nld_add_boundary_method_path}']").click()

# submit form
self.py.get(".primary-btn").click()
# bypass validate_recaptcha on the backend when clicking this button
with patch('communities.views.validate_recaptcha') as mock_validate_recaptcha:
mock_validate_recaptcha.return_value = True
self.py.get(".primary-btn").click()
time.sleep(5)

def select_upload_shapefile_and_submit(self):
# pick upload shapefile radio button
Expand Down Expand Up @@ -103,7 +107,7 @@ def navigate_to_upload_shapefile_page(self):
self.accept_cookies()

self.fill_out_and_submit_account_creation_form()
time.sleep(5) # wait for response
time.sleep(5) # wait for response

# verify user is on select add boundary method page
assert self.select_add_boundary_method_path in self.get_current_url()
Expand Down Expand Up @@ -145,7 +149,6 @@ def test_select_native_land_digital_territory_without_share_publicly(self):
self.py.get("#community-boundary-continue-btn").click()

# verify user is on the confirm community page
time.sleep(5) # wait for ajax call to finish
assert self.dashboard in self.get_current_url()

# verify community and boundary exists with the expected values
Expand Down Expand Up @@ -195,8 +198,6 @@ def test_select_shapefile_with_share_publicly(self):
# navigate to next page
self.py.get("#community-boundary-continue-btn").click()

# wait for ajax call
time.sleep(4)
# verify user is on the dashbaord page
assert self.dashboard in self.get_current_url()

Expand Down Expand Up @@ -224,8 +225,6 @@ def test_select_shapefile_without_share_publicly(self):
# navigate to next page
self.py.get("#community-boundary-continue-btn").click()

# wait for ajax call
time.sleep(4)
# verify user is on the dashbaord page
assert self.dashboard in self.get_current_url()

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/ui_feature_testcase_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def login(self,):
# submit login
self.py.get("[class~='signin-btn']").click()

def get_current_url(self, wait_seconds: int = 8) -> str:
def get_current_url(self, wait_seconds: int = 5) -> str:
"""
* Switches to the most recent window
* Waits for a couple of seconds to make sure preexisting
Expand Down

0 comments on commit 9b2f93d

Please sign in to comment.