Skip to content

Commit

Permalink
chore: adjusted e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva committed Oct 16, 2023
1 parent 80edc87 commit ec23494
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ const ForwardChatModal = ({
<FieldLabel>{t('Forward_to_user')}</FieldLabel>
<FieldRow>
<AutoCompleteAgent
onlyAvailable
withTitle
onlyAvailable
value={getValues().username}
excludeId={room.servedBy?._id}
showIdleAgents={idleAgentsAllowedForForwarding}
placeholder={t('Username')}
onChange={(value) => {
setValue('username', value);
}}
value={getValues().username}
/>
</FieldRow>
</Field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ test.describe('omnichannel-transfer-to-another-agent', () => {
await agent2.poHomeOmnichannel.sidenav.switchStatus('offline');

await agent1.poHomeOmnichannel.content.btnForwardChat.click();
await agent1.poHomeOmnichannel.content.inputModalAgentUserName.click();
await agent1.poHomeOmnichannel.content.inputModalAgentUserName.type('user2');
await expect(agent1.page.locator('text=Empty')).toBeVisible();

Expand All @@ -76,6 +77,7 @@ test.describe('omnichannel-transfer-to-another-agent', () => {

await agent1.poHomeOmnichannel.sidenav.getSidebarItemByName(newVisitor.name).click();
await agent1.poHomeOmnichannel.content.btnForwardChat.click();
await agent1.poHomeOmnichannel.content.inputModalAgentUserName.click();
await agent1.poHomeOmnichannel.content.inputModalAgentUserName.type('user2');
await agent1.page.locator('.rcx-option .rcx-option__wrapper >> text="user2"').click();
await agent1.poHomeOmnichannel.content.inputModalAgentForwardComment.type('any_comment');
Expand Down
14 changes: 3 additions & 11 deletions apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class HomeContent {
}

get inputModalAgentUserName(): Locator {
return this.page.locator('#modal-root input:nth-child(1)');
return this.page.locator('#modal-root input[placeholder="Username"]');
}

get inputModalAgentForwardComment(): Locator {
Expand Down Expand Up @@ -237,16 +237,8 @@ export class HomeContent {

async openLastThreadMessageMenu(): Promise<void> {
await this.page.locator('//main//aside >> [data-qa-type="message"]').last().hover();
await this.page
.locator('//main//aside >> [data-qa-type="message"]')
.last()
.locator('role=button[name="More"]')
.waitFor();
await this.page
.locator('//main//aside >> [data-qa-type="message"]')
.last()
.locator('role=button[name="More"]')
.click();
await this.page.locator('//main//aside >> [data-qa-type="message"]').last().locator('role=button[name="More"]').waitFor();
await this.page.locator('//main//aside >> [data-qa-type="message"]').last().locator('role=button[name="More"]').click();
}

async toggleAlsoSendThreadToChannel(isChecked: boolean): Promise<void> {
Expand Down

0 comments on commit ec23494

Please sign in to comment.