-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
28 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import {test} from '@playwright/test'; | ||
|
||
import {TEST_URL, WidgetComponentIds} from "./const"; | ||
import {assertScreenshot, clickNthChip, loadWidget, sendTextMessage} from "./utils"; | ||
import { test } from '@playwright/test'; | ||
|
||
import { TEST_URL, WidgetComponentIds } from './const'; | ||
import { assertScreenshot, clickNthChip, loadWidget, sendTextMessage } from './utils'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto(TEST_URL); | ||
|
@@ -21,18 +20,18 @@ test.beforeEach(async ({ page }) => { | |
*/ | ||
test('100', async ({ page, browserName }) => { | ||
await loadWidget(page); | ||
|
||
// 1 | ||
await sendTextMessage(page, 'Give me a food order form', 0); | ||
const widgetWindow = page.locator(WidgetComponentIds.FORM); | ||
await widgetWindow.waitFor({ state: 'visible' }); | ||
await assertScreenshot(page, '100-1', browserName); | ||
|
||
// 2 | ||
let submitButton = page.locator(WidgetComponentIds.BUTTON); | ||
await submitButton.click(); | ||
await assertScreenshot(page, '100-2', browserName); | ||
|
||
// 3 | ||
const inputs = page.locator(WidgetComponentIds.INPUT); | ||
await inputs.nth(0).fill('guy ordering food'); | ||
|
@@ -43,7 +42,7 @@ test('100', async ({ page, browserName }) => { | |
submitButton = page.locator(WidgetComponentIds.BUTTON); | ||
await page.waitForTimeout(1000); | ||
await assertScreenshot(page, '100-3', browserName); | ||
|
||
// 4 | ||
await inputs.nth(2).fill('2'); | ||
await inputs.nth(3).fill('[email protected]'); | ||
|
@@ -95,33 +94,33 @@ test('103', async ({ page, browserName }) => { | |
// 1 | ||
await sendTextMessage(page, 'Suggested replies', 2000); | ||
await assertScreenshot(page, '103-1', browserName); | ||
|
||
// 2 | ||
let options = page.locator(WidgetComponentIds.SUGGESTED_REPLIES_OPTIONS); | ||
await options.nth(0).click(); | ||
await page.waitForTimeout(1000); | ||
await assertScreenshot(page, '103-2', browserName); | ||
|
||
// 3 | ||
options = page.locator(WidgetComponentIds.SUGGESTED_REPLIES_OPTIONS); | ||
await options.nth(0).click(); | ||
await page.waitForTimeout(1000); | ||
await assertScreenshot(page, '103-3', browserName); | ||
|
||
// 4 | ||
options = page.locator(WidgetComponentIds.SUGGESTED_REPLIES_OPTIONS); | ||
await options.nth(1).click(); | ||
await page.waitForTimeout(4000); // Time takes long for file message to be rendered and then scrolled to bottom in CI browsers. | ||
await assertScreenshot(page, '103-4', browserName); | ||
|
||
// 5 | ||
options = page.locator(WidgetComponentIds.SUGGESTED_REPLIES_OPTIONS); | ||
await options.nth(0).click(); | ||
options = page.locator(WidgetComponentIds.SUGGESTED_REPLIES_OPTIONS); | ||
// Expecting three options. | ||
await options.nth(2).waitFor({ state: 'visible' }); | ||
await assertScreenshot(page, '103-5', browserName); | ||
|
||
// 6 | ||
options = page.locator(WidgetComponentIds.SUGGESTED_REPLIES_OPTIONS); | ||
await options.nth(2).click(); | ||
|
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