@alfresco/aca-playwright-shared 8.1.0-43221495357 → 8.1.0-43390478347

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.
@@ -106,28 +106,24 @@ const timeouts = {
106
106
  * You should have received a copy of the GNU Lesser General Public License
107
107
  * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
108
108
  */
109
+ const ALL_BROWSERS_SCOPE = 'all';
110
+ const BROWSER_SCOPES = ['firefox', 'chromium', 'webkit', 'msedge'];
109
111
  const getCurrentBrowser = () => (process.env.PLAYWRIGHT_BROWSER || 'chrome').toLowerCase();
112
+ const getTestExclusions = (excludedJson) => {
113
+ const currentBrowser = getCurrentBrowser();
114
+ const scopes = [ALL_BROWSERS_SCOPE, ...BROWSER_SCOPES.filter((scope) => scope === currentBrowser)];
115
+ return scopes.flatMap((scope) => Object.entries(excludedJson[scope] ?? {}).map(([id, reason]) => ({ id, reason, scope })));
116
+ };
110
117
  const getExcludedTestsRegExpArray = (excludedJson, projectName) => {
111
118
  const prefix = `[ 🎭 Playwright Excludes - ${projectName} ]`;
112
- const currentBrowser = getCurrentBrowser();
113
- const browserKeys = ['all', 'firefox', 'chromium', 'webkit', 'msedge'];
114
- const relevantKeys = [];
115
- const testIdsToExclude = [];
116
- // Always include 'all' if it exists
117
- if (excludedJson.all && typeof excludedJson.all === 'object') {
118
- const allTestIds = Object.keys(excludedJson.all);
119
- testIdsToExclude.push(...allTestIds);
120
- relevantKeys.push('all');
121
- }
122
- // Include current browser-specific exclusions
123
- const browserKey = browserKeys.find((key) => key.toLowerCase() === currentBrowser);
124
- if (browserKey && excludedJson[browserKey] && typeof excludedJson[browserKey] === 'object') {
125
- const browserTestIds = Object.keys(excludedJson[browserKey]);
126
- testIdsToExclude.push(...browserTestIds);
127
- if (!relevantKeys.includes(browserKey)) {
128
- relevantKeys.push(browserKey);
129
- }
119
+ if (process.env.E2E_EXCLUDED_TESTS_FILE) {
120
+ console.info(`${prefix} Listing all tests to find the excluded ones, so nothing is excluded`);
121
+ return [];
130
122
  }
123
+ const currentBrowser = getCurrentBrowser();
124
+ const exclusions = getTestExclusions(excludedJson);
125
+ const testIdsToExclude = exclusions.map((exclusion) => exclusion.id);
126
+ const relevantKeys = [...new Set(exclusions.map((exclusion) => exclusion.scope))];
131
127
  if (testIdsToExclude.length > 0) {
132
128
  console.warn(`${prefix} ❌ Tests excluded for browser '${currentBrowser}' because of 🐛 : ${testIdsToExclude.join(', ')} (from keys: ${relevantKeys.join(', ')})`);
133
129
  }
@@ -4954,13 +4950,13 @@ const getReportPortalConfig = () => {
4954
4950
  };
4955
4951
  };
4956
4952
  const getReporter = () => {
4953
+ if (env$1.E2E_EXCLUDED_TESTS_FILE) {
4954
+ return [[require.resolve('./e2e-metrics.reporter'), { outputFile: env$1.E2E_EXCLUDED_TESTS_FILE, excludedOnly: true }]];
4955
+ }
4957
4956
  if (!env$1.CI) {
4958
4957
  return [['html']];
4959
4958
  }
4960
4959
  const reporters = [['@reportportal/agent-js-playwright', getReportPortalConfig()], ['github']];
4961
- if (env$1.E2E_BLOB_REPORT === 'true') {
4962
- reporters.push(['blob', { outputDir: env$1.PLAYWRIGHT_BLOB_DIR || 'blob-report' }]);
4963
- }
4964
4960
  if (env$1.E2E_METRICS_FILE) {
4965
4961
  reporters.push([require.resolve('./e2e-metrics.reporter'), { outputFile: env$1.E2E_METRICS_FILE }]);
4966
4962
  }
@@ -7746,5 +7742,5 @@ const TEST_FILES = {
7746
7742
  * Generated bundle index. Do not edit.
7747
7743
  */
7748
7744
 
7749
- export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, DetailsPageComponent, EditDialog, EditModeComponent, ErrorComponent, FavoritesApi, FavoritesLibrariesPage, FavoritesPage, Field, FolderInformationDialogComponent, InfoDrawerComponent, LinkRulesDialog, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, RepositoryPage, RulesApi, RulesToolbarComponent, SIDEBAR_LABELS, SITE_ROLES, SITE_VISIBILITY, SearchApi, SearchFilters, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties, SearchFiltersTags, SearchInputComponent, SearchMenuCard, SearchPage, SearchSortingPicker, ShareDialogComponent, SharedLinksApi, SharedPage, SidenavComponent, SitesApi, SnackBarComponent, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, VersionListComponent, VersionManagerActions, ViewerComponent, ViewerOverlayDialogComponent, ViewerToolbarComponent, cleanupRepositoryTestData, createSuiteProjects, errorStrings, file, flattenNodeContentTree, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getUserState, hasAccessibleAttribute, hasAccessibleName, isInteractiveElement, libraryErrors, logger, multipleSelFile, paths, seedRepositoryTestData, test, testEmailDomain, timeouts, users, verifyDataTableAccessibility, verifyElementsHaveNames, verifyRegionAccessibleNames, waitForApi };
7745
+ export { APP_ROUTES, AcaHeader, ActionType, ActionTypes, ActionsDropdownComponent, AdfConfirmDialogComponent, AdfDeleteTrashComponent, AdfFolderDialogComponent, AdfLibraryDialogComponent, ApiClientFactory, BaseComponent, BasePage, Breadcrumb, CategoriesApi, Comparator, ConditionComponent, ConditionsTypes, ContentNodeSelectorDialog, CreateFromTemplateDialogComponent, DataTableComponent, DateTimePicker, DetailsPageComponent, EditDialog, EditModeComponent, ErrorComponent, FavoritesApi, FavoritesLibrariesPage, FavoritesPage, Field, FolderInformationDialogComponent, InfoDrawerComponent, LinkRulesDialog, LoginPage, ManageRules, ManageRulesDialogComponent, ManageVersionsDialog, MatMenuComponent, MimeType, MyLibrariesPage, NodesApi, NodesPage, PaginationActionsType, PaginationComponent, PasswordOverlayDialogComponent, Person, PersonalFilesPage, QueriesApi, RecentFilesPage, RepositoryPage, RulesApi, RulesToolbarComponent, SIDEBAR_LABELS, SITE_ROLES, SITE_VISIBILITY, SearchApi, SearchFilters, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties, SearchFiltersTags, SearchInputComponent, SearchMenuCard, SearchPage, SearchSortingPicker, ShareDialogComponent, SharedLinksApi, SharedPage, SidenavComponent, SitesApi, SnackBarComponent, TEST_FILES, TagsApi, TrashPage, TrashcanApi, UploadApi, UploadDialog, UploadNewVersionDialog, UserModel, Utils, VersionListComponent, VersionManagerActions, ViewerComponent, ViewerOverlayDialogComponent, ViewerToolbarComponent, cleanupRepositoryTestData, createSuiteProjects, errorStrings, file, flattenNodeContentTree, folderFavFile, folderFile, getBrowserProjects, getExcludedTestsRegExpArray, getGlobalConfig, getTestExclusions, getUserState, hasAccessibleAttribute, hasAccessibleName, isInteractiveElement, libraryErrors, logger, multipleSelFile, paths, seedRepositoryTestData, test, testEmailDomain, timeouts, users, verifyDataTableAccessibility, verifyElementsHaveNames, verifyRegionAccessibleNames, waitForApi };
7750
7746
  //# sourceMappingURL=alfresco-aca-playwright-shared.mjs.map