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

chore: refactor(move) browser-installer utils #1045

Merged
merged 1 commit into from
Dec 26, 2024

Conversation

KuznetsovRoman
Copy link
Member

@KuznetsovRoman KuznetsovRoman commented Dec 25, 2024

This PR does not change Testplane behaviour

type DownloadProgressCallback,
} from "../utils";
import registry from "../registry";
import { normalizeChromeVersion } from "../utils";
import { installUbuntuPackageDependencies } from "../ubuntu-packages";
import { installChromeDriver } from "./driver";
import { BrowserName } from "../../browser/types";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browser from "../utils" -> BrowserName from "../../browser/types"

@@ -5,21 +5,25 @@ import {
getBrowserPlatform,
getChromeDriverDir,
getMilestone,
Driver,
DriverName,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Driver -> DriverName

export type SupportedBrowser = (typeof Browser)[keyof typeof Browser];
export type SupportedDriver = (typeof Driver)[keyof typeof Driver];

export const getNormalizedBrowserName = (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to "src/browser/utils"

import { MIN_CHROME_VERSION_SUPPORT_ISOLATION } from "../constants/browser";

export const isSupportIsolation = (browserName: string, browserVersion = ""): boolean => {
const browserVersionMajor = browserVersion.split(".")[0];

return browserName === "chrome" && Number(browserVersionMajor) >= MIN_CHROME_VERSION_SUPPORT_ISOLATION;
};

export const getNormalizedBrowserName = (browserName?: string): W3CBrowserName | null => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved from "src/browser-installer/utils"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed from ".js"

EDGE: "MicrosoftEdge",
} as const;

export type W3CBrowserName = Exclude<(typeof BrowserName)[keyof typeof BrowserName], PuppeteerBrowser.CHROMIUM>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"chromium", unlike others, is not a valid W3C browser name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to ".ts"

@KuznetsovRoman KuznetsovRoman merged commit 812bfe8 into master Dec 26, 2024
2 checks passed
@KuznetsovRoman KuznetsovRoman deleted the TESTPLANE-386.chore_move_utils branch December 26, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants