Skip to content

Commit 8fd2cbd

Browse files
committed
test(helpdesk): unskip forms e2e tests and add fixtures for published forms
1 parent 9ef1497 commit 8fd2cbd

3 files changed

Lines changed: 18 additions & 20 deletions

File tree

tests/e2e/helpdesk/forms/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,21 @@ def created_form(mpt_ops, form_data):
2525
yield form
2626

2727

28+
@pytest.fixture
29+
def created_published_form(mpt_ops, created_form):
30+
mpt_ops.helpdesk.forms.publish(created_form.id)
31+
return created_form
32+
33+
2834
@pytest.fixture
2935
async def async_created_form(async_mpt_ops, form_data):
3036
async with async_create_fixture_resource_and_delete(
3137
async_mpt_ops.helpdesk.forms, form_data
3238
) as form:
3339
yield form
40+
41+
42+
@pytest.fixture
43+
async def async_created_published_form(async_mpt_ops, async_created_form):
44+
await async_mpt_ops.helpdesk.forms.publish(async_created_form.id)
45+
return async_created_form

tests/e2e/helpdesk/forms/test_async_forms.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,25 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1211
async def test_get_form(async_mpt_ops, async_created_form):
1312
result = await async_mpt_ops.helpdesk.forms.get(async_created_form.id)
1413

1514
assert result.id == async_created_form.id
1615

1716

18-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1917
async def test_list_forms(async_mpt_ops):
2018
result = await async_mpt_ops.helpdesk.forms.fetch_page(limit=1)
2119

2220
assert len(result) > 0
2321
assert all(isinstance(form, Form) for form in result)
2422

2523

26-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
2724
def test_create_form(async_created_form):
2825
result = async_created_form
2926

3027
assert result is not None
3128

3229

33-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
3430
async def test_update_form(async_mpt_ops, async_created_form, short_uuid):
3531
update_data = {"description": f"e2e update {short_uuid}"}
3632

@@ -40,21 +36,18 @@ async def test_update_form(async_mpt_ops, async_created_form, short_uuid):
4036
assert result.to_dict().get("description") == update_data["description"]
4137

4238

43-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
4439
async def test_publish_form(async_mpt_ops, async_created_form):
4540
result = await async_mpt_ops.helpdesk.forms.publish(async_created_form.id)
4641

4742
assert result is not None
4843

4944

50-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
51-
async def test_unpublish_form(async_mpt_ops, async_created_form):
52-
result = await async_mpt_ops.helpdesk.forms.unpublish(async_created_form.id)
45+
async def test_unpublish_form(async_mpt_ops, async_created_published_form):
46+
result = await async_mpt_ops.helpdesk.forms.unpublish(async_created_published_form.id)
5347

54-
assert result is not None
48+
assert result.status == "Unpublished"
5549

5650

57-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
5851
async def test_delete_form(async_mpt_ops, async_created_form):
5952
await async_mpt_ops.helpdesk.forms.delete(async_created_form.id) # act
6053

tests/e2e/helpdesk/forms/test_sync_forms.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,25 @@
88
pytestmark = [pytest.mark.flaky]
99

1010

11-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1211
def test_get_form(mpt_ops, created_form):
1312
result = mpt_ops.helpdesk.forms.get(created_form.id)
1413

1514
assert result.id == created_form.id
1615

1716

18-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
1917
def test_list_forms(mpt_ops):
2018
result = mpt_ops.helpdesk.forms.fetch_page(limit=1)
2119

2220
assert len(result) > 0
2321
assert all(isinstance(form, Form) for form in result)
2422

2523

26-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
2724
def test_create_form(created_form):
2825
result = created_form
2926

3027
assert result is not None
3128

3229

33-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
3430
def test_update_form(mpt_ops, created_form, short_uuid):
3531
update_data = {"description": f"e2e update {short_uuid}"}
3632

@@ -40,21 +36,18 @@ def test_update_form(mpt_ops, created_form, short_uuid):
4036
assert result.to_dict().get("description") == update_data["description"]
4137

4238

43-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
4439
def test_publish_form(mpt_ops, created_form):
4540
result = mpt_ops.helpdesk.forms.publish(created_form.id)
4641

4742
assert result is not None
4843

4944

50-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
51-
def test_unpublish_form(mpt_ops, created_form):
52-
result = mpt_ops.helpdesk.forms.unpublish(created_form.id)
45+
def test_unpublish_form(mpt_ops, created_published_form):
46+
result = mpt_ops.helpdesk.forms.unpublish(created_published_form.id)
5347

54-
assert result is not None
48+
assert result.status == "Unpublished"
5549

5650

57-
@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
5851
def test_delete_form(mpt_ops, created_form):
5952
mpt_ops.helpdesk.forms.delete(created_form.id) # act
6053

0 commit comments

Comments
 (0)