Skip to content
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

Update Playwright version #1728

Merged
merged 12 commits into from
Jan 16, 2024
2 changes: 1 addition & 1 deletion angular-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"karma-jasmine": "^5.1.0",
m-akinc marked this conversation as resolved.
Show resolved Hide resolved
"karma-jasmine-html-reporter": "^2.0.0",
"ng-packagr": "^15.2.2",
"playwright": "^1.30.0",
"playwright": "1.40.0",
"rollup": "^3.10.1",
"typescript": "~4.8.2"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Update Playwright version",
"packageName": "@ni/nimble-blazor",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "none"
}
m-akinc marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Update Playwright version",
"packageName": "@ni/nimble-components",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "none"
}
55 changes: 15 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"description": "The NI Nimble Design System Monorepo",
"scripts": {
"postinstall": "patch-package",
"postinstall": "patch-package && npm run playwright:setup",
"playwright:setup": "playwright install --with-deps",
m-akinc marked this conversation as resolved.
Show resolved Hide resolved
"build": "npm run build --workspaces --if-present",
"lint": "npm run lint --workspaces --if-present",
"format": "npm run format --workspaces --if-present",
Expand Down Expand Up @@ -44,6 +45,7 @@
"@lhci/cli": "^0.12.0",
"beachball": "^2.31.0",
"cross-env": "^7.0.3",
"patch-package": "^6.4.7"
"patch-package": "^6.4.7",
"playwright": "1.40.0"
m-akinc marked this conversation as resolved.
Show resolved Hide resolved
}
}
2 changes: 1 addition & 1 deletion packages/nimble-blazor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@ni/eslint-config-javascript": "^4.2.0",
"@ni/nimble-components": "*",
"@ni/nimble-tokens": "*",
"playwright": "1.36.0",
"playwright": "1.40.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"cross-env": "^7.0.3",
"glob": "^8.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/nimble-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"karma-spec-reporter": "^0.0.36",
"karma-webkit-launcher": "^2.1.0",
"karma-webpack": "^5.0.0",
"playwright": "^1.30.0",
"playwright": "1.40.0",
"prettier": "^2.8.8",
"prettier-eslint": "^15.0.1",
"prettier-eslint-cli": "^7.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,11 @@ export class TablePageObject<T extends TableRecord> {

public getCellRenderedWidth(rowIndex: number, columnIndex: number): number {
const cell = this.getCell(rowIndex, columnIndex);
return cell.getBoundingClientRect().width;
const actualWidth = cell.getBoundingClientRect().width;
// Round to one decimal place. This is to work around a bug in Chrome related to
// fractional widths (e.g. '1fr') in grid layouts that results in some numerical
// precision issues. See: https://bugs.chromium.org/p/chromium/issues/detail?id=1515685
return Math.round(actualWidth * 10) / 10;
rajsite marked this conversation as resolved.
Show resolved Hide resolved
}

public getTotalCellRenderedWidth(): number {
Expand Down Expand Up @@ -613,17 +617,17 @@ export class TablePageObject<T extends TableRecord> {
return headerContainers[index]!.querySelector('.column-divider.left');
}

public isHorizontalScrollbarVisible(): boolean {
public isVerticalScrollbarVisible(): boolean {
return (
this.tableElement.viewport.clientHeight
!== this.tableElement.viewport.getBoundingClientRect().height
< this.tableElement.viewport.scrollHeight
);
}

public isVerticalScrollbarVisible(): boolean {
public isHorizontalScrollbarVisible(): boolean {
return (
this.tableElement.viewport.clientWidth
!== this.tableElement.viewport.getBoundingClientRect().width
< this.tableElement.viewport.scrollWidth
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,10 @@ describe('Table Interactive Column Sizing', () => {
0,
1
);
pageObject.dragSizeColumnByRightDivider(0, [50]);
pageObject.dragSizeColumnByRightDivider(0, [5]);
rajsite marked this conversation as resolved.
Show resolved Hide resolved
await waitForUpdatesAsync();
expect(pageObject.getCellRenderedWidth(0, 1)).toBe(
secondVisibleCellWidth - 50
secondVisibleCellWidth - 5
);
});

Expand All @@ -578,10 +578,10 @@ describe('Table Interactive Column Sizing', () => {
0,
1
);
pageObject.dragSizeColumnByRightDivider(1, [-50]);
pageObject.dragSizeColumnByRightDivider(1, [-5]);
await waitForUpdatesAsync();
expect(pageObject.getCellRenderedWidth(0, 1)).toBe(
secondVisibleCellWidth - 50
secondVisibleCellWidth - 5
);
});

Expand Down
Loading