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

Fixed small selenium tests instability #3663

Merged
merged 4 commits into from
Mar 4, 2024
Merged
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 @@ -60,8 +60,10 @@ def test_create_programme(
pageProgrammeManagement.chooseOptionSelector(test_data["selector"])
pageProgrammeManagement.chooseOptionDataCollectingType(test_data["dataCollectingType"])
pageProgrammeManagement.getButtonNext().click()
programme_creation_url = pageProgrammeManagement.driver.current_url
pageProgrammeManagement.getButtonSave().click()
# Check Details page
assert "details" in pageProgrammeDetails.wait_for_new_url(programme_creation_url).split("/")
assert "New Programme" in pageProgrammeDetails.getHeaderTitle().text
assert "DRAFT" in pageProgrammeDetails.getProgramStatus().text
assert test_data["startDate"].date_in_text_format in pageProgrammeDetails.getLabelStartDate().text
Expand Down Expand Up @@ -115,8 +117,10 @@ def test_create_programme_optional_values(
pageProgrammeManagement.getInputPopulation().clear()
pageProgrammeManagement.getInputPopulation().send_keys(test_data["populationGoals"])
pageProgrammeManagement.getButtonNext().click()
programme_creation_url = pageProgrammeManagement.driver.current_url
pageProgrammeManagement.getButtonSave().click()
# Check Details page
assert "details" in pageProgrammeDetails.wait_for_new_url(programme_creation_url).split("/")
assert "New Programme" in pageProgrammeDetails.getHeaderTitle().text
assert "DRAFT" in pageProgrammeDetails.getProgramStatus().text
assert test_data["startDate"].date_in_text_format in pageProgrammeDetails.getLabelStartDate().text
Expand Down Expand Up @@ -245,8 +249,10 @@ def test_create_programme_check(
pageProgrammeManagement.chooseOptionDataCollectingType(test_data["dataCollectingType"])
pageProgrammeManagement.getInputCashPlus().click()
pageProgrammeManagement.getButtonNext().click()
programme_creation_url = pageProgrammeManagement.driver.current_url
pageProgrammeManagement.getButtonSave().click()
# Check Details page
assert "details" in pageProgrammeDetails.wait_for_new_url(programme_creation_url).split("/")
assert "DRAFT" in pageProgrammeDetails.getProgramStatus().text
assert test_data["startDate"].date_in_text_format in pageProgrammeDetails.getLabelStartDate().text
assert test_data["endDate"].date_in_text_format in pageProgrammeDetails.getLabelEndDate().text
Expand Down Expand Up @@ -363,8 +369,12 @@ def test_create_programme_add_partners_Business_Area(
pageProgrammeManagement.getButtonNext().click()
pageProgrammeManagement.getButtonAddPartner().click()
pageProgrammeManagement.choosePartnerOption("UNHCR")
programme_creation_url = pageProgrammeManagement.driver.current_url
pageProgrammeManagement.getButtonSave().click()
# Check Details page
assert "details" in pageProgrammeDetails.wait_for_new_url(programme_creation_url).split(
"/"
) # Check Details page
assert "UNHCR" in pageProgrammeDetails.getLabelPartnerName().text
assert "Business Area" in pageProgrammeDetails.getLabelAreaAccess().text

Expand Down Expand Up @@ -412,8 +422,10 @@ def test_create_programme_add_partners_Admin_Area(
from time import sleep

sleep(1)
programme_creation_url = pageProgrammeManagement.driver.current_url
pageProgrammeManagement.getButtonSave().click()
# Check Details page
assert "details" in pageProgrammeDetails.wait_for_new_url(programme_creation_url).split("/")
assert "UNHCR" in pageProgrammeDetails.getLabelPartnerName().text
assert "16" in pageProgrammeDetails.getLabelAreaAccess().text

Expand Down Expand Up @@ -462,8 +474,10 @@ def test_create_programme_back_scenarios(
assert "Programme name is required" in pageProgrammeManagement.getLabelProgrammeName().text
pageProgrammeManagement.getInputProgrammeName().send_keys(test_data["program_name"])
pageProgrammeManagement.getButtonNext().click()
programme_creation_url = pageProgrammeManagement.driver.current_url
pageProgrammeManagement.getButtonSave().click()
# Check Details page
assert "details" in pageProgrammeDetails.wait_for_new_url(programme_creation_url).split("/")
assert "New Programme" in pageProgrammeDetails.getHeaderTitle().text
assert "DRAFT" in pageProgrammeDetails.getProgramStatus().text
assert test_data["startDate"].date_in_text_format in pageProgrammeDetails.getLabelStartDate().text
Expand Down Expand Up @@ -505,8 +519,10 @@ def test_create_programme_chose_dates_via_calendar(
pageProgrammeManagement.chooseOptionSelector(test_data["selector"])
pageProgrammeManagement.chooseOptionDataCollectingType(test_data["dataCollectingType"])
pageProgrammeManagement.getButtonNext().click()
programme_creation_url = pageProgrammeManagement.driver.current_url
pageProgrammeManagement.getButtonSave().click()
# Check Details page
assert "details" in pageProgrammeDetails.wait_for_new_url(programme_creation_url).split("/")
assert str(datetime.now().strftime("15 %b %Y")) in pageProgrammeDetails.getLabelStartDate().text
end_date = datetime.now() + relativedelta(months=1)
assert str(end_date.strftime("25 %b %Y")) in pageProgrammeDetails.getLabelEndDate().text
Loading