forked from ryanrosello-og/zebrunner-playwright-agent
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform detection: updated userAgent platform with node.js os
updated Playwright platform with node.js os since Playwright browser userAgent string always points to Windows
- Loading branch information
1 parent
c64dd35
commit fe0433f
Showing
5 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
29 changes: 28 additions & 1 deletion
29
build/javascript-agent-playwright/helpers/parseBrowserCapabilities.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
build/javascript-agent-playwright/helpers/parseBrowserCapabilities.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
7 changes: 6 additions & 1 deletion
7
src/javascript-agent-playwright/helpers/parseBrowserCapabilities.ts
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,13 @@ | ||
import UAParser from 'ua-parser-js'; | ||
import * as os from 'os'; | ||
|
||
export const parseBrowserCapabilities = (launchInfo) => { | ||
const parser = new UAParser(); | ||
parser.setUA(launchInfo.use.userAgent); | ||
|
||
return parser.getResult(); | ||
const browserCapabilities = parser.getResult(); | ||
// rewrite platform from pw userAgent string with node.js os since pw userAgent string always points to Windows | ||
browserCapabilities.os.name = os.platform(); | ||
|
||
return browserCapabilities; | ||
}; |