Skip to content

Commit 33eebaa

Browse files
committed
Added high level tests for each module
1 parent e237abb commit 33eebaa

File tree

11 files changed

+271
-0
lines changed

11 files changed

+271
-0
lines changed

tests/calendar.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('calendar view calendar and types', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
11+
await page.getByRole('link', { name: ' Calendar' }).click();
12+
await expect(page.locator('#page-wrapper')).toContainText('Training');
13+
await page.getByRole('link', { name: 'Manage Types' }).click();
14+
await expect(page.locator('tbody')).toContainText('#bf4a4a');
15+
});

tests/documents.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('documents view docs list', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
11+
await page.getByRole('link', { name: ' Documents' }).click();
12+
await expect(page.locator('#page-wrapper')).toContainText('test');
13+
});

tests/inventory.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('inventory view inventory', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.getByRole('link', { name: ' Inventory' }).click();
11+
await expect(page.locator('tbody')).toContainText('Station 2');
12+
await page.getByRole('link', { name: 'View History' }).click();
13+
await expect(page.locator('tbody')).toContainText('523');
14+
await page.getByRole('link', { name: 'Inventory', exact: true }).click();
15+
await page.getByRole('link', { name: 'Adjust Inventory' }).click();
16+
await expect(page.getByRole('form')).toContainText('Unit');
17+
await page.getByRole('link', { name: 'Inventory', exact: true }).click();
18+
await page.getByRole('link', { name: 'Manage Types' }).click();
19+
await expect(page.locator('tbody')).toContainText('Packet');
20+
});

tests/mapping.spec.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('mapping view map', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.getByRole('link', { name: ' Mapping' }).click();
11+
await expect(page.getByTitle('Test Call')).toBeVisible();
12+
await expect(page.locator('ol')).toContainText('Mapping');
13+
});
14+
15+
test('mapping new layer', async ({ page }) => {
16+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
17+
await page.getByPlaceholder('Username').click();
18+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
19+
await page.getByPlaceholder('Password').click();
20+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
21+
await page.getByRole('button', { name: 'Log On' }).click();
22+
await page.getByRole('link', { name: ' Mapping' }).click();
23+
await page.getByRole('link', { name: 'Manage Layers' }).click();
24+
await expect(page.locator('ol')).toContainText('Layers');
25+
await page.getByRole('link', { name: 'New Layer' }).click();
26+
await expect(page.locator('#newLayerForm')).toContainText('Name');
27+
});

tests/messages.spec.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('messages view inbox', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
11+
await page.getByRole('link', { name: '' }).click();
12+
await page.getByRole('link', { name: ' View Your Message Inbox' }).click();
13+
await expect(page.locator('tbody')).toContainText('Test for WebJob Worker');
14+
await page.getByRole('row', { name: 'test Carl Barrett 01/31/2016' }).locator('#message').check();
15+
await page.getByText('Mark Selected as Read').click();
16+
await page.getByRole('button', { name: 'OK' }).click();
17+
});
18+
19+
test('messages inbox view message', async ({ page }) => {
20+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
21+
await page.getByPlaceholder('Username').click();
22+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
23+
await page.getByPlaceholder('Password').click();
24+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
25+
await page.getByRole('button', { name: 'Log On' }).click();
26+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
27+
await page.goto('https://qaweb.resgrid.dev/User/Messages/Inbox');
28+
await page.getByRole('row', { name: 'test Carl Barrett 01/31/2016' }).getByRole('link').first().click();
29+
await expect(page.locator('h3')).toContainText('Subject: test');
30+
});
31+
32+
test('messages inbox view outbox', async ({ page }) => {
33+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
34+
await page.getByPlaceholder('Username').click();
35+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
36+
await page.getByPlaceholder('Password').click();
37+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
38+
await page.getByRole('button', { name: 'Log On' }).click();
39+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
40+
await page.getByRole('link', { name: '' }).click();
41+
await page.getByRole('link', { name: ' View Your Message Inbox' }).click();
42+
await page.getByRole('link', { name: ' Sent Messages' }).click();
43+
await expect(page.locator('tbody')).toContainText('Test Message');
44+
});
45+
46+
test('messages send message', async ({ page }) => {
47+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
48+
await page.getByPlaceholder('Username').click();
49+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
50+
await page.getByPlaceholder('Password').click();
51+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
52+
await page.getByRole('button', { name: 'Log On' }).click();
53+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
54+
await page.getByRole('link', { name: '' }).click();
55+
await page.getByRole('link', { name: ' View Your Message Inbox' }).click();
56+
await page.getByRole('link', { name: 'Compose Message' }).click();
57+
await page.goto('https://qaweb.resgrid.dev/User/Messages/Compose');
58+
await page.getByPlaceholder('The subject/title of the').click();
59+
await page.getByPlaceholder('The subject/title of the').fill('test automation');
60+
await page.locator('#editor-container div').first().click();
61+
await page.locator('#editor-container div').first().fill('just a test!');
62+
await page.locator('div:nth-child(3) > .k-widget > .k-multiselect-wrap > .k-input').click();
63+
await page.getByRole('option', { name: 'Carl Barrett' }).click();
64+
await page.getByRole('button', { name: ' Send' }).click();
65+
});

tests/notes.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('note view notes list', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.getByRole('link', { name: ' Notes' }).click();
11+
await expect(page.locator('#page-wrapper')).toContainText('Jj test');
12+
await page.getByRole('link', { name: 'New Note' }).click();
13+
await expect(page.locator('#newNoteForm')).toContainText('Category');
14+
await page.getByText('Title Category None Body').click();
15+
});

tests/personnel.spec.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('personnel view users and set', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
11+
await page.getByRole('link', { name: ' Personnel' }).click();
12+
await expect(page.locator('#personnelGroups_-1')).toContainText('Bill Hayden');
13+
await page.getByRole('treeitem', { name: ' Ungrouped Personnel' }).click();
14+
await expect(page.locator('#personnelGroups_0')).toContainText('Max Swift');
15+
await page.getByRole('button', { name: 'Set Staffing' }).nth(1).click();
16+
await page.locator('#PersonnelStaffingDropdown').selectOption('1');
17+
await page.locator('#savingPersonnelStaffingButton').click();
18+
await page.getByRole('treeitem', { name: ' Ungrouped Personnel' }).click();
19+
await page.getByRole('button', { name: 'Set Status' }).nth(1).click();
20+
await page.locator('#PersonnelStatusDropdown').selectOption('1');
21+
await page.locator('#savingPersonnelStatusButton').click();
22+
});
23+
24+
test('personnel view roles', async ({ page }) => {
25+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
26+
await page.getByPlaceholder('Username').click();
27+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
28+
await page.getByPlaceholder('Password').click();
29+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
30+
await page.getByRole('button', { name: 'Log On' }).click();
31+
await page.getByRole('link', { name: ' Personnel' }).click();
32+
await page.getByRole('link', { name: 'Manage Roles' }).click();
33+
await expect(page.locator('tbody')).toContainText('Engineer');
34+
await page.getByRole('row', { name: 'Engineer Apparatuses Operator' }).getByRole('link').first().click();
35+
await expect(page.getByRole('rowgroup')).toContainText('Andy Biasotti');
36+
});
37+

tests/reports.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('reports view personnel report', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
11+
await page.getByRole('link', { name: ' Reports' }).click();
12+
await expect(page.locator('ol')).toContainText('Reporting');
13+
await page.getByRole('row', { name: 'Personnel Report View all the' }).getByRole('link').nth(1).click();
14+
await expect(page.getByRole('heading')).toContainText('Resgrid Personnel Report');
15+
});

tests/shifts.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('shifts view shifts', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.getByRole('link', { name: ' Shifts' }).click();
11+
await expect(page.getByRole('cell', { name: 'S Shift' })).toBeVisible();
12+
await expect(page.locator('tbody')).toContainText('S Shift');
13+
await page.getByRole('link', { name: 'Your Shifts' }).click();
14+
await expect(page.getByRole('cell', { name: 'S Shift' }).nth(1)).toBeVisible();
15+
await expect(page.locator('#page-wrapper')).toContainText('S Shift');
16+
await page.getByRole('link', { name: 'Shifts', exact: true }).click();
17+
});

tests/trainings.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
test('trainings view trainings list', async ({ page }) => {
4+
await page.goto('https://qaweb.resgrid.dev/Account/LogOn');
5+
await page.getByPlaceholder('Username').click();
6+
await page.getByPlaceholder('Username').fill(process.env.PW_LOGIN_USERNAME);
7+
await page.getByPlaceholder('Password').click();
8+
await page.getByPlaceholder('Password').fill(process.env.PW_LOGIN_PASSWORD);
9+
await page.getByRole('button', { name: 'Log On' }).click();
10+
await page.goto('https://qaweb.resgrid.dev/User/Home/Dashboard');
11+
await page.getByRole('link', { name: ' Trainings' }).click();
12+
await expect(page.locator('tbody')).toContainText('Protocol training for ebola.');
13+
await page.getByRole('link', { name: 'View Training' }).nth(1).click();
14+
await expect(page.locator('#page-wrapper')).toContainText('11/10/2014');
15+
});

0 commit comments

Comments
 (0)