@axe-core/watcher
Advanced tools
Comparing version 3.16.1-next.e67cfd57 to 3.16.1-next.fcb81b3e
@@ -19,4 +19,18 @@ "use strict"; | ||
this.debugLogger(`Start: Invoked`); | ||
const result = await this.executeScript(() => { | ||
return new Promise(resolve => { | ||
if (!['http:', 'https:', 'file:'].includes(window.location.protocol)) { | ||
resolve({ message: 'Clean skipped - invalid protocol' }); | ||
} | ||
const fn = (event) => { | ||
window.removeEventListener('axe:manual-mode-clean-done', fn); | ||
resolve({ message: event.detail.message }); | ||
}; | ||
window.addEventListener('axe:manual-mode-clean-done', fn); | ||
const event = new CustomEvent('axe:manual-mode-clean'); | ||
window.dispatchEvent(event); | ||
}); | ||
}); | ||
this.debugLogger(`Start: ${result.message}`); | ||
this.isStopped = false; | ||
return Promise.resolve(); | ||
} | ||
@@ -23,0 +37,0 @@ async stop() { |
@@ -157,6 +157,31 @@ "use strict"; | ||
function axeWatcherStartCommand(subject) { | ||
cy.window().then(() => { | ||
logDebugAxeWatcher({ message: `Start: Invoked` }); | ||
isStopped = false; | ||
return Promise.resolve(subject); | ||
logDebugAxeWatcher({ message: 'Start: Invoked' }); | ||
cy.window().then(win => { | ||
if (!shouldAnalyzeLocation(win.location)) { | ||
isStopped = false; | ||
logDebugAxeWatcher({ | ||
message: 'Clean: Skipped - invalid protocol' | ||
}); | ||
return Promise.resolve({ | ||
message: 'Clean: Skipped - Invalid protocol', | ||
subject | ||
}); | ||
} | ||
return new Promise(resolve => { | ||
const fn = (event) => { | ||
win.removeEventListener('axe:manual-mode-clean-done', fn); | ||
resolve({ message: event.detail.message, subject }); | ||
}; | ||
win.addEventListener('axe:manual-mode-clean-done', fn); | ||
const event = new CustomEvent('axe:manual-mode-clean'); | ||
win.dispatchEvent(event); | ||
}).then(result => { | ||
logDebugAxeWatcher({ | ||
message: `Start: ${result === null || result === void 0 ? void 0 : result.message}` | ||
}); | ||
isStopped = false; | ||
if (result === null || result === void 0 ? void 0 : result.subject) { | ||
return result.subject; | ||
} | ||
}); | ||
}); | ||
@@ -163,0 +188,0 @@ } |
{ | ||
"name": "@axe-core/watcher", | ||
"version": "3.16.1-next.e67cfd57", | ||
"version": "3.16.1-next.fcb81b3e", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "UNLICENSED", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2227248
3338