Skip to content

Commit e4b31d4

Browse files
samhere06mohas22
andauthored
Updated tests to not wait on API response (#377)
Co-authored-by: mohas22 <[email protected]>
1 parent f79d7b2 commit e4b31d4

File tree

4 files changed

+8
-28
lines changed

4 files changed

+8
-28
lines changed

packages/react-sdk-components/tests/e2e/Digv2/FormFields/Attachment.spec.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,6 @@ test.describe('E2E test', () => {
9696
await expect(multipleAttachment.locator('span[role="button"]:has-text("Choose files")')).toBeVisible();
9797
await page.setInputFiles(`#AttachmentList`, [filePath, filePath2]);
9898

99-
await Promise.all([
100-
page.waitForResponse(
101-
`${endpoints.serverConfig.infinityRestServerUrl}${
102-
endpoints.serverConfig.appAlias ? `/app/${endpoints.serverConfig.appAlias}` : ''
103-
}/api/application/v2/attachments/upload`
104-
)
105-
]);
106-
10799
await expect(page.locator('div >> text="cableinfo.jpg"')).toBeVisible();
108100
await expect(page.locator('div >> text="cablechat.jpg"')).toBeVisible();
109101

packages/react-sdk-components/tests/e2e/Digv2/LandingPages/InlineDashboard.spec.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ test.describe('E2E test', () => {
4646
const caseIdFilter = filters.locator('div:has-text("Case ID")');
4747
caseIdFilter.locator('input').fill(caseID);
4848

49-
await page.waitForResponse('**/data_views/D_ComplexFieldsList');
49+
const pagination = page.locator('div[id="pagination"]');
50+
await expect(pagination.locator('p:has-text("1-1 of 1")')).toBeVisible();
5051

5152
await expect(table.locator(`td >> text=${caseID}`)).toBeVisible();
5253
await expect(table.locator('td >> text="Complex Fields"')).toBeVisible();
@@ -69,10 +70,7 @@ test.describe('E2E test', () => {
6970

7071
const complexTable = page.locator('div[id="list-view"] >> nth=0');
7172

72-
await expect(complexTable.locator(`td:has-text("${day.getDate().toString().padStart(2, '0')}")`)).toBeVisible();
73-
74-
const pagination = page.locator('div[id="pagination"]');
75-
await expect(pagination.locator('p:has-text("1-1 of 1")')).toBeVisible();
73+
await expect(await complexTable.locator(`td:has-text("${day.getDate().toString().padStart(2, '0')}")`)).toBeVisible();
7674

7775
await page.locator('a:has-text("Clear All")').click();
7876

packages/react-sdk-components/tests/e2e/MediaCo/portal.spec.js

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,13 @@ test.describe('E2E test', () => {
106106
const attachmentID = await page.locator('div[id="attachment-ID"]').textContent();
107107
await page.setInputFiles(`#${attachmentID}`, filePath);
108108

109-
await Promise.all([
110-
page.waitForResponse(
111-
`${endpoints.serverConfig.infinityRestServerUrl}${
112-
endpoints.serverConfig.appAlias ? `/app/${endpoints.serverConfig.appAlias}` : ''
113-
}/api/application/v2/attachments/upload`
114-
)
115-
]);
109+
await page.waitForTimeout(5000);
110+
await expect(page.locator('CircularProgress')).not.toBeVisible();
116111

117112
await page.locator('button:has-text("submit")').click();
118113

119-
await Promise.all([
120-
page.waitForResponse(
121-
`${endpoints.serverConfig.infinityRestServerUrl}${
122-
endpoints.serverConfig.appAlias ? `/app/${endpoints.serverConfig.appAlias}` : ''
123-
}/api/application/v2/cases/${currentCaseID}/attachments?includeThumbnail=false`
124-
)
125-
]);
114+
const todo = page.locator('h6:has-text("Manager Discount")');
115+
await expect(todo).toBeVisible();
126116

127117
const attachmentCount = await page.locator('div[id="attachments-count"]').textContent();
128118
await expect(Number(attachmentCount)).toBeGreaterThan(0);

playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const config = {
3535
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
3636
use: {
3737
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
38-
actionTimeout: 0,
38+
actionTimeout: 50000,
3939
/* Base URL to use in actions like `await page.goto('/')`. */
4040
// baseURL: 'http://localhost:3000',
4141

0 commit comments

Comments
 (0)