Skip to content

Commit

Permalink
Added random number to form name and description
Browse files Browse the repository at this point in the history
  • Loading branch information
crystalkirscht committed Dec 12, 2024
1 parent cfb933a commit edb90e1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions end2end/tests/testFormEditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ let uniqueText = `New Form ${randNum}`;
test('Create New Form', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/');
await page.getByRole('button', { name: 'Create Form' }).click();
await page.getByLabel('Form Name (up to 50').fill('My New Form');
await page.getByLabel('Form Name (up to 50').fill(uniqueText);
await page.getByLabel('Form Name (up to 50').press('Tab');
await page.getByLabel('Form Description (up to 255').fill('My New Form Description');
await page.getByLabel('Form Description (up to 255').fill(uniqueText + ' Description');
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByLabel('Form name')).toHaveValue('My New Form');
await expect(page.getByLabel('Form description')).toHaveValue('My New Form Description');
await expect(page.getByLabel('Form name')).toHaveValue(uniqueText);
await expect(page.getByLabel('Form description')).toHaveValue(uniqueText + ' Description');
await page.getByRole('link', { name: 'Form Browser' }).click();
await expect(page.getByRole('link', { name: 'My New Form' })).toBeVisible();
await expect(page.getByRole('link', { name: uniqueText })).toBeVisible();
});

test('Add Section to Form', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/');
await page.getByRole('link', { name: 'My New Form' }).click();
await page.getByRole('link', { name: uniqueText }).click();
await page.getByLabel('Add Section').click();
await page.getByLabel('Section Heading').click();
await page.getByLabel('Section Heading').fill(uniqueText + ' Section');
Expand All @@ -31,7 +31,7 @@ test('Add Section to Form', async ({ page }) => {

test('Add Question to Form', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/');
await page.getByRole('link', { name: 'My New Form' }).click();
await page.getByRole('link', { name: uniqueText }).click();
await page.getByLabel('Add Question to Section').click();
await page.getByLabel('Field Name').click();
await page.getByLabel('Field Name').fill('Are you a VA Employee?');
Expand All @@ -46,7 +46,7 @@ test('Add Question to Form', async ({ page }) => {

test('Add Sub-Question to Form', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/');
await page.getByRole('link', { name: 'My New Form' }).click();
await page.getByRole('link', { name: uniqueText }).click();
await page.getByLabel('add sub-question').click();
await page.getByLabel('Field Name').fill('Supervisor Name');
await page.getByLabel('Short label for spreadsheet').click();
Expand All @@ -58,7 +58,7 @@ test('Add Sub-Question to Form', async ({ page }) => {

test('Create Pre-Filled If/Then Question', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/');
await page.getByRole('link', { name: 'My New Form' }).click();
await page.getByRole('link', { name: uniqueText }).click();
await page.getByText('Modify Logic').last().click();
await page.getByLabel('New Condition').click();
await page.getByLabel('Select an outcome').selectOption('pre-fill');
Expand All @@ -82,12 +82,12 @@ test('Create Pre-Filled If/Then Question', async ({ page }) => {

test('Delete Form', async ({ page }) => {
await page.goto('https://host.docker.internal/Test_Request_Portal/admin/?a=form_vue#/');
await page.getByRole('link', { name: 'My New Form' }).click();
await page.getByRole('link', { name: uniqueText }).click();
await expect(page.getByRole('heading', { name: 'Admin  Form Browser  Form' })).toBeVisible();
await page.getByLabel('delete this form').click();
await page.getByRole('button', { name: 'Yes' }).click();
await expect(page.locator('#createFormButton')).toContainText('Create Form');
await expect(page.getByRole('link', { name: 'My New Form' })).not.toBeVisible();
await expect(page.getByRole('link', { name: uniqueText })).not.toBeVisible();
});


Expand Down

0 comments on commit edb90e1

Please sign in to comment.