Skip to content

Commit

Permalink
Selenium - feedback (#3694)
Browse files Browse the repository at this point in the history
* Added fixture

* Smoke tests added

* Added tests

* Enebale tests

* Test Automation: Fixed locator for Grievance

* Added tests; black & isort & flake8 & mypy.

* Fixed tests

* Fixed BA creation in conftest.py
  • Loading branch information
szymon-kellton authored Mar 21, 2024
1 parent 56c1c60 commit 04f915d
Show file tree
Hide file tree
Showing 11 changed files with 566 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"area": "",
"language": "",
"consent": true,
"created_by": "4196c2c5-c2dd-48d2-887f-3a9d39e78916",
"linked_grievance": null,
"program": "de3a43bf-a755-41ff-a5c0-acd02cf3d244"
"linked_grievance": null
}
},
{
Expand All @@ -38,9 +36,7 @@
"area": "",
"language": "",
"consent": false,
"created_by": "4196c2c5-c2dd-48d2-887f-3a9d39e78916",
"linked_grievance": null,
"program": "de3a43bf-a755-41ff-a5c0-acd02cf3d244"
"linked_grievance": null
}
}
]
17 changes: 17 additions & 0 deletions backend/hct_mis_api/apps/core/fixtures/data-selenium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[{
"model": "core.datacollectingtype",
"pk": 1,
"fields": {
"created": "2023-09-25T17:57:16.284Z",
"modified": "2023-09-25T17:57:16.284Z",
"label": "Full_TEST",
"code": "full_test",
"description": "Full individual collected",
"active": true,
"individual_filters_available": true,
"household_filters_available": true,
"compatible_types": [],
"limit_to": []
}
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@
"model": "household.individualidentity",
"pk": 7,
"fields": {
"partner": 1,
"individual": "bc5a5b20-74a4-4d48-ab63-99a0c913850d",
"number": "johniak pany",
"country": "d1eb1574-8146-4c70-a804-caf163d451a6"
Expand Down
20 changes: 20 additions & 0 deletions backend/selenium_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
from _pytest.nodes import Item
from _pytest.runner import CallInfo
from page_object.admin_panel.admin_panel import AdminPanel
from page_object.grievance.details_feedback_page import FeedbackDetailsPage
from page_object.grievance.feedback import Feedback
from page_object.grievance.new_feedback import NewFeedback
from page_object.programme_details.programme_details import ProgrammeDetails
from page_object.programme_management.programme_management import ProgrammeManagement
from pytest_django.live_server_helper import LiveServer
Expand Down Expand Up @@ -89,10 +92,26 @@ def pageAdminPanel(request: FixtureRequest, browser: Chrome) -> AdminPanel:
yield AdminPanel(browser)


@pytest.fixture
def pageFeedback(request: FixtureRequest, browser: Chrome) -> Feedback:
yield Feedback(browser)


@pytest.fixture
def pageFeedbackDetails(request: FixtureRequest, browser: Chrome) -> FeedbackDetailsPage:
yield FeedbackDetailsPage(browser)


@pytest.fixture
def pageNewFeedback(request: FixtureRequest, browser: Chrome) -> NewFeedback:
yield NewFeedback(browser)


@pytest.fixture
def business_area() -> BusinessArea:
business_area, _ = BusinessArea.objects.get_or_create(
**{
"pk": "c259b1a0-ae3a-494e-b343-f7c8eb060c68",
"code": "0060",
"name": "Afghanistan",
"long_name": "THE ISLAMIC REPUBLIC OF AFGHANISTAN",
Expand Down Expand Up @@ -131,6 +150,7 @@ def create_super_user(business_area: BusinessArea) -> User:
country = Country.objects.get(name="Afghanistan")
business_area.countries.add(country)
user = UserFactory.create(
pk="4196c2c5-c2dd-48d2-887f-3a9d39e78916",
is_superuser=True,
is_staff=True,
username="superuser",
Expand Down
Loading

0 comments on commit 04f915d

Please sign in to comment.