From fe8a7500142ec0c24b656eb7b913a572f97513f6 Mon Sep 17 00:00:00 2001 From: Margo Green Date: Mon, 28 Oct 2024 13:20:14 -0500 Subject: [PATCH 1/4] Adding my branch --- end2end/tests/accountUpdate.spec.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 end2end/tests/accountUpdate.spec.ts diff --git a/end2end/tests/accountUpdate.spec.ts b/end2end/tests/accountUpdate.spec.ts new file mode 100644 index 000000000..e69de29bb From 0de8a720b130741932d461ccb0d822ef6ab40c13 Mon Sep 17 00:00:00 2001 From: Margo Green Date: Fri, 15 Nov 2024 10:16:24 -0600 Subject: [PATCH 2/4] Adding the additional files --- end2end/tests/acctUpdate.spec.ts | 75 ++++++++++++++++++++++++ end2end/tests/acctUpdateMultiple.spec.ts | 0 2 files changed, 75 insertions(+) create mode 100644 end2end/tests/acctUpdate.spec.ts create mode 100644 end2end/tests/acctUpdateMultiple.spec.ts diff --git a/end2end/tests/acctUpdate.spec.ts b/end2end/tests/acctUpdate.spec.ts new file mode 100644 index 000000000..a317cef26 --- /dev/null +++ b/end2end/tests/acctUpdate.spec.ts @@ -0,0 +1,75 @@ +import { test, expect, Locator } from '@playwright/test'; + +test.use({ + ignoreHTTPSErrors: true +}); + +test.only('test', async ({ page }) => { + + await page.goto('https://host.docker.internal/Test_Request_Portal/admin/'); + //Open the New Account Update Page + await page.getByRole('button', { name: ' New Account Updater' }).click(); + //Sync the Service forst + + await page.getByRole('link', { name: 'Sync Services' }).click(); + +//Wait for the new page to popup + const page1Promise = page.waitForEvent('popup'); + const page1 = await page1Promise; + +//Verify the Sync Service was completed + await expect(page1.getByText('Syncing has finished. You are')).toBeInViewport(); + +//Return the the Admin page + await page1.getByLabel('admin submenu').click(); + await page1.getByLabel('admin submenu').click(); + await page1.getByRole('link', { name: 'Admin Panel' }).click(); + +//Return to the New Account Update page + const acctUpdate:Locator = page1.getByRole('button', { name: ' New Account Updater' }); + await acctUpdate.click(); + + //Identify the Old Account to be disabled +const OldRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(0); +await OldRep.click(); +await OldRep.fill("vtrmvtlynnette"); +//await expect(page.getByText('Old Account Search results')).toBeInViewport(); +//await expect(page.getByRole('cell', { name: 'Jacobs, Gilbert Wilderman.' })).toBeInViewport(); +await page1.getByRole('cell', { name: 'Jacobs, Gilbert Wilderman.' }).click(); + + +const oldAcct:Locator = page1.getByLabel('Jacobs, Gilbert Wilderman.'); +oldAcct.click(); +//.toContainText('Jacobs, Gilbert Wilderman.vtrmvtlynnette'); + + +// Enter New Account information +const newRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(1); +await newRep.click(); +await newRep.fill("vtrkmwroseann"); + + +const newAcct:Locator = page1.getByLabel('Greenholt, Shirlene Parisian'); +newAcct.click(); + +//Click to View Changes + + await page1.getByRole('button', { name: 'Preview Changes' }).click(); + + //Veirfy Goups and Positions is empty. + await expect (page1.locator('#grid_groups_info')).toContainText('No groups found'); + + await expect (page1.locator('#grid_positions_info')).toContainText('No Positions found'); + +//Accept changes +await page1.getByRole('button', { name: 'Update Records' }).click(); + +//Verify there are not any group/positions updates +await expect(page1.locator('#groups_no_updates')).toContainText('no updates'); +await expect(page1.locator('#positions_no_updates')).toContainText('no updates'); + +//No processing errors +await expect(page.locator('#no_errors')).toContainText('no errors'); + + +}); \ No newline at end of file diff --git a/end2end/tests/acctUpdateMultiple.spec.ts b/end2end/tests/acctUpdateMultiple.spec.ts new file mode 100644 index 000000000..e69de29bb From f7c9b1ac8d1311b60727cb96aa206957674483e9 Mon Sep 17 00:00:00 2001 From: Margo Green Date: Fri, 15 Nov 2024 13:20:27 -0600 Subject: [PATCH 3/4] Cleaned up file acctUpdate --- end2end/tests/acctUpdate.spec.ts | 34 ++++++++-- end2end/tests/acctUpdateMultiple.spec.ts | 82 ++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 7 deletions(-) diff --git a/end2end/tests/acctUpdate.spec.ts b/end2end/tests/acctUpdate.spec.ts index a317cef26..674cee84a 100644 --- a/end2end/tests/acctUpdate.spec.ts +++ b/end2end/tests/acctUpdate.spec.ts @@ -4,7 +4,7 @@ test.use({ ignoreHTTPSErrors: true }); -test.only('test', async ({ page }) => { +test('noGroupsOrPositions', async ({ page }, testInfo) => { await page.goto('https://host.docker.internal/Test_Request_Portal/admin/'); //Open the New Account Update Page @@ -33,16 +33,16 @@ test.only('test', async ({ page }) => { const OldRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(0); await OldRep.click(); await OldRep.fill("vtrmvtlynnette"); -//await expect(page.getByText('Old Account Search results')).toBeInViewport(); -//await expect(page.getByRole('cell', { name: 'Jacobs, Gilbert Wilderman.' })).toBeInViewport(); await page1.getByRole('cell', { name: 'Jacobs, Gilbert Wilderman.' }).click(); const oldAcct:Locator = page1.getByLabel('Jacobs, Gilbert Wilderman.'); oldAcct.click(); -//.toContainText('Jacobs, Gilbert Wilderman.vtrmvtlynnette'); - + +const screenshot = await page.screenshot() +await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' }); + // Enter New Account information const newRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(1); await newRep.click(); @@ -52,24 +52,44 @@ await newRep.fill("vtrkmwroseann"); const newAcct:Locator = page1.getByLabel('Greenholt, Shirlene Parisian'); newAcct.click(); +//await expect(page.getByRole('button', { name: 'Preview Changes' })).toBeInViewport(); + +await expect(page1.getByText('New Account Search results')).toBeVisible(); + + //Click to View Changes - await page1.getByRole('button', { name: 'Preview Changes' }).click(); +const previewChange:Locator = page1.getByRole('button', {name: 'Preview Changes'}); +await previewChange.hover(); +await previewChange.click (); + +await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' }); + +//Wait for page to refresh ( + + //Veirfy Goups and Positions is empty. - await expect (page1.locator('#grid_groups_info')).toContainText('No groups found'); + + await expect (page1.locator('#grid_groups_info')).toContainText('No groups found'); await expect (page1.locator('#grid_positions_info')).toContainText('No Positions found'); + await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' }); + //Accept changes await page1.getByRole('button', { name: 'Update Records' }).click(); +await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' }); + +//await expect(page1.getByText('Syncing has finished. You are')).toBeInViewport(); //Verify there are not any group/positions updates await expect(page1.locator('#groups_no_updates')).toContainText('no updates'); await expect(page1.locator('#positions_no_updates')).toContainText('no updates'); //No processing errors await expect(page.locator('#no_errors')).toContainText('no errors'); +await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' }); }); \ No newline at end of file diff --git a/end2end/tests/acctUpdateMultiple.spec.ts b/end2end/tests/acctUpdateMultiple.spec.ts index e69de29bb..f8a7afbd8 100644 --- a/end2end/tests/acctUpdateMultiple.spec.ts +++ b/end2end/tests/acctUpdateMultiple.spec.ts @@ -0,0 +1,82 @@ +import { test, expect, Locator } from '@playwright/test'; + +test.use({ + ignoreHTTPSErrors: true +}); + +test.only('oldAcctGroupsAndPosition', async ({ page }) => { + + await page.goto('https://host.docker.internal/Test_Request_Portal/admin/'); + //Open the New Account Update Page + await page.getByRole('button', { name: ' New Account Updater' }).click(); + //Sync the Service forst + + await page.getByRole('link', { name: 'Sync Services' }).click(); + +//Wait for the new page to popup + const page1Promise = page.waitForEvent('popup'); + const page1 = await page1Promise; + +//Verify the Sync Service was completed + await expect(page1.getByText('Syncing has finished. You are')).toBeInViewport(); + +//Return the the Admin page + await page1.getByLabel('admin submenu').click(); + await page1.getByLabel('admin submenu').click(); + await page1.getByRole('link', { name: 'Admin Panel' }).click(); + +//Return to the New Account Update page + const acctUpdate:Locator = page1.getByRole('button', { name: ' New Account Updater' }); + await acctUpdate.click(); + + //Identify the Old Account to be disabled +const OldRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(0); +await OldRep.click(); +await OldRep.fill("vtriujtalisha"); +//await expect(page.getByText('Old Account Search results')).toBeInViewport(); +//await expect(page.getByRole('cell', { name: 'Jacobs, Gilbert Wilderman.' })).toBeInViewport(); +await page1.getByRole('cell', { name: 'Kozey, Kirstin Schimmel.' }).click(); + + +const oldAcct:Locator = page1.getByLabel('Kozey, Kirstin Schimmel.'); +oldAcct.click(); + + + +// Enter New Account information +const newRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(1); +await newRep.click(); +await newRep.fill("vtrvxhconception"); + + +const newAcct:Locator = page1.getByLabel('Predovic, Augustine Hammes.'); +newAcct.click(); + +await expect(page1.getByText('New Account Search results')).toBeVisible(); + +//Click to View Changes +const previewChange:Locator = page1.getByRole('button', {name: 'Preview Changes'}); +await previewChange.hover(); +await previewChange.click (); + +//Old Account with Groups & Positions + + //Veirfy Goups and Positions is empty have value + + await expect (page1.locator('#grid_groups_info')).toContainText('No groups found'); + + await expect (page1.locator('#grid_positions_info')).toContainText('No Positions found'); + +//Accept changes +await page1.getByRole('button', { name: 'Update Records' }).click(); + +//await expect(page1.getByText('Syncing has finished. You are')).toBeInViewport(); +//Verify there are not any group/positions updates +await expect(page1.locator('#groups_no_updates')).toContainText('no updates'); +await expect(page1.locator('#positions_no_updates')).toContainText('no updates'); + +//No processing errors +await expect(page.locator('#no_errors')).toContainText('no errors'); + + +}); \ No newline at end of file From e3c681dbe34966a28c61de378038042c13c606a6 Mon Sep 17 00:00:00 2001 From: Margo Green Date: Fri, 3 Jan 2025 17:01:25 -0600 Subject: [PATCH 4/4] Updated Test Scripts 1. no groups/positions 2. groups/positions --- end2end/tests/acctUpdate.spec.ts | 1 + end2end/tests/acctUpdateMultiple.spec.ts | 50 +++++++++++++----------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/end2end/tests/acctUpdate.spec.ts b/end2end/tests/acctUpdate.spec.ts index 674cee84a..636ab7164 100644 --- a/end2end/tests/acctUpdate.spec.ts +++ b/end2end/tests/acctUpdate.spec.ts @@ -4,6 +4,7 @@ test.use({ ignoreHTTPSErrors: true }); +//Test the old user do not have any groups and positions and everything works correctly test('noGroupsOrPositions', async ({ page }, testInfo) => { await page.goto('https://host.docker.internal/Test_Request_Portal/admin/'); diff --git a/end2end/tests/acctUpdateMultiple.spec.ts b/end2end/tests/acctUpdateMultiple.spec.ts index f8a7afbd8..2208efd24 100644 --- a/end2end/tests/acctUpdateMultiple.spec.ts +++ b/end2end/tests/acctUpdateMultiple.spec.ts @@ -4,14 +4,17 @@ test.use({ ignoreHTTPSErrors: true }); -test.only('oldAcctGroupsAndPosition', async ({ page }) => { + +//This test has an user with multiple groups and positions +test('oldAcctGroupsAndPosition', async ({ page }, testInfo) => { await page.goto('https://host.docker.internal/Test_Request_Portal/admin/'); - //Open the New Account Update Page + + //Open the New Account Update Page await page.getByRole('button', { name: ' New Account Updater' }).click(); - //Sync the Service forst - await page.getByRole('link', { name: 'Sync Services' }).click(); + //Sync the Service first + await page.getByRole('link', { name: 'Sync Services' }).click(); //Wait for the new page to popup const page1Promise = page.waitForEvent('popup'); @@ -32,23 +35,16 @@ test.only('oldAcctGroupsAndPosition', async ({ page }) => { //Identify the Old Account to be disabled const OldRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(0); await OldRep.click(); -await OldRep.fill("vtriujtalisha"); -//await expect(page.getByText('Old Account Search results')).toBeInViewport(); -//await expect(page.getByRole('cell', { name: 'Jacobs, Gilbert Wilderman.' })).toBeInViewport(); -await page1.getByRole('cell', { name: 'Kozey, Kirstin Schimmel.' }).click(); - +await OldRep.fill("vtrfaufelecia"); +await page1.getByRole('cell', { name: 'Schultz, Phuong Boyer.' }).click(); -const oldAcct:Locator = page1.getByLabel('Kozey, Kirstin Schimmel.'); +const oldAcct:Locator = page1.getByLabel('Schultz, Phuong Boyer.'); oldAcct.click(); - - // Enter New Account information const newRep:Locator = page1.locator('css=input.employeeSelectorInput').nth(1); await newRep.click(); await newRep.fill("vtrvxhconception"); - - const newAcct:Locator = page1.getByLabel('Predovic, Augustine Hammes.'); newAcct.click(); @@ -59,21 +55,29 @@ const previewChange:Locator = page1.getByRole('button', {name: 'Preview Changes' await previewChange.hover(); await previewChange.click (); -//Old Account with Groups & Positions +//Old Account with Groups & Positions Veirfy Goups and Positions have value - //Veirfy Goups and Positions is empty have value +//Group +await expect(page1.getByText('Export Group NameCurrent')).toBeVisible(); - await expect (page1.locator('#grid_groups_info')).toContainText('No groups found'); +//Position +await expect(page1.getByText('Export Position TitleCurrent')).toBeVisible(); + +// Need screenshot inserted in here +const screenshot = await page.screenshot(); +await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' }); - await expect (page1.locator('#grid_positions_info')).toContainText('No Positions found'); - //Accept changes await page1.getByRole('button', { name: 'Update Records' }).click(); -//await expect(page1.getByText('Syncing has finished. You are')).toBeInViewport(); -//Verify there are not any group/positions updates -await expect(page1.locator('#groups_no_updates')).toContainText('no updates'); -await expect(page1.locator('#positions_no_updates')).toContainText('no updates'); +//Group - Verify updates +await expect(page1.locator('#groups_updated')).toContainText('Removed vtrfaufelecia and added vtrvxhconception to Iron Sports (nexus)'); + +//Positions - Verify updates +await expect(page1.locator('#positions_updated')).toContainText('Removed vtrfaufelecia and added vtrvxhconception to position: LEAF Coaches'); +await expect(page1.locator('#positions_updated')).toContainText('Removed vtrfaufelecia and added vtrvxhconception to position: Chief of Everything'); +await expect(page1.locator('#positions_updated')).toContainText('Removed vtrfaufelecia and added vtrvxhconception to position: Chief, Facilties'); +await expect(page1.locator('#positions_updated')).toContainText('Removed vtrfaufelecia and added vtrvxhconception to position: Dog Sitter West'); //No processing errors await expect(page.locator('#no_errors')).toContainText('no errors');