From 0153eefbf4069b875a02e1aacfd7e9d147e8bc33 Mon Sep 17 00:00:00 2001 From: Crystal Kirscht Date: Wed, 18 Dec 2024 14:37:51 -0600 Subject: [PATCH] updated to include test for internal use form and renamed file --- ...or.spec.ts => lifecycleFormEditor.spec.ts} | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) rename end2end/tests/{testFormEditor.spec.ts => lifecycleFormEditor.spec.ts} (79%) diff --git a/end2end/tests/testFormEditor.spec.ts b/end2end/tests/lifecycleFormEditor.spec.ts similarity index 79% rename from end2end/tests/testFormEditor.spec.ts rename to end2end/tests/lifecycleFormEditor.spec.ts index 4b5587c6..25dc3f26 100644 --- a/end2end/tests/testFormEditor.spec.ts +++ b/end2end/tests/lifecycleFormEditor.spec.ts @@ -80,6 +80,29 @@ test('Create Pre-Filled If/Then Question', async ({ page }) => { await page.getByText('Close').click(); }) +test('Add Internal Use Form', async ({ page }) => { + await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/'); + await page.getByRole('link', { name: uniqueText }).click(); + await page.getByLabel('Workflow: No Workflow. Users').selectOption('1'); + await page.getByRole('button', { name: 'Add Internal-Use' }).click(); + await page.getByLabel('Form Name (up to 50').fill('My Internal Form'); + await page.getByLabel('Form Description (up to 255').click(); + await page.getByLabel('Form Description (up to 255').fill('My Internal Form Description'); + await page.getByRole('button', { name: 'Save' }).click(); + await expect(page.locator(".internal_forms")).toContainText('My Internal Form'); + + // Check form is available to the workflow (should this be a separate test?) + await page.getByLabel(uniqueText + ', main form').click(); + const page1Promise = page.waitForEvent('popup'); + await page.getByRole('link', { name: 'View Workflow' }).click(); + const page1 = await page1Promise; + await page1.getByLabel('workflow step: Step 2').click(); + + // Confirm Form Field drop down contains the new Internal Form + let optionArray = page1.getByLabel('Form Field:'); + await expect(page1.getByLabel('Form Field:')).toContainText(uniqueText + ': ' + uniqueText + ' Section'); +}); + test('Delete Form', async ({ page }) => { await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/'); await page.getByRole('link', { name: uniqueText }).click(); @@ -88,9 +111,4 @@ test('Delete Form', async ({ page }) => { await page.getByRole('button', { name: 'Yes' }).click(); await expect(page.locator('#createFormButton')).toContainText('Create Form'); await expect(page.getByRole('link', { name: uniqueText })).not.toBeVisible(); -}); - - - - - +}); \ No newline at end of file