hermione-assert-view-extended
Advanced tools
Comparing version 0.1.1 to 0.2.0
'use strict'; | ||
module.exports = (hermione, opts = {}) => { | ||
const commands = opts.commands || {}; | ||
const globalStyles = opts.globalStyles || {}; | ||
@@ -63,2 +64,6 @@ const globalExecute = opts.globalExecute || {}; | ||
if (commands.before && typeof commands.before.call !== 'undefined') { | ||
await browser.then(() => commands.before.call({ browser }, name, selector, options)); | ||
} | ||
await browser.execute(function(styleString, beforeExecute) { | ||
@@ -93,2 +98,6 @@ var head = document.head || document.getElementsByTagName('head')[0]; | ||
}, afterExecute); | ||
if (commands.after && typeof commands.after.call !== 'undefined') { | ||
await browser.then(() => commands.after.call({ browser }, name, selector, options)); | ||
} | ||
}, true); | ||
@@ -95,0 +104,0 @@ }); |
{ | ||
"name": "hermione-assert-view-extended", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Hermione plugin for extend assertView command.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,2 +16,10 @@ # hermione-assert-view-extended | ||
{ | ||
commands: { | ||
before: function(name, selector, options) { | ||
return this.browser.moveTo(0, 0); | ||
}, | ||
after: function(name, selector, options) { | ||
console.log(`Asserted view '${name}' for '${selector}' selector.`); | ||
} | ||
}, | ||
globalStyles: { | ||
@@ -52,2 +60,5 @@ animationDisable: true, | ||
| --- | --- | --- | | ||
| `commands` | | Hermione commands which will be called before/after call assertView in `then()`. | | ||
| `commands.before` | | Hermione commands which will be called before call assertView and first inner execute. | | ||
| `commands.after` | | Hermione commands which will be called after call assertView and last inner execute. | | ||
| `globalStyles` | | CSS injection appended in `<head>` before call assertView. It will be removed after call assertView. | | ||
@@ -54,0 +65,0 @@ | `globalStyles.animationDisable` | `false` | Disable CSS animation (`transition-duration: 0s`, `animation-duration: 0s`, etc.). | |
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
9388
107
75