-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13839 from transcom/MAIN-remerge-B20617-SC-TOO-Cr…
…eating-Mobile-Home-Shipment-and-Shipment-Card-Display B-20617: SC TOO Creating Mobile Home Shipment and Shipment Card Display
- Loading branch information
Showing
17 changed files
with
1,351 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
playwright/tests/office/servicescounseling/servicesCounselingMobileHome.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// @ts-check | ||
import { test, expect } from './servicesCounselingTestFixture'; | ||
|
||
test.describe('Services counselor user', () => { | ||
test.beforeEach(async ({ scPage }) => { | ||
const move = await scPage.testHarness.buildHHGMoveWithNTSAndNeedsSC(); | ||
await scPage.navigateToMove(move.locator); | ||
}); | ||
|
||
test('Services Counselor can create a mobile home shipment and view shipment card info', async ({ page, scPage }) => { | ||
const deliveryDate = new Date().toLocaleDateString('en-US'); | ||
await page.getByTestId('dropdown').selectOption({ label: 'Mobile Home' }); | ||
|
||
await expect(page.getByRole('heading', { level: 1 })).toHaveText('Add shipment details'); | ||
await expect(page.getByTestId('tag')).toHaveText('Mobile Home'); | ||
|
||
await page.getByLabel('Year').fill('2022'); | ||
await page.getByLabel('Make').fill('make'); | ||
await page.getByLabel('Model').fill('model'); | ||
await page.getByTestId('lengthFeet').fill('22'); | ||
await page.getByTestId('widthFeet').fill('22'); | ||
await page.getByTestId('heightFeet').fill('22'); | ||
|
||
await page.locator('#requestedPickupDate').fill(deliveryDate); | ||
await page.locator('#requestedPickupDate').blur(); | ||
await page.getByText('Use current address').click(); | ||
await page.locator('#requestedDeliveryDate').fill('16 Mar 2022'); | ||
await page.locator('#requestedDeliveryDate').blur(); | ||
|
||
await page.getByLabel('Counselor remarks').fill('Sample counselor remarks'); | ||
|
||
// Save the shipment | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
await scPage.waitForPage.moveDetails(); | ||
|
||
await expect(page.getByTestId('ShipmentContainer')).toHaveCount(2); | ||
|
||
await expect(page.getByText('Mobile home year')).toBeVisible(); | ||
await expect(page.getByTestId('year')).toHaveText('2022'); | ||
await expect(page.getByText('Mobile home make')).toBeVisible(); | ||
await expect(page.getByTestId('make')).toHaveText('make'); | ||
await expect(page.getByText('Mobile home model')).toBeVisible(); | ||
await expect(page.getByTestId('model')).toHaveText('model'); | ||
await expect(page.getByText('Dimensions')).toBeVisible(); | ||
await expect(page.getByTestId('dimensions')).toHaveText("22' L x 22' W x 22' H"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Semi-automated converted from a cypress test, and thus may contain | ||
* non best-practices, in particular: heavy use of `page.locator` | ||
* instead of `page.getBy*`. | ||
*/ | ||
|
||
// @ts-check | ||
import { test, expect } from '../../utils/office/officeTest'; | ||
|
||
import { TooFlowPage } from './tooTestFixture'; | ||
|
||
test.describe('TOO user', () => { | ||
/** @type {TooFlowPage} */ | ||
let tooFlowPage; | ||
|
||
test.beforeEach(async ({ officePage }) => { | ||
const move = await officePage.testHarness.buildHHGMoveWithServiceItemsAndPaymentRequestsAndFilesForTOO(); | ||
await officePage.signInAsNewTOOUser(); | ||
tooFlowPage = new TooFlowPage(officePage, move); | ||
await tooFlowPage.waitForLoading(); | ||
await officePage.tooNavigateToMove(tooFlowPage.moveLocator); | ||
}); | ||
|
||
test('TOO can create a mobile home shipment and view shipment card info', async ({ page }) => { | ||
const deliveryDate = new Date().toLocaleDateString('en-US'); | ||
await page.getByTestId('dropdown').selectOption({ label: 'Mobile Home' }); | ||
|
||
await expect(page.getByRole('heading', { level: 1 })).toHaveText('Add shipment details'); | ||
await expect(page.getByTestId('tag')).toHaveText('Mobile Home'); | ||
|
||
await page.getByLabel('Year').fill('2022'); | ||
await page.getByLabel('Make').fill('make'); | ||
await page.getByLabel('Model').fill('model'); | ||
await page.getByTestId('lengthFeet').fill('22'); | ||
await page.getByTestId('widthFeet').fill('22'); | ||
await page.getByTestId('heightFeet').fill('22'); | ||
|
||
await page.locator('#requestedPickupDate').fill(deliveryDate); | ||
await page.locator('#requestedPickupDate').blur(); | ||
await page.getByText('Use current address').click(); | ||
await page.locator('#requestedDeliveryDate').fill('16 Mar 2022'); | ||
await page.locator('#requestedDeliveryDate').blur(); | ||
|
||
// Save the shipment | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
|
||
await expect(page.getByTestId('ShipmentContainer')).toHaveCount(2); | ||
|
||
await expect(page.getByText('Mobile home year')).toBeVisible(); | ||
await expect(page.getByTestId('year')).toHaveText('2022'); | ||
await expect(page.getByText('Mobile home make')).toBeVisible(); | ||
await expect(page.getByTestId('make')).toHaveText('make'); | ||
await expect(page.getByText('Mobile home model')).toBeVisible(); | ||
await expect(page.getByTestId('model')).toHaveText('model'); | ||
await expect(page.getByText('Dimensions')).toBeVisible(); | ||
await expect(page.getByTestId('dimensions')).toHaveText("22' L x 22' W x 22' H"); | ||
}); | ||
}); |
Oops, something went wrong.