* {{> seeCssPropertiesOnElements }}
(locator, cssProperties)
| 1755 | * {{> seeCssPropertiesOnElements }} |
| 1756 | */ |
| 1757 | async seeCssPropertiesOnElements(locator, cssProperties) { |
| 1758 | const res = await this._locate(locator) |
| 1759 | assertElementExists(res, locator) |
| 1760 | |
| 1761 | const cssPropertiesCamelCase = convertCssPropertiesToCamelCase(cssProperties) |
| 1762 | const elemAmount = res.length |
| 1763 | let props = [] |
| 1764 | |
| 1765 | for (const element of res) { |
| 1766 | for (const prop of Object.keys(cssProperties)) { |
| 1767 | const cssProp = await this.grabCssPropertyFrom(locator, prop) |
| 1768 | if (isColorProperty(prop)) { |
| 1769 | props.push(convertColorToRGBA(cssProp)) |
| 1770 | } else { |
| 1771 | props.push(cssProp) |
| 1772 | } |
| 1773 | } |
| 1774 | } |
| 1775 | |
| 1776 | const values = Object.keys(cssPropertiesCamelCase).map(key => cssPropertiesCamelCase[key]) |
| 1777 | if (!Array.isArray(props)) props = [props] |
| 1778 | let chunked = chunkArray(props, values.length) |
| 1779 | chunked = chunked.filter(val => { |
| 1780 | for (let i = 0; i < val.length; ++i) { |
| 1781 | if (val[i] != values[i]) return false |
| 1782 | } |
| 1783 | return true |
| 1784 | }) |
| 1785 | return equals(`all elements (${new Locator(locator)}) to have CSS property ${JSON.stringify(cssProperties)}`).assert(chunked.length, elemAmount) |
| 1786 | } |
| 1787 | |
| 1788 | /** |
| 1789 | * {{> seeAttributesOnElements }} |
nothing calls this directly
no test coverage detected