
| Current Path : /var/www/html/sirius-pallets/web/core/tests/Drupal/Nightwatch/Assertions/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/sirius-pallets/web/core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js |
module.exports.assertion = function (expected) {
this.message = `Testing if "${expected}" deprecation error has been triggered`;
this.expected = expected;
this.pass = (deprecationMessages) => deprecationMessages.includes(expected);
this.value = (result) => {
const sessionStorageEntries = JSON.parse(result.value);
const deprecationMessages =
sessionStorageEntries !== null
? sessionStorageEntries.filter((message) =>
message.includes('[Deprecation]'),
)
: [];
return deprecationMessages.map((message) =>
message.replace('[Deprecation] ', ''),
);
};
this.command = (callback) =>
// eslint-disable-next-line prefer-arrow-callback
this.api.execute(function () {
return window.sessionStorage.getItem('js_testing_log_test.warnings');
}, callback);
};