@appliqation/automation-sdk 2.1.4 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appliqation/automation-sdk",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Appliqation Automation SDK with API key authentication, custom run titles, and framework-specific reporters",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -554,7 +554,21 @@ class AppliqationReporter {
554
554
  continue;
555
555
  }
556
556
 
557
- const browserName = project.use?.browserName;
557
+ // Get browser name from project - check multiple sources
558
+ let browserName = project.use?.browserName || project.use?.defaultBrowserType;
559
+
560
+ // Fallback to project name if it matches browser names
561
+ if (!browserName) {
562
+ const projectName = (project.name || '').toLowerCase();
563
+ if (projectName.includes('chromium') || projectName.includes('chrome')) {
564
+ browserName = 'chromium';
565
+ } else if (projectName.includes('firefox')) {
566
+ browserName = 'firefox';
567
+ } else if (projectName.includes('webkit') || projectName.includes('safari')) {
568
+ browserName = 'webkit';
569
+ }
570
+ }
571
+
558
572
  if (!browserName) continue;
559
573
 
560
574
  try {
@@ -565,20 +579,20 @@ class AppliqationReporter {
565
579
  switch (browserName.toLowerCase()) {
566
580
  case 'chromium':
567
581
  case 'chrome':
568
- browser = await chromium.launch();
582
+ browser = await chromium.launch({ headless: true });
569
583
  version = browser.version();
570
584
  await browser.close();
571
585
  break;
572
586
 
573
587
  case 'firefox':
574
- browser = await firefox.launch();
588
+ browser = await firefox.launch({ headless: true });
575
589
  version = browser.version();
576
590
  await browser.close();
577
591
  break;
578
592
 
579
593
  case 'webkit':
580
594
  case 'safari':
581
- browser = await webkit.launch();
595
+ browser = await webkit.launch({ headless: true });
582
596
  version = browser.version();
583
597
  await browser.close();
584
598
  break;
@@ -220,9 +220,9 @@ class DeviceOsDetector {
220
220
  'linux': 'Linux',
221
221
  'ubuntu': 'Ubuntu',
222
222
  'android': 'Android',
223
- 'ios': 'iOS',
224
- 'iphone': 'iOS',
225
- 'ipad': 'iOS'
223
+ 'ios': 'macOS',
224
+ 'iphone': 'macOS',
225
+ 'ipad': 'macOS'
226
226
  };
227
227
 
228
228
  for (const [keyword, os] of Object.entries(osMap)) {
@@ -246,7 +246,7 @@ class DeviceOsDetector {
246
246
  if (/mac os x/i.test(userAgent)) return 'macOS';
247
247
  if (/macintosh/i.test(userAgent)) return 'macOS';
248
248
  if (/android/i.test(userAgent)) return 'Android';
249
- if (/ipad|iphone|ipod/i.test(userAgent)) return 'iOS';
249
+ if (/ipad|iphone|ipod/i.test(userAgent)) return 'macOS';
250
250
  if (/linux/i.test(userAgent)) return 'Linux';
251
251
  if (/ubuntu/i.test(userAgent)) return 'Ubuntu';
252
252
 
@@ -299,7 +299,8 @@ class DeviceOsDetector {
299
299
 
300
300
  // Check browserName property FIRST (takes precedence over project name)
301
301
  // This allows explicit browser version strings like "chrome142" or "safari 18.7.2"
302
- const browserName = project.use?.browserName;
302
+ // Also check defaultBrowserType from Playwright device presets
303
+ const browserName = project.use?.browserName || project.use?.defaultBrowserType;
303
304
  let browserVersion = project.use?.metadata?.browserVersion;
304
305
 
305
306
  // Auto-detect browser version if browser instance provided and no manual version