-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: QoL improvements to Omnichannel E2E tests (#28075)
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>
- Loading branch information
Showing
16 changed files
with
338 additions
and
260 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
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
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
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
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
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 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import type { Page } from '@playwright/test'; | ||
|
||
import { IS_EE } from './config/constants'; | ||
import { OmnichannelDepartments } from './page-objects'; | ||
import { test, expect } from './utils/test'; | ||
|
||
test.use({ storageState: 'admin-session.json' }); | ||
|
||
test.describe.serial('omnichannel-departments', () => { | ||
test.skip(IS_EE, 'Community Edition Only'); | ||
let poOmnichannelDepartments: OmnichannelDepartments; | ||
|
||
let departmentName: string; | ||
|
||
test.beforeAll(async () => { | ||
departmentName = faker.datatype.uuid(); | ||
}); | ||
|
||
test.beforeEach(async ({ page }: { page: Page }) => { | ||
poOmnichannelDepartments = new OmnichannelDepartments(page); | ||
|
||
await page.goto('/omnichannel'); | ||
await poOmnichannelDepartments.sidenav.linkDepartments.click(); | ||
}); | ||
|
||
test('CE departments', async () => { | ||
await test.step('expect create new department', async () => { | ||
await poOmnichannelDepartments.btnNew.click(); | ||
await poOmnichannelDepartments.btnEnabled.click(); | ||
await poOmnichannelDepartments.inputName.fill(departmentName); | ||
await poOmnichannelDepartments.inputEmail.fill(faker.internet.email()); | ||
await poOmnichannelDepartments.btnSave.click(); | ||
await poOmnichannelDepartments.btnCloseToastSuccess.click(); | ||
|
||
await poOmnichannelDepartments.inputSearch.fill(departmentName); | ||
await expect(poOmnichannelDepartments.firstRowInTable).toBeVisible(); | ||
}); | ||
await test.step('expect to not be possible adding a second department ', async () => { | ||
await poOmnichannelDepartments.btnNew.click(); | ||
|
||
await expect(poOmnichannelDepartments.upgradeDepartmentsModal).toBeVisible(); | ||
|
||
await poOmnichannelDepartments.btnUpgradeDepartmentsModalClose.click(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.