@alfresco/aca-playwright-shared 7.3.0-20361735780 → 7.3.0-20459910033

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.
@@ -22,4 +22,13 @@
22
22
  * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
23
23
  */
24
24
  import { PlaywrightTestConfig } from '@playwright/test';
25
+ export declare function createSuiteProjects(suiteName: string, testDir: string, useConfig?: Record<string, any>, projectConfig?: Record<string, any>): {
26
+ name: string;
27
+ testDir: string;
28
+ use: any;
29
+ }[];
30
+ export declare function getBrowserProjects(): {
31
+ name: string;
32
+ use: any;
33
+ }[];
25
34
  export declare const getGlobalConfig: PlaywrightTestConfig;
@@ -28,6 +28,7 @@ export declare const getReportPortalConfig: () => {
28
28
  project: string;
29
29
  launch: string;
30
30
  includeTestSteps: boolean;
31
+ skipPassed: boolean;
31
32
  restClientConfig: {
32
33
  timeout: number;
33
34
  };
@@ -104,16 +104,35 @@ const timeouts = {
104
104
  * You should have received a copy of the GNU Lesser General Public License
105
105
  * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
106
106
  */
107
+ const getCurrentBrowser = () => (process.env.PLAYWRIGHT_BROWSER || 'chrome').toLowerCase();
107
108
  const getExcludedTestsRegExpArray = (excludedJson, projectName) => {
108
109
  const prefix = `[ 🎭 Playwright Excludes - ${projectName} ]`;
109
- const objectKeys = Object.keys(excludedJson);
110
- if (!objectKeys.length) {
111
- console.info(`${prefix} No excluded tests 🎉 `);
110
+ const currentBrowser = getCurrentBrowser();
111
+ const browserKeys = ['all', 'firefox', 'chromium', 'webkit', 'msedge'];
112
+ const relevantKeys = [];
113
+ const testIdsToExclude = [];
114
+ // Always include 'all' if it exists
115
+ if (excludedJson.all && typeof excludedJson.all === 'object') {
116
+ const allTestIds = Object.keys(excludedJson.all);
117
+ testIdsToExclude.push(...allTestIds);
118
+ relevantKeys.push('all');
119
+ }
120
+ // Include current browser-specific exclusions
121
+ const browserKey = browserKeys.find((key) => key.toLowerCase() === currentBrowser);
122
+ if (browserKey && excludedJson[browserKey] && typeof excludedJson[browserKey] === 'object') {
123
+ const browserTestIds = Object.keys(excludedJson[browserKey]);
124
+ testIdsToExclude.push(...browserTestIds);
125
+ if (!relevantKeys.includes(browserKey)) {
126
+ relevantKeys.push(browserKey);
127
+ }
128
+ }
129
+ if (testIdsToExclude.length > 0) {
130
+ console.warn(`${prefix} ❌ Tests excluded for browser '${currentBrowser}' because of 🐛 : ${testIdsToExclude.join(', ')} (from keys: ${relevantKeys.join(', ')})`);
112
131
  }
113
132
  else {
114
- console.warn(`${prefix} Tests excluded because of 🐛 : ${objectKeys}`);
133
+ console.info(`${prefix} No excluded tests for browser '${currentBrowser}' 🎉`);
115
134
  }
116
- return objectKeys.map((key) => new RegExp(key));
135
+ return testIdsToExclude.map((key) => new RegExp(key));
117
136
  };
118
137
 
119
138
  /*!
@@ -4484,27 +4503,35 @@ async function removeOutputFolders() {
4484
4503
  */
4485
4504
  const { env: env$1 } = process;
4486
4505
  const getReportPortalConfig = () => {
4506
+ const browser = (env$1.PLAYWRIGHT_BROWSER || 'chrome').toLowerCase();
4487
4507
  const attributes = [
4488
4508
  { key: 'Job', value: `${env$1.GITHUB_JOB}` },
4489
4509
  { key: 'Build_type', value: `${env$1.GITHUB_EVENT_NAME}` },
4490
4510
  { key: 'Repository', value: `${env$1.GITHUB_REPOSITORY}` },
4491
- { key: 'Branch', value: `${env$1.GITHUB_HEAD_REF || env$1.GITHUB_REF}` }
4511
+ { key: 'Branch', value: `${env$1.GITHUB_HEAD_REF || env$1.GITHUB_REF}` },
4512
+ { key: 'Browser', value: browser }
4492
4513
  ];
4493
- const launch = `GitHub Actions - ACA`;
4514
+ const launch = `GitHub Actions - ACA - ${browser}`;
4494
4515
  return {
4495
4516
  endpoint: env$1.REPORT_PORTAL_URL,
4496
4517
  apiKey: env$1.REPORT_PORTAL_TOKEN,
4497
4518
  project: 'alfresco-content-app',
4498
4519
  launch,
4499
4520
  includeTestSteps: true,
4521
+ skipPassed: true,
4500
4522
  restClientConfig: {
4501
4523
  timeout: timeouts.extendedTest
4502
4524
  },
4503
4525
  attributes,
4504
- description: `[Run on GitHub Actions ${env$1.GITHUB_RUN_ID}](${env$1.GITHUB_SERVER_URL}/${env$1.GITHUB_REPOSITORY}/actions/runs/${env$1.GITHUB_RUN_ID})`
4526
+ description: `[Run ${env$1.GITHUB_RUN_ID}](${env$1.GITHUB_SERVER_URL}/${env$1.GITHUB_REPOSITORY}/actions/runs/${env$1.GITHUB_RUN_ID}) - ${browser} - Failures only`
4505
4527
  };
4506
4528
  };
4507
- const getReporter = () => env$1.CI ? [['@reportportal/agent-js-playwright', getReportPortalConfig()], ['github']] : [['html']];
4529
+ const getReporter = () => {
4530
+ if (!env$1.CI) {
4531
+ return [['html']];
4532
+ }
4533
+ return [['@reportportal/agent-js-playwright', getReportPortalConfig()], ['github']];
4534
+ };
4508
4535
 
4509
4536
  /*!
4510
4537
  * Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
@@ -4531,6 +4558,92 @@ const getReporter = () => env$1.CI ? [['@reportportal/agent-js-playwright', getR
4531
4558
  */
4532
4559
  require('@alfresco/adf-cli/tooling').dotenvConfig();
4533
4560
  const { env } = process;
4561
+ function getBrowsersToUse() {
4562
+ const browserEnv = (env.PLAYWRIGHT_BROWSER || 'chromium').toLowerCase();
4563
+ const allBrowsers = ['chrome', 'firefox', 'webkit', 'msedge'];
4564
+ if (browserEnv === 'all') {
4565
+ return allBrowsers;
4566
+ }
4567
+ else if (allBrowsers.includes(browserEnv) || browserEnv === 'chromium') {
4568
+ return [browserEnv];
4569
+ }
4570
+ else {
4571
+ return ['chromium'];
4572
+ }
4573
+ }
4574
+ function getBrowserConfig(browser) {
4575
+ const launchOptions = {
4576
+ devtools: false,
4577
+ slowMo: 300
4578
+ };
4579
+ const chromiumArgs = ['--no-sandbox', '--disable-site-isolation-trials'];
4580
+ switch (browser) {
4581
+ case 'firefox':
4582
+ return {
4583
+ device: devices['Desktop Firefox'],
4584
+ launchOptions,
4585
+ name: 'firefox'
4586
+ };
4587
+ case 'webkit':
4588
+ return {
4589
+ device: devices['Desktop Safari'],
4590
+ launchOptions,
4591
+ name: 'webkit'
4592
+ };
4593
+ case 'msedge':
4594
+ launchOptions.args = chromiumArgs;
4595
+ return {
4596
+ device: { ...devices['Desktop Edge'], channel: 'msedge' },
4597
+ launchOptions,
4598
+ name: 'msedge'
4599
+ };
4600
+ case 'chrome':
4601
+ launchOptions.args = chromiumArgs;
4602
+ return {
4603
+ device: { ...devices['Desktop Chrome'], channel: 'chrome' },
4604
+ launchOptions,
4605
+ name: 'chrome'
4606
+ };
4607
+ case 'chromium':
4608
+ default:
4609
+ launchOptions.args = chromiumArgs;
4610
+ return {
4611
+ device: devices['Desktop Chrome'],
4612
+ launchOptions,
4613
+ name: 'chromium'
4614
+ };
4615
+ }
4616
+ }
4617
+ function createSuiteProjects(suiteName, testDir, useConfig = {}, projectConfig = {}) {
4618
+ const browsersToUse = getBrowsersToUse();
4619
+ const browserEnv = (env.PLAYWRIGHT_BROWSER || 'chrome').toLowerCase();
4620
+ return browsersToUse.map((browser) => {
4621
+ const { device, launchOptions } = getBrowserConfig(browser);
4622
+ return {
4623
+ name: browserEnv === 'all' ? `${suiteName} - ${browser}` : suiteName,
4624
+ testDir,
4625
+ use: {
4626
+ ...device,
4627
+ launchOptions,
4628
+ ...useConfig
4629
+ },
4630
+ ...projectConfig
4631
+ };
4632
+ });
4633
+ }
4634
+ function getBrowserProjects() {
4635
+ const browsersToUse = getBrowsersToUse();
4636
+ return browsersToUse.map((browser) => {
4637
+ const { device, launchOptions, name } = getBrowserConfig(browser);
4638
+ return {
4639
+ name,
4640
+ use: {
4641
+ ...device,
4642
+ launchOptions
4643
+ }
4644
+ };
4645
+ });
4646
+ }
4534
4647
  const getGlobalConfig = {
4535
4648
  timeout: timeouts.globalTest,
4536
4649
  globalTimeout: timeouts.globalSpec,
@@ -4564,22 +4677,10 @@ const getGlobalConfig = {
4564
4677
  /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
4565
4678
  trace: 'retain-on-failure',
4566
4679
  video: 'retain-on-failure',
4567
- screenshot: 'only-on-failure',
4568
- launchOptions: {
4569
- devtools: false,
4570
- args: ['--no-sandbox', '--disable-site-isolation-trials'],
4571
- slowMo: 300
4572
- }
4680
+ screenshot: 'only-on-failure'
4573
4681
  },
4574
4682
  /* Configure projects for major browsers */
4575
- projects: [
4576
- {
4577
- name: 'chromium',
4578
- use: {
4579
- ...devices['Desktop Chrome']
4580
- }
4581
- }
4582
- ]
4683
+ projects: getBrowserProjects()
4583
4684
  };
4584
4685
 
4585
4686
  /*!
@@ -7333,5 +7434,5 @@ const TEST_FILES = {
7333
7434
  * Generated bundle index. Do not edit.
7334
7435
  */
7335
7436
 
7336
- export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfInfoDrawerComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, EditDialog, ErrorComponent, FavoritesLibrariesPage, FavoritesPage, FavoritesPageApi, Field, FileActionsApi, FolderInformationDialogComponent, GenericLogger, LinkRulesDialog, LogLevelsEnum, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, RulesApi, SIDEBAR_LABELS, SITE_ROLES, SITE_VISIBILITY, SearchFilters, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties, SearchFiltersTags, SearchInputComponent, SearchOverlayComponent, SearchPage, SearchPageApi, SearchSortingPicker, ShareDialogComponent, SharedLinksApi, SharedPage, SidenavComponent, SitesApi, SnackBarComponent, SpinnerComponent, TEST_FILES, TagsApi, ToolbarComponent, TrashPage, TrashcanApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, ViewerComponent, ViewerOverlayDialogComponent, collaboratorDocToolbarMore, collaboratorEditRowToolbarMore, collaboratorLockCurrentUserToolbarMore, collaboratorLockOtherUserSearchToolbarMore, collaboratorLockOtherUserToolbarMore, collaboratorSharedToolbarPrimary, collaboratorToolbarPrimary, errorColor, errorStrings, favoritesCollaboratorToolbarMore, file, fileDocx, fileDocxFav, fileDocxShared, fileDocxSharedFav, fileFav, fileFavLocked, fileGranularPermission, fileLocked, fileLockedByUser, fileShared, fileSharedFav, fileSharedFavLocked, fileSharedLocked, flattenNodeContentTree, folder, folderFav, folderFav2, folderFavFile, folderFile, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, infoColor, libraryErrors, logColor, logLevels, multipleSel, multipleSelAllFav, multipleSelFile, paths, random$1 as random, test, testEmailDomain, timeouts, users, waitForApi, warnColor };
7437
+ export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfInfoDrawerComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, EditDialog, ErrorComponent, FavoritesLibrariesPage, FavoritesPage, FavoritesPageApi, Field, FileActionsApi, FolderInformationDialogComponent, GenericLogger, LinkRulesDialog, LogLevelsEnum, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, RulesApi, SIDEBAR_LABELS, SITE_ROLES, SITE_VISIBILITY, SearchFilters, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties, SearchFiltersTags, SearchInputComponent, SearchOverlayComponent, SearchPage, SearchPageApi, SearchSortingPicker, ShareDialogComponent, SharedLinksApi, SharedPage, SidenavComponent, SitesApi, SnackBarComponent, SpinnerComponent, TEST_FILES, TagsApi, ToolbarComponent, TrashPage, TrashcanApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, ViewerComponent, ViewerOverlayDialogComponent, collaboratorDocToolbarMore, collaboratorEditRowToolbarMore, collaboratorLockCurrentUserToolbarMore, collaboratorLockOtherUserSearchToolbarMore, collaboratorLockOtherUserToolbarMore, collaboratorSharedToolbarPrimary, collaboratorToolbarPrimary, createSuiteProjects, errorColor, errorStrings, favoritesCollaboratorToolbarMore, file, fileDocx, fileDocxFav, fileDocxShared, fileDocxSharedFav, fileFav, fileFavLocked, fileGranularPermission, fileLocked, fileLockedByUser, fileShared, fileSharedFav, fileSharedFavLocked, fileSharedLocked, flattenNodeContentTree, folder, folderFav, folderFav2, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, infoColor, libraryErrors, logColor, logLevels, multipleSel, multipleSelAllFav, multipleSelFile, paths, random$1 as random, test, testEmailDomain, timeouts, users, waitForApi, warnColor };
7337
7438
  //# sourceMappingURL=alfresco-aca-playwright-shared.mjs.map