Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account update leaf 4559 - Test Scenario #1 #15

Merged
merged 4 commits into from
Jan 9, 2025
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
Empty file.
96 changes: 96 additions & 0 deletions end2end/tests/acctUpdate.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { test, expect, Locator } from '@playwright/test';

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/');
//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 page1.getByRole('cell', { name: 'Jacobs, Gilbert Wilderman.' }).click();


const oldAcct:Locator = page1.getByLabel('Jacobs, Gilbert Wilderman.');
oldAcct.click();


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();
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

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_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' });


});
86 changes: 86 additions & 0 deletions end2end/tests/acctUpdateMultiple.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { test, expect, Locator } from '@playwright/test';

test.use({
ignoreHTTPSErrors: true
});


//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
await page.getByRole('button', { name: ' New Account Updater' }).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');
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("vtrfaufelecia");
await page1.getByRole('cell', { name: 'Schultz, Phuong Boyer.' }).click();

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();

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 have value

//Group
await expect(page1.getByText('Export Group NameCurrent')).toBeVisible();

//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' });

//Accept changes
await page1.getByRole('button', { name: 'Update Records' }).click();

//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');


});
Loading