Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium: Fix for Kobo CI tests #4110

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def getErrorsContainer(self) -> WebElement:
return self.wait_for(self.errorsContainer)

def buttonImportFileIsEnabled(self, timeout: int = 30) -> bool:
for _ in range(timeout):
for i in range(timeout):
print(self.getButtonImportFile().is_enabled())
self.screenshot(str(i))
if self.getButtonImportFile().is_enabled(): # type: ignore
return True
sleep(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def test_import_empty_kobo_form(
pageRegistrationDataImport.getButtonImportFile().click()
pageRegistrationDataImport.checkAlert("Cannot import empty form")

@pytest.mark.skip(reason="Kobo form is not available. This is a external service, we cannot control it.")
@pytest.mark.vcr(ignore_localhost=True, ignore_hosts=["elasticsearch"])
def test_import_kobo_form(
self,
Expand All @@ -254,7 +253,7 @@ def test_import_kobo_form(
pageRegistrationDataImport.getKoboProjectSelect().click()
pageRegistrationDataImport.select_listbox_element("UNICEF NGA Education").click()

assert pageRegistrationDataImport.buttonImportFileIsEnabled(timeout=300)
assert pageRegistrationDataImport.buttonImportFileIsEnabled(timeout=60)
assert "1" in pageRegistrationDataImport.getNumberOfHouseholds().text
assert "2" in pageRegistrationDataImport.getNumberOfIndividuals().text

Expand Down
2 changes: 1 addition & 1 deletion compose.selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
command: |
sh -c "
waitforit -host=db_selenium -port=5432 -timeout=30 &&
pytest -svvv selenium_tests --html-report=./report/report.html
pytest -svvv -k test_import_kobo_form selenium_tests --html-report=./report/report.html
"
ports:
- "8080:8080"
Expand Down
2 changes: 1 addition & 1 deletion deployment/docker-compose.selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
command: |
bash -c "
waitforit -host=db -port=5432 -timeout=30
pytest -svvv selenium_tests --cov-report xml:./coverage.xml --html-report=./report/report.html --randomly-seed=42
pytest -svvv -k test_import_kobo_form selenium_tests --cov-report xml:./coverage.xml --html-report=./report/report.html --randomly-seed=42
"
depends_on:
db:
Expand Down
Loading