Skip to content

Commit

Permalink
Added high level tests for each module
Browse files Browse the repository at this point in the history
  • Loading branch information
ucswift committed Jan 8, 2025
1 parent e237abb commit 33eebaa
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/calendar.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test, expect } from '@playwright/test';

test('calendar view calendar and types', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: ' Calendar' }).click();
await expect(page.locator('#page-wrapper')).toContainText('Training');
await page.getByRole('link', { name: 'Manage Types' }).click();
await expect(page.locator('tbody')).toContainText('#bf4a4a');
});
13 changes: 13 additions & 0 deletions tests/documents.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { test, expect } from '@playwright/test';

test('documents view docs list', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: ' Documents' }).click();
await expect(page.locator('#page-wrapper')).toContainText('test');
});
20 changes: 20 additions & 0 deletions tests/inventory.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { test, expect } from '@playwright/test';

test('inventory view inventory', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.getByRole('link', { name: ' Inventory' }).click();
await expect(page.locator('tbody')).toContainText('Station 2');
await page.getByRole('link', { name: 'View History' }).click();
await expect(page.locator('tbody')).toContainText('523');
await page.getByRole('link', { name: 'Inventory', exact: true }).click();
await page.getByRole('link', { name: 'Adjust Inventory' }).click();
await expect(page.getByRole('form')).toContainText('Unit');
await page.getByRole('link', { name: 'Inventory', exact: true }).click();
await page.getByRole('link', { name: 'Manage Types' }).click();
await expect(page.locator('tbody')).toContainText('Packet');
});
27 changes: 27 additions & 0 deletions tests/mapping.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { test, expect } from '@playwright/test';

test('mapping view map', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.getByRole('link', { name: ' Mapping' }).click();
await expect(page.getByTitle('Test Call')).toBeVisible();
await expect(page.locator('ol')).toContainText('Mapping');
});

test('mapping new layer', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.getByRole('link', { name: ' Mapping' }).click();
await page.getByRole('link', { name: 'Manage Layers' }).click();
await expect(page.locator('ol')).toContainText('Layers');
await page.getByRole('link', { name: 'New Layer' }).click();
await expect(page.locator('#newLayerForm')).toContainText('Name');
});
65 changes: 65 additions & 0 deletions tests/messages.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { test, expect } from '@playwright/test';

test('messages view inbox', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: '' }).click();
await page.getByRole('link', { name: ' View Your Message Inbox' }).click();
await expect(page.locator('tbody')).toContainText('Test for WebJob Worker');
await page.getByRole('row', { name: 'test Carl Barrett 01/31/2016' }).locator('#message').check();
await page.getByText('Mark Selected as Read').click();
await page.getByRole('button', { name: 'OK' }).click();
});

test('messages inbox view message', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.goto('https://qaweb.resgrid.dev/User/Messages/Inbox');
await page.getByRole('row', { name: 'test Carl Barrett 01/31/2016' }).getByRole('link').first().click();
await expect(page.locator('h3')).toContainText('Subject: test');
});

test('messages inbox view outbox', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: '' }).click();
await page.getByRole('link', { name: ' View Your Message Inbox' }).click();
await page.getByRole('link', { name: ' Sent Messages' }).click();
await expect(page.locator('tbody')).toContainText('Test Message');
});

test('messages send message', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: '' }).click();
await page.getByRole('link', { name: ' View Your Message Inbox' }).click();
await page.getByRole('link', { name: 'Compose Message' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Messages/Compose');
await page.getByPlaceholder('The subject/title of the').click();
await page.getByPlaceholder('The subject/title of the').fill('test automation');
await page.locator('#editor-container div').first().click();
await page.locator('#editor-container div').first().fill('just a test!');
await page.locator('div:nth-child(3) > .k-widget > .k-multiselect-wrap > .k-input').click();
await page.getByRole('option', { name: 'Carl Barrett' }).click();
await page.getByRole('button', { name: ' Send' }).click();
});
15 changes: 15 additions & 0 deletions tests/notes.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test, expect } from '@playwright/test';

test('note view notes list', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.getByRole('link', { name: ' Notes' }).click();
await expect(page.locator('#page-wrapper')).toContainText('Jj test');
await page.getByRole('link', { name: 'New Note' }).click();
await expect(page.locator('#newNoteForm')).toContainText('Category');
await page.getByText('Title Category None Body').click();
});
37 changes: 37 additions & 0 deletions tests/personnel.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { test, expect } from '@playwright/test';

test('personnel view users and set', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: ' Personnel' }).click();
await expect(page.locator('#personnelGroups_-1')).toContainText('Bill Hayden');
await page.getByRole('treeitem', { name: ' Ungrouped Personnel' }).click();
await expect(page.locator('#personnelGroups_0')).toContainText('Max Swift');
await page.getByRole('button', { name: 'Set Staffing' }).nth(1).click();
await page.locator('#PersonnelStaffingDropdown').selectOption('1');
await page.locator('#savingPersonnelStaffingButton').click();
await page.getByRole('treeitem', { name: ' Ungrouped Personnel' }).click();
await page.getByRole('button', { name: 'Set Status' }).nth(1).click();
await page.locator('#PersonnelStatusDropdown').selectOption('1');
await page.locator('#savingPersonnelStatusButton').click();
});

test('personnel view roles', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.getByRole('link', { name: ' Personnel' }).click();
await page.getByRole('link', { name: 'Manage Roles' }).click();
await expect(page.locator('tbody')).toContainText('Engineer');
await page.getByRole('row', { name: 'Engineer Apparatuses Operator' }).getByRole('link').first().click();
await expect(page.getByRole('rowgroup')).toContainText('Andy Biasotti');
});

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

test('reports view personnel report', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: ' Reports' }).click();
await expect(page.locator('ol')).toContainText('Reporting');
await page.getByRole('row', { name: 'Personnel Report View all the' }).getByRole('link').nth(1).click();
await expect(page.getByRole('heading')).toContainText('Resgrid Personnel Report');
});
17 changes: 17 additions & 0 deletions tests/shifts.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { test, expect } from '@playwright/test';

test('shifts view shifts', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.getByRole('link', { name: ' Shifts' }).click();
await expect(page.getByRole('cell', { name: 'S Shift' })).toBeVisible();
await expect(page.locator('tbody')).toContainText('S Shift');
await page.getByRole('link', { name: 'Your Shifts' }).click();
await expect(page.getByRole('cell', { name: 'S Shift' }).nth(1)).toBeVisible();
await expect(page.locator('#page-wrapper')).toContainText('S Shift');
await page.getByRole('link', { name: 'Shifts', exact: true }).click();
});
15 changes: 15 additions & 0 deletions tests/trainings.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { test, expect } from '@playwright/test';

test('trainings view trainings list', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: ' Trainings' }).click();
await expect(page.locator('tbody')).toContainText('Protocol training for ebola.');
await page.getByRole('link', { name: 'View Training' }).nth(1).click();
await expect(page.locator('#page-wrapper')).toContainText('11/10/2014');
});
32 changes: 32 additions & 0 deletions tests/units.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { test, expect } from '@playwright/test';

test('units view units list', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: ' Units' }).click();
await expect(page.locator('#DataTables_Table_0')).toContainText('Engine 1');
await page.getByRole('treeitem', { name: ' Ungrouped Units' }).click();
await expect(page.locator('#DataTables_Table_1')).toContainText('BC Buggy');
});

test('units set unit status', async ({ page }) => {
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
await page.getByPlaceholder('Username').click();
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
await page.getByPlaceholder('Password').click();
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
await page.getByRole('button', { name: 'Log On' }).click();
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
await page.getByRole('link', { name: ' Units' }).click();
await page.getByRole('treeitem', { name: ' Ungrouped Units' }).click();
await page.getByRole('button', { name: 'Set Status' }).click();
await page.locator('#UnitStatusDropdown').selectOption('3');
await page.locator('#savingUnitStatusButton').click();
await page.getByRole('treeitem', { name: ' Ungrouped Units' }).click();
await expect(page.locator('#DataTables_Table_1')).toContainText('Committed');
});

0 comments on commit 33eebaa

Please sign in to comment.