Loading core/modules/system/tests/modules/olivero_test/js/log-errors.es6.js 0 → 100644 +10 −0 Original line number Diff line number Diff line /** * @file * Log all errors. */ Drupal.errorLog = []; window.addEventListener('error', (e) => { Drupal.errorLog.push(e); }); core/modules/system/tests/modules/olivero_test/js/log-errors.js 0 → 100644 +11 −0 Original line number Diff line number Diff line /** * DO NOT EDIT THIS FILE. * See the following change record for more information, * https://www.drupal.org/node/2815083 * @preserve **/ Drupal.errorLog = []; window.addEventListener('error', function (e) { Drupal.errorLog.push(e); }); No newline at end of file core/modules/system/tests/modules/olivero_test/olivero_test.libraries.yml 0 → 100644 +5 −0 Original line number Diff line number Diff line log-errors: js: js/log-errors.js: { weight: -15 } dependencies: - core/drupal core/modules/system/tests/modules/olivero_test/olivero_test.module +7 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,10 @@ function olivero_test_preprocess_field_multiple_value_form(&$variables) { $variables['element']['#disabled'] = TRUE; } } /** * Implements hook_preprocess_html(). */ function olivero_test_preprocess_html(&$variables) { $variables['#attached']['library'][] = 'olivero_test/log-errors'; } core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroRemoveBlockConsoleTest.js 0 → 100644 +57 −0 Original line number Diff line number Diff line module.exports = { '@tags': ['core', 'olivero'], before(browser) { browser .drupalInstall({ setupFile: 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', installProfile: 'minimal', }) .drupalLoginAsAdmin(() => { browser .drupalRelativeURL('/admin/structure/block') // Disable narrow search form block. .click( '[data-drupal-selector="edit-blocks-olivero-search-form-narrow-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_search_form_narrow/disable"]') // Disable main menu block. .click( '[data-drupal-selector="edit-blocks-olivero-main-menu-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_main_menu/disable"]') // Disable wide search form block. .click( '[data-drupal-selector="edit-blocks-olivero-search-form-wide-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_search_form_wide/disable"]') // Disable user account menu block. .click( '[data-drupal-selector="edit-blocks-olivero-account-menu-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_account_menu/disable"]'); }); }, after(browser) { browser.drupalUninstall(); }, 'Verify no console errors': (browser) => { browser .drupalRelativeURL('/') .waitForElementVisible('body') .execute( // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow function () { return Drupal.errorLog.length === 0; }, [], (result) => { browser.assert.ok(result.value, 'Verify no console errors exist.'); }, ); }, }; Loading
core/modules/system/tests/modules/olivero_test/js/log-errors.es6.js 0 → 100644 +10 −0 Original line number Diff line number Diff line /** * @file * Log all errors. */ Drupal.errorLog = []; window.addEventListener('error', (e) => { Drupal.errorLog.push(e); });
core/modules/system/tests/modules/olivero_test/js/log-errors.js 0 → 100644 +11 −0 Original line number Diff line number Diff line /** * DO NOT EDIT THIS FILE. * See the following change record for more information, * https://www.drupal.org/node/2815083 * @preserve **/ Drupal.errorLog = []; window.addEventListener('error', function (e) { Drupal.errorLog.push(e); }); No newline at end of file
core/modules/system/tests/modules/olivero_test/olivero_test.libraries.yml 0 → 100644 +5 −0 Original line number Diff line number Diff line log-errors: js: js/log-errors.js: { weight: -15 } dependencies: - core/drupal
core/modules/system/tests/modules/olivero_test/olivero_test.module +7 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,10 @@ function olivero_test_preprocess_field_multiple_value_form(&$variables) { $variables['element']['#disabled'] = TRUE; } } /** * Implements hook_preprocess_html(). */ function olivero_test_preprocess_html(&$variables) { $variables['#attached']['library'][] = 'olivero_test/log-errors'; }
core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroRemoveBlockConsoleTest.js 0 → 100644 +57 −0 Original line number Diff line number Diff line module.exports = { '@tags': ['core', 'olivero'], before(browser) { browser .drupalInstall({ setupFile: 'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php', installProfile: 'minimal', }) .drupalLoginAsAdmin(() => { browser .drupalRelativeURL('/admin/structure/block') // Disable narrow search form block. .click( '[data-drupal-selector="edit-blocks-olivero-search-form-narrow-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_search_form_narrow/disable"]') // Disable main menu block. .click( '[data-drupal-selector="edit-blocks-olivero-main-menu-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_main_menu/disable"]') // Disable wide search form block. .click( '[data-drupal-selector="edit-blocks-olivero-search-form-wide-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_search_form_wide/disable"]') // Disable user account menu block. .click( '[data-drupal-selector="edit-blocks-olivero-account-menu-operations"] .dropbutton-toggle button', ) .click('[href*="olivero_account_menu/disable"]'); }); }, after(browser) { browser.drupalUninstall(); }, 'Verify no console errors': (browser) => { browser .drupalRelativeURL('/') .waitForElementVisible('body') .execute( // eslint-disable-next-line func-names, prefer-arrow-callback, no-shadow function () { return Drupal.errorLog.length === 0; }, [], (result) => { browser.assert.ok(result.value, 'Verify no console errors exist.'); }, ); }, };