Skip to content

Commit f50e6e7

Browse files
4manasamanasa
andauthored
Fixed the failed playwright tests (#293)
Co-authored-by: manasa <[email protected]>
1 parent 01d10ef commit f50e6e7

File tree

10 files changed

+26
-9
lines changed

10 files changed

+26
-9
lines changed

packages/angular-sdk-components/src/lib/_components/field/decimal/decimal.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angul
44
import { MatInputModule } from '@angular/material/input';
55
import { MatFormFieldModule } from '@angular/material/form-field';
66
import { NgxCurrencyDirective, NgxCurrencyInputMode } from 'ngx-currency';
7+
import { interval } from 'rxjs';
78
import { AngularPConnectData, AngularPConnectService } from '../../../_bridge/angular-pconnect';
89
import { Utils } from '../../../_helpers/utils';
910
import { ComponentMapperComponent } from '../../../_bridge/component-mapper/component-mapper.component';
@@ -195,6 +196,16 @@ export class DecimalComponent implements OnInit, OnDestroy {
195196
this.decimalPrecision = this.configProps$?.decimalPrecision ?? 2;
196197

197198
this.componentReference = this.pConn$.getStateProps().value;
199+
200+
// trigger display of error message with field control
201+
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
202+
const timer = interval(100).subscribe(() => {
203+
this.fieldControl.setErrors({ message: true });
204+
this.fieldControl.markAsTouched();
205+
206+
timer.unsubscribe();
207+
});
208+
}
198209
}
199210

200211
fieldOnBlur(event: any) {

packages/angular-sdk-components/src/lib/_components/infra/Containers/flow-container/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function hasAssignments(pConnect) {
3333
const assignments = pConnect.getValue(CASE_INFO.D_CASE_ASSIGNMENTS_RESULTS);
3434
const childCasesAssignments = getChildCaseAssignments(pConnect);
3535

36-
return assignments || childCasesAssignments || isCaseWideLocalAction(pConnect);
36+
return assignments || childCasesAssignments?.length || isCaseWideLocalAction(pConnect);
3737
}
3838

3939
export const showBanner = getPConnect => {

packages/angular-sdk-components/src/lib/_components/template/simple-table-manual/simple-table-manual.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h3 *ngIf="label" className="label" style="font-weight: bold">
5757
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
5858
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
5959
<tr class="mat-row psdk-no-records" *matNoDataRow>
60-
<td class="mat-cell" [attr.colspan]="displayedColumns.length">
60+
<td id="no-records" class="mat-cell" [attr.colspan]="displayedColumns.length">
6161
{{ utils.getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.') }}
6262
</td>
6363
</tr>
@@ -89,7 +89,7 @@ <h3 *ngIf="label" className="label" style="font-weight: bold">
8989
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
9090
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
9191
<tr class="mat-row psdk-no-records" *matNoDataRow>
92-
<td class="mat-cell" [attr.colspan]="displayedColumns.length">
92+
<td id="no-records" class="mat-cell" [attr.colspan]="displayedColumns.length">
9393
{{ utils.getGenericFieldsLocalizedValue('CosmosFields.fields.lists', 'No records found.') }}
9494
</td>
9595
</tr>

packages/angular-sdk-components/src/lib/_components/widget/todo/todo.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
display: inline-flex;
6767
width: 100%;
6868
padding: 0.625rem 0rem;
69+
align-items: center;
6970
}
7071

7172
.psdk-todo-assignment-data {

projects/angular-test-app/tests/e2e/DigV2/ComplexFields/EmbeddedData.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ test.describe('E2E test', () => {
5757
await editModeType.click();
5858
await page.locator('mat-option > span:has-text("Table rows")').click();
5959

60-
const noRecordsMsg = page.locator('div[id="no-records"]');
61-
await expect(noRecordsMsg.locator('text="No Records Found."')).toBeVisible();
60+
const noRecordsMsg = page.locator('td[id="no-records"]');
61+
await expect(noRecordsMsg.locator('text="No records found."')).toBeVisible();
6262

6363
/** Creating row by clicking on `+Add` button */
6464
await page.locator('button:has-text("+ Add")').click();
@@ -202,7 +202,7 @@ test.describe('E2E test', () => {
202202
editMenu = await page.locator('div[role="menu"]');
203203
await editMenu.locator('button:has-text("Delete")').click();
204204

205-
await expect(page.locator('div[id="no-records"]:has-text("No Records Found.")')).toBeVisible();
205+
await expect(page.locator('td[id="no-records"]:has-text("No Records Found.")')).toBeVisible();
206206

207207
await page.locator('button:has-text("Next")').click();
208208

projects/angular-test-app/tests/e2e/DigV2/FormFields/Date.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ test.describe('E2E test', () => {
5454
await requiredDate.click();
5555
const futureDate = common.getFutureDate();
5656
await requiredDate.fill(futureDate);
57+
requiredDate.blur();
5758

5859
await expect(page.locator('mat-error')).toBeHidden();
5960

projects/angular-test-app/tests/e2e/DigV2/FormFields/DateTime.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ test.describe('E2E test', () => {
6060
.padStart(2, '0')} AM`;
6161
await requiredDateTime.click();
6262
await requiredDateTime.pressSequentially(formattedDate);
63+
requiredDateTime.blur();
6364

6465
await expect(page.locator('mat-error')).toBeHidden();
6566

projects/angular-test-app/tests/e2e/DigV2/FormFields/Email.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ test.describe('E2E test', () => {
5151
/** Required tests */
5252
const requiredEmail = page.locator('input[data-test-id="96fa7548c363cdd5adb29c2c2749e436"]');
5353

54-
requiredEmail.fill('[email protected]');
54+
await requiredEmail.fill('[email protected]');
55+
requiredEmail.blur();
5556
await expect(page.locator('mat-error')).toBeHidden();
5657

5758
attributes = await common.getAttributes(requiredEmail);

projects/angular-test-app/tests/e2e/DigV2/FormFields/Integer.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ test.describe('E2E test', () => {
5050

5151
/** Required tests */
5252
const requiredInteger = page.locator('input[data-test-id="0658481a174254dded4a0c1ffe6b8380"]');
53-
requiredInteger.fill('10000');
53+
await requiredInteger.fill('10000');
54+
requiredInteger.blur();
5455
await expect(page.locator('mat-error')).toBeHidden();
5556

5657
attributes = await common.getAttributes(requiredInteger);

projects/angular-test-app/tests/e2e/DigV2/FormFields/Phone.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ test.describe('E2E test', () => {
5959
await expect(page.locator('mat-error')).toBeVisible();
6060

6161
const requiredPhone = page.locator('ngx-mat-intl-tel-input[data-test-id="af983eaa1b85b015a7654702abd0b249"] >> input');
62-
requiredPhone.fill('6175551212');
62+
await requiredPhone.fill('6175551212');
63+
requiredPhone.blur();
6364
await expect(page.locator('mat-error')).toBeHidden();
6465

6566
/** Selecting Disable from the Sub Category dropdown */

0 commit comments

Comments
 (0)