diff --git a/test/config/Browserstack/BrowserstackApi.ts b/test/config/Browserstack/BrowserstackApi.ts new file mode 100644 index 0000000..b137d55 --- /dev/null +++ b/test/config/Browserstack/BrowserstackApi.ts @@ -0,0 +1,20 @@ +import SupportedBrowser from "./SupportedBrowser"; + +export class BrowserstackApi { + private readonly _baseUrl: string = 'https://api.browserstack.com/5'; + private readonly _authorizationHeader: string; + + constructor(username: string, accessKey: string) { + this._authorizationHeader = `Basic ${Buffer.from(`${username}:${accessKey}`).toString('base64')}`; + } + + public async getSupportedBrowsers(): Promise { + const response = await fetch(`${this._baseUrl}/browsers?flat=true`, { + headers: { + 'Authorization': this._authorizationHeader + } + }); + + return response.json() as Promise; + } +} \ No newline at end of file diff --git a/test/config/Browserstack/SupportedBrowser.ts b/test/config/Browserstack/SupportedBrowser.ts new file mode 100644 index 0000000..ba90894 --- /dev/null +++ b/test/config/Browserstack/SupportedBrowser.ts @@ -0,0 +1,10 @@ +type SupportedBrowser = { + os: string; + os_version: string; + browser: string; + device: string; + browser_version: string | null; + real_mobile: boolean; +} + +export default SupportedBrowser \ No newline at end of file diff --git a/test/runner/TestRunner.ts b/test/runner/TestRunner.ts index 9a693c7..314301b 100644 --- a/test/runner/TestRunner.ts +++ b/test/runner/TestRunner.ts @@ -12,9 +12,11 @@ class TestRunner { private static readonly _commandLineOptions: CommandLineOptions = CommandLine.parse(process.argv); public static main(): void { - // const testRunner = new TestRunner(); - // testRunner.run(); + const testRunner = new TestRunner(); + testRunner.run(); + } + public run(): void { console.log(TestRunner._commandLineOptions); } }