diff --git a/tests/e2e/helpdesk/forms/conftest.py b/tests/e2e/helpdesk/forms/conftest.py index d2020b2e..2e7cf612 100644 --- a/tests/e2e/helpdesk/forms/conftest.py +++ b/tests/e2e/helpdesk/forms/conftest.py @@ -25,9 +25,21 @@ def created_form(mpt_ops, form_data): yield form +@pytest.fixture +def created_published_form(mpt_ops, created_form): + mpt_ops.helpdesk.forms.publish(created_form.id) + return created_form + + @pytest.fixture async def async_created_form(async_mpt_ops, form_data): async with async_create_fixture_resource_and_delete( async_mpt_ops.helpdesk.forms, form_data ) as form: yield form + + +@pytest.fixture +async def async_created_published_form(async_mpt_ops, async_created_form): + await async_mpt_ops.helpdesk.forms.publish(async_created_form.id) + return async_created_form diff --git a/tests/e2e/helpdesk/forms/test_async_forms.py b/tests/e2e/helpdesk/forms/test_async_forms.py index e2356f96..b3ebc989 100644 --- a/tests/e2e/helpdesk/forms/test_async_forms.py +++ b/tests/e2e/helpdesk/forms/test_async_forms.py @@ -8,14 +8,12 @@ pytestmark = [pytest.mark.flaky] -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") async def test_get_form(async_mpt_ops, async_created_form): result = await async_mpt_ops.helpdesk.forms.get(async_created_form.id) assert result.id == async_created_form.id -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") async def test_list_forms(async_mpt_ops): result = await async_mpt_ops.helpdesk.forms.fetch_page(limit=1) @@ -23,14 +21,12 @@ async def test_list_forms(async_mpt_ops): assert all(isinstance(form, Form) for form in result) -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_create_form(async_created_form): result = async_created_form assert result is not None -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") async def test_update_form(async_mpt_ops, async_created_form, short_uuid): update_data = {"description": f"e2e update {short_uuid}"} @@ -40,21 +36,18 @@ async def test_update_form(async_mpt_ops, async_created_form, short_uuid): assert result.to_dict().get("description") == update_data["description"] -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") async def test_publish_form(async_mpt_ops, async_created_form): result = await async_mpt_ops.helpdesk.forms.publish(async_created_form.id) assert result is not None -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") -async def test_unpublish_form(async_mpt_ops, async_created_form): - result = await async_mpt_ops.helpdesk.forms.unpublish(async_created_form.id) +async def test_unpublish_form(async_mpt_ops, async_created_published_form): + result = await async_mpt_ops.helpdesk.forms.unpublish(async_created_published_form.id) - assert result is not None + assert result.status == "Unpublished" -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") async def test_delete_form(async_mpt_ops, async_created_form): await async_mpt_ops.helpdesk.forms.delete(async_created_form.id) # act diff --git a/tests/e2e/helpdesk/forms/test_sync_forms.py b/tests/e2e/helpdesk/forms/test_sync_forms.py index 26e7e76c..ec9c25a5 100644 --- a/tests/e2e/helpdesk/forms/test_sync_forms.py +++ b/tests/e2e/helpdesk/forms/test_sync_forms.py @@ -8,14 +8,12 @@ pytestmark = [pytest.mark.flaky] -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_get_form(mpt_ops, created_form): result = mpt_ops.helpdesk.forms.get(created_form.id) assert result.id == created_form.id -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_list_forms(mpt_ops): result = mpt_ops.helpdesk.forms.fetch_page(limit=1) @@ -23,14 +21,12 @@ def test_list_forms(mpt_ops): assert all(isinstance(form, Form) for form in result) -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_create_form(created_form): result = created_form assert result is not None -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_update_form(mpt_ops, created_form, short_uuid): update_data = {"description": f"e2e update {short_uuid}"} @@ -40,21 +36,18 @@ def test_update_form(mpt_ops, created_form, short_uuid): assert result.to_dict().get("description") == update_data["description"] -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_publish_form(mpt_ops, created_form): result = mpt_ops.helpdesk.forms.publish(created_form.id) assert result is not None -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") -def test_unpublish_form(mpt_ops, created_form): - result = mpt_ops.helpdesk.forms.unpublish(created_form.id) +def test_unpublish_form(mpt_ops, created_published_form): + result = mpt_ops.helpdesk.forms.unpublish(created_published_form.id) - assert result is not None + assert result.status == "Unpublished" -@pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_delete_form(mpt_ops, created_form): mpt_ops.helpdesk.forms.delete(created_form.id) # act