Repository navigation
Chore: Create tests for Omnichannel admin add a custom fields #26609
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1edec20
test: expect admin add a custom fild
weslley543 a64550f
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 56b6c18
merging from develop
weslley543 a97f4c1
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 73c2715
resolve conflicts from develop
weslley543 ef58691
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 5d46717
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 edf1775
lint: fix
weslley543 ab745e0
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 4b2729c
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 582d874
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 198e795
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 1a2e12e
Update apps/meteor/tests/e2e/omnichannel-custom-fields.spec.ts
weslley543 d779743
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 234ca03
chore: fix suite description
weslley543 c80286d
Merge branch 'develop' into test/omnichannel-add-custom-field
weslley543 9e296ca
Merge branch 'develop' into test/omnichannel-add-custom-field
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 { test, expect } from './utils/test'; | ||
| import { OmnichannelCustomFields } from './page-objects'; | ||
|
|
||
| test.use({ storageState: 'admin-session.json' }); | ||
|
|
||
| test.describe.serial('omnichannel-agents', () => { | ||
| let poOmnichannelCustomFields: OmnichannelCustomFields; | ||
| const newField = 'any_field'; | ||
| test.beforeEach(async ({ page }) => { | ||
| poOmnichannelCustomFields = new OmnichannelCustomFields(page); | ||
|
|
||
| await page.goto('/omnichannel'); | ||
| await poOmnichannelCustomFields.sidenav.linkCustomFields.click(); | ||
| }); | ||
|
|
||
| test('expect add new "custom field"', async ({ page }) => { | ||
| await poOmnichannelCustomFields.btnAdd.click(); | ||
|
|
||
| await page.waitForURL('/omnichannel/customfields/new'); | ||
| await poOmnichannelCustomFields.inputField.type(newField); | ||
| await poOmnichannelCustomFields.inputLabel.type('any_label'); | ||
|
|
||
| await poOmnichannelCustomFields.btnSave.click(); | ||
|
|
||
| await expect(poOmnichannelCustomFields.firstRowInTable(newField)).toBeVisible(); | ||
| }); | ||
|
|
||
| test('expect update "newField"', async ({ page }) => { | ||
| const newLabel = 'new_any_label'; | ||
| await poOmnichannelCustomFields.inputSearch.fill(newField); | ||
| await poOmnichannelCustomFields.firstRowInTable(newField).click(); | ||
|
|
||
| await poOmnichannelCustomFields.inputLabel.fill('new_any_label'); | ||
| await poOmnichannelCustomFields.btnEditSave.click(); | ||
|
|
||
| await expect(page.locator(`[qa-user-id="${newField}"] td:nth-child(2)`)).toHaveText(newLabel); | ||
| }); | ||
|
|
||
| test('expect remove "new_field"', async () => { | ||
| await poOmnichannelCustomFields.inputSearch.fill(newField); | ||
| await poOmnichannelCustomFields.btnDeletefirstRowInTable.click(); | ||
| await poOmnichannelCustomFields.btnModalRemove.click(); | ||
|
|
||
| await poOmnichannelCustomFields.inputSearch.fill(newField); | ||
| expect(poOmnichannelCustomFields.firstRowInTable(newField)).toBeHidden(); | ||
| }); | ||
| }); | ||
This file contains hidden or 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 hidden or 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
50 changes: 50 additions & 0 deletions
50
apps/meteor/tests/e2e/page-objects/omnichannel-custom-fields.ts
This file contains hidden or 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,50 @@ | ||
| import type { Locator, Page } from '@playwright/test'; | ||
|
|
||
| import { OmnichannelSidenav } from './fragments'; | ||
|
|
||
| export class OmnichannelCustomFields { | ||
| private readonly page: Page; | ||
|
|
||
| readonly sidenav: OmnichannelSidenav; | ||
|
|
||
| constructor(page: Page) { | ||
| this.page = page; | ||
| this.sidenav = new OmnichannelSidenav(page); | ||
| } | ||
|
|
||
| get btnAdd(): Locator { | ||
| return this.page.locator('[data-qa-id="CustomFieldPageBtnNew"]'); | ||
| } | ||
|
|
||
| get inputField(): Locator { | ||
| return this.page.locator('[placeholder="Field"]'); | ||
| } | ||
|
|
||
| get inputLabel(): Locator { | ||
| return this.page.locator('[placeholder="Label"]'); | ||
| } | ||
|
|
||
| get btnSave(): Locator { | ||
| return this.page.locator('[data-qa-id="NewCustomFieldsPageButtonSave"]'); | ||
| } | ||
|
|
||
| get inputSearch(): Locator { | ||
| return this.page.locator('[placeholder="Search"]'); | ||
| } | ||
|
|
||
| get btnEditSave(): Locator { | ||
| return this.page.locator('[data-qa-id="BtnSaveEditCustomFieldsPage"]'); | ||
| } | ||
|
|
||
| firstRowInTable(filedName: string) { | ||
| return this.page.locator(`[qa-user-id="${filedName}"]`); | ||
| } | ||
|
|
||
| get btnDeletefirstRowInTable() { | ||
| return this.page.locator('button[title="Remove"]'); | ||
| } | ||
|
|
||
| get btnModalRemove(): Locator { | ||
| return this.page.locator('#modal-root dialog .rcx-modal__inner .rcx-modal__footer .rcx-button--danger'); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.