@appliqation/automation-sdk 2.1.4 → 2.1.6

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.6",
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",
@@ -97,11 +97,21 @@ class AppliqationReporter {
97
97
  return;
98
98
  }
99
99
 
100
- // Filter out projects that have custom restrictive testMatch patterns in the original config
101
- // (e.g., API project with /.*\.api\.spec\.js/)
102
- // Note: When you run "npx playwright test file.spec.js", Playwright adds testMatch to ALL projects
103
- // So we need to check if testMatch is a CUSTOM pattern (contains ".api" or similar)
100
+ // Get project names that are actually running (honors --project filter)
101
+ const runningProjectNames = this.getRunningProjectNames(suite);
102
+ logger.debug('Projects actually running:', runningProjectNames);
103
+
104
+ // Filter projects to only those that are:
105
+ // 1. Actually running (honors --project filter)
106
+ // 2. NOT API-specific projects
104
107
  const browserProjects = config.projects.filter(project => {
108
+ // CRITICAL: Only include projects that are actually being executed
109
+ // This honors the --project CLI filter
110
+ if (runningProjectNames.length > 0 && !runningProjectNames.includes(project.name)) {
111
+ logger.debug(`Excluding project "${project.name}" - not in running projects list`);
112
+ return false;
113
+ }
114
+
105
115
  // Check if testMatch is a custom API-specific pattern
106
116
  if (project.testMatch) {
107
117
  const testMatchStr = project.testMatch.toString();
@@ -554,7 +564,21 @@ class AppliqationReporter {
554
564
  continue;
555
565
  }
556
566
 
557
- const browserName = project.use?.browserName;
567
+ // Get browser name from project - check multiple sources
568
+ let browserName = project.use?.browserName || project.use?.defaultBrowserType;
569
+
570
+ // Fallback to project name if it matches browser names
571
+ if (!browserName) {
572
+ const projectName = (project.name || '').toLowerCase();
573
+ if (projectName.includes('chromium') || projectName.includes('chrome')) {
574
+ browserName = 'chromium';
575
+ } else if (projectName.includes('firefox')) {
576
+ browserName = 'firefox';
577
+ } else if (projectName.includes('webkit') || projectName.includes('safari')) {
578
+ browserName = 'webkit';
579
+ }
580
+ }
581
+
558
582
  if (!browserName) continue;
559
583
 
560
584
  try {
@@ -565,20 +589,20 @@ class AppliqationReporter {
565
589
  switch (browserName.toLowerCase()) {
566
590
  case 'chromium':
567
591
  case 'chrome':
568
- browser = await chromium.launch();
592
+ browser = await chromium.launch({ headless: true });
569
593
  version = browser.version();
570
594
  await browser.close();
571
595
  break;
572
596
 
573
597
  case 'firefox':
574
- browser = await firefox.launch();
598
+ browser = await firefox.launch({ headless: true });
575
599
  version = browser.version();
576
600
  await browser.close();
577
601
  break;
578
602
 
579
603
  case 'webkit':
580
604
  case 'safari':
581
- browser = await webkit.launch();
605
+ browser = await webkit.launch({ headless: true });
582
606
  version = browser.version();
583
607
  await browser.close();
584
608
  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