diff --git a/dp_creator_ii/tests/test_app.py b/dp_creator_ii/tests/test_app.py index 27b4f19..5264a6f 100644 --- a/dp_creator_ii/tests/test_app.py +++ b/dp_creator_ii/tests/test_app.py @@ -21,29 +21,37 @@ def expect_visible(text): def expect_not_visible(text): expect(page.get_by_text(text)).not_to_be_visible() + def expect_no_error(): + expect(page.locator(".shiny-output-error")).not_to_be_attached() + page.goto(app.url) expect(page).to_have_title("DP Creator II") expect_visible(pick_dataset_text) expect_not_visible(perform_analysis_text) expect_not_visible(download_results_text) - expect_not_visible("expected str, bytes") + expect_no_error() csv_path = Path(__file__).parent / "fixtures" / "fake.csv" page.get_by_label("Choose CSV file").set_input_files(csv_path.resolve()) expect_visible("student_id") + expect_no_error() page.get_by_role("button", name="Define analysis").click() expect_not_visible(pick_dataset_text) expect_visible(perform_analysis_text) expect_not_visible(download_results_text) + expect_no_error() page.get_by_role("button", name="Download results").click() expect_not_visible(pick_dataset_text) expect_not_visible(perform_analysis_text) expect_visible(download_results_text) + expect_no_error() with page.expect_download() as download_info: page.get_by_text("Download script").click() + expect_no_error() + download = download_info.value script = download.path().read_text() assert "privacy_unit=dp.unit_of(contributions=1)" in script