Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/e2e/helpdesk/forms/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 3 additions & 10 deletions tests/e2e/helpdesk/forms/test_async_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,25 @@
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)

assert len(result) > 0
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}"}

Expand All @@ -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

Expand Down
13 changes: 3 additions & 10 deletions tests/e2e/helpdesk/forms/test_sync_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,25 @@
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)

assert len(result) > 0
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}"}

Expand All @@ -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

Expand Down
Loading