diff --git a/.github/helpers/docker-compose.selenium.yml b/.github/helpers/docker-compose.selenium.yml index d7a76f44a9..338d9e0b04 100644 --- a/.github/helpers/docker-compose.selenium.yml +++ b/.github/helpers/docker-compose.selenium.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 482c327bff..264ba65963 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/src/hct_mis_api/apps/payment/api/views.py b/src/hct_mis_api/apps/payment/api/views.py index 71e753447f..77f0662075 100644 --- a/src/hct_mis_api/apps/payment/api/views.py +++ b/src/hct_mis_api/apps/payment/api/views.py @@ -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: diff --git a/tests/selenium/grievance/grievance_dashboard/test_grievance_dashboard.py b/tests/selenium/grievance/grievance_dashboard/test_grievance_dashboard.py index fc952d23f1..69443d6489 100644 --- a/tests/selenium/grievance/grievance_dashboard/test_grievance_dashboard.py +++ b/tests/selenium/grievance/grievance_dashboard/test_grievance_dashboard.py @@ -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() diff --git a/tests/selenium/managerial_console/test_managerial_console.py b/tests/selenium/managerial_console/test_managerial_console.py index d49a4011b8..175e06a605 100644 --- a/tests/selenium/managerial_console/test_managerial_console.py +++ b/tests/selenium/managerial_console/test_managerial_console.py @@ -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() diff --git a/tests/selenium/payment_verification/test_payment_verification.py b/tests/selenium/payment_verification/test_payment_verification.py index f6438ebe5b..31505e9db8 100644 --- a/tests/selenium/payment_verification/test_payment_verification.py +++ b/tests/selenium/payment_verification/test_payment_verification.py @@ -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, diff --git a/tests/selenium/programme_population/test_periodic_data_templates.py b/tests/selenium/programme_population/test_periodic_data_templates.py index 8e587a16a0..38bf6d782f 100644 --- a/tests/selenium/programme_population/test_periodic_data_templates.py +++ b/tests/selenium/programme_population/test_periodic_data_templates.py @@ -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, diff --git a/tests/selenium/targeting/test_targeting.py b/tests/selenium/targeting/test_targeting.py index ea671d4eb4..3b5d0202fc 100644 --- a/tests/selenium/targeting/test_targeting.py +++ b/tests/selenium/targeting/test_targeting.py @@ -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,