Skip to content

Commit

Permalink
E2E stabilization (#4450)
Browse files Browse the repository at this point in the history
* chenged tests dir

* fixed all linter problems

* fix  precomit

* fix compose

* fixed  tests root dir

* init speed improvements

* fixes

* changes to running tests

* increased max connections in postgress compose

* changes to running tests

* changes to running tests

* global program select fix

* changes to running tests

* fixes to reassigning

* changes to running tests

* changes to running tests

* changes to running tests

* changes to running tests fixed - test_grievance_tickets_edit_tickets_from_main_grievance_pag

* changes to running tests fixed - test_create_feedback_mandatory_fields

* changes to running tests

* fixed file

* Fix countries

* linter fixes

* fixing import

* Tests fixes

* black fixes

* clean fronted

* console logs removed

* frontend fix build

* mark unstable tests

* change if to try except to avoid concurency problem

* xfail more test

* test fixes

* fixes

* xfail unstable tests

* Fix for Upload Artifact

* Fix for test_smoke_country_dashboard

* added more tests

* added more tests

* Fix e2e tests

* Black

* more fixes more tests

* added more as unstable

* E2E Test stabilisation

* Test without parallel execution

* Test without extra_options

* Fixed stability of test_managerial_console_smoke_test

* Fixed stability of test_managerial_console_smoke_test

* Delete transaction=True from pytest.mark.django_db; Fix test_payment_verification_delete

* Fix test_edit_programme

* Fix test_edit_programme

* Fix test_edit_programme

* Fix for User fixture

* Fix test_create_targeting_with_pdu_date_criteria

* Fix test_edit_programme

* Fix test_edit_programme

* Xfaile flaky tests

* Xfaile flaky tests

* Xfaile flaky tests

* Xfaile flaky tests

* add print 🖨️

* check test_create_targeting_for_normal_program

* test test_periodic_data_template_create_and_download

* test fix Upload Artifact on CI

* fix some validation msgs inconsistency

* fix tests more

* TP⛺️ Changes (Collector filters, Merge Ids) (#4279)

* init

* add tp list rest

* modify create target population add collector group

* add collector filters blocks

* add collector rule groups

* upd query and input 'collector_rules'

* remove collector ids

* handl ind hh ids in create tp

* add collector_block_filters

* upd validation 1️⃣

* upd validation and models 2️⃣

* upd CreateTargetPopulationInput 3️⃣

* update one more time input

* final upd input

* remove program_id

* add migrations refactor create TP

* fix create TP

* update schema & imports

* more adjustments

* fix tests & validation if no rules

* upd snapshot

* upd one more snapshot 🌟

* fix upd TP validation & upd snapshot ⭐

* black 🖤

* one more fix

* one more fix again

* black

* more changes

* upd input create

* black

* more changes

* upd choices

* fix table tp

* Fix test_edit_targeting

* upd filters & input

* migrations

* fix bool

* upd TargetingCollectorBlockRuleFilterNode

* fix criteria display

* add data-cy

* add label_en

* upd query and add TargetingCollectorRuleFilterBlockBase 🌟

* black & isort ⭐

* more fixes

* fix edit tp values

* upd q for collector & fix node ihd hh ids 🌟

* fix display value or empty

* fix copy tp & mypy & imports ⭐

* fix hh ind ids TPnode

* fix ids

* rm console log

* ut update createTP snapshot

* ut update 🌟

* add more tests 🌟

* imports

* skip 💯

* unskip & add order_by 💯

* Fix e2e tests part2

* e2e fix: test_create_targeting_for_normal_program 🎉

* Fix e2e tests part3

* Fix e2e tests part4

* ut: add more 🎉

* ut: add one more 🌟

* ut: DeliveryMechanism add name 🌟

* ut update: test_copy_target 🌟

* fix test name

---------

Co-authored-by: Maciej Szewczyk <[email protected]>
Co-authored-by: marekbiczysko <[email protected]>
Co-authored-by: pavlo-mk <[email protected]>
Co-authored-by: Szymon Wyderka <[email protected]>

* E2E speed improvement  (#4288)

* chenged tests dir

* fixed all linter problems

* fix  precomit

* fix compose

* fixed  tests root dir

* init speed improvements

* fixes

* changes to running tests

* increased max connections in postgress compose

* changes to running tests

* changes to running tests

* global program select fix

* changes to running tests

* fixes to reassigning

* changes to running tests

* changes to running tests

* changes to running tests

* changes to running tests fixed - test_grievance_tickets_edit_tickets_from_main_grievance_pag

* changes to running tests fixed - test_create_feedback_mandatory_fields

* changes to running tests

* fixed file

* Fix countries

* linter fixes

* fixing import

* Tests fixes

* black fixes

* clean fronted

* console logs removed

* frontend fix build

* mark unstable tests

* change if to try except to avoid concurency problem

* xfail more test

* test fixes

* fixes

* xfail unstable tests

* Fix for Upload Artifact

* Fix for test_smoke_country_dashboard

* added more tests

* added more tests

* Fix e2e tests

* Black

* more fixes more tests

* added more as unstable

* E2E Test stabilisation

* Test without parallel execution

* Test without extra_options

* Fixed stability of test_managerial_console_smoke_test

* Fixed stability of test_managerial_console_smoke_test

* Delete transaction=True from pytest.mark.django_db; Fix test_payment_verification_delete

* Fix test_edit_programme

* Fix test_edit_programme

* Fix test_edit_programme

* Fix for User fixture

* Fix test_create_targeting_with_pdu_date_criteria

* Fix test_edit_programme

* Fix test_edit_programme

* Xfaile flaky tests

* Xfaile flaky tests

* Xfaile flaky tests

* Xfaile flaky tests

* add print 🖨️

* cleanup & upd utests 🌟

* imports ⭐

---------

Co-authored-by: Szymon Wyderka <[email protected]>
Co-authored-by: szymon-kellton <[email protected]>
Co-authored-by: Pavlo Mokiichuk <[email protected]>

* test fix Upload Artifact on CI

* test fix Upload Artifact on CI

* test fix Upload Artifact on CI

* Fix test_grievance_dashboard_happy_path

* test fix Upload Artifact on CI

* test fix Upload Artifact on CI

* test fix Upload Artifact on CI

* Fix Upload Artifact on CI

* Fix test_targeting_and_labels

* Fix conftest.py

* Fix people details tests

* upd test_payment_plan_views ⭐

* e2e fix: test_targeting_and_labels

* clean up

* test with cache

---------

Co-authored-by: Jan Romaniak <[email protected]>
Co-authored-by: Jan Romaniak <[email protected]>
Co-authored-by: johniak <[email protected]>
Co-authored-by: Pavlo Mokiichuk <[email protected]>
Co-authored-by: Paulina Kujawa <[email protected]>
Co-authored-by: Maciej Szewczyk <[email protected]>
Co-authored-by: Maciej Szewczyk <[email protected]>
Co-authored-by: marekbiczysko <[email protected]>
  • Loading branch information
9 people authored Dec 11, 2024
1 parent 2a9e429 commit 20edae8
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/helpers/docker-compose.selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
backend:
volumes:
- ../../tests/test-coverage:/code/test-coverage
- ../../tests/report/:/code/tests/selenium/output_data/report/
- ../../tests/report/:/code/tests/selenium/output_data/
- type: volume
source: backend-web-app
target: /code/src/hct_mis_api/apps/web
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ jobs:
continue-on-error: true
with:
name: report
path: ./tests/selenium/output_data/
path: ./tests/report/
retention-days: 5
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
1 change: 1 addition & 0 deletions src/hct_mis_api/apps/payment/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def get_queryset(self) -> QuerySet:
program_cycle__program__in=program_ids,
)

# TODO: e2e failed probably because of cache here
@etag_decorator(PaymentPlanKeyConstructor)
@cache_response(timeout=config.REST_API_TTL, key_func=PaymentPlanKeyConstructor())
def list(self, request: Request, *args: Any, **kwargs: Any) -> Response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def test_grievance_dashboard_happy_path(
pageGrievanceDashboard: GrievanceDashboard,
pageGrievanceTickets: GrievanceTickets,
pageGrievanceDetailsPage: GrievanceDetailsPage,
download_path: str,
) -> None:
pageGrievanceTickets.getNavGrievance().click()
pageGrievanceDashboard.getNavGrievanceDashboard().click()
Expand Down
18 changes: 11 additions & 7 deletions tests/selenium/managerial_console/test_managerial_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,33 @@ def test_managerial_console_smoke_test(
pageManagerialConsole.getReleaseButton().click()

program = Program.objects.filter(name="Test Programm").first()
program_cycle = ProgramCycleFactory(program=program)
program_cycle = program.cycles.first()
ba = BusinessArea.objects.filter(slug="afghanistan").first()
user = User.objects.first()
PaymentPlanFactory(
program_cycle=program_cycle,
status=PaymentPlan.Status.IN_APPROVAL,
business_area=BusinessArea.objects.filter(slug="afghanistan").first(),
business_area=ba,
created_by=user,
)
PaymentPlanFactory(
program_cycle=program_cycle,
status=PaymentPlan.Status.IN_AUTHORIZATION,
business_area=BusinessArea.objects.filter(slug="afghanistan").first(),
business_area=ba,
created_by=user,
)
PaymentPlanFactory(
program_cycle=program_cycle,
status=PaymentPlan.Status.IN_REVIEW,
business_area=BusinessArea.objects.filter(slug="afghanistan").first(),
business_area=ba,
created_by=user,
)
PaymentPlanFactory(
program_cycle=program_cycle,
status=PaymentPlan.Status.ACCEPTED,
business_area=BusinessArea.objects.filter(slug="afghanistan").first(),
business_area=ba,
created_by=user,
)
program.save()
program.refresh_from_db()
pageManagerialConsole.getMenuUserProfile().click()
pageManagerialConsole.getMenuItemClearCache().click()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def test_payment_verification_create_verification_plan_random_sampling_manual(
assert "0" in pagePaymentVerificationDetails.getLabelSampleSize().text
assert "1" in pagePaymentVerificationDetails.getLabelNumberOfVerificationPlans().text

@pytest.mark.xfail(reason="UNSTABLE")
@pytest.mark.xfail(reason="Problem with deadlock during test - 202318")
def test_payment_verification_records(
self,
active_program: Program,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ def create_flexible_attribute(

@pytest.mark.usefixtures("login")
class TestPeriodicDataTemplates:
@pytest.mark.xfail(reason="UNSTABLE")
def test_periodic_data_template_export_and_download(
self,
clear_downloaded_files: None,
program: Program,
string_attribute: FlexibleAttribute,
pageIndividuals: Individuals,
Expand Down
2 changes: 1 addition & 1 deletion tests/selenium/targeting/test_targeting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ def test_targeting_and_labels(
assert "Copy TP" in pageTargeting.chooseTargetPopulations(0).text
pageTargeting.getColumnCreatedBy().click()
pageTargeting.disappearLoadingRows()
assert "Copy TP" in pageTargeting.chooseTargetPopulations(0).text
pageTargeting.wait_for_text("Copy TP", pageTargeting.rows)

def test_targeting_parametrized_rules_filters(
self,
Expand Down

0 comments on commit 20edae8

Please sign in to comment.