Matrix / Price inside a shadow root
Price inside a shadow root
A custom <price-tag> element shows "Price: $49" inside its open shadow root. The broken page renders "Price: $94" inside the shadow root instead.
What your agent will do with Beam installed
Not measured yet.
Results
| Wording | Kane | Correct page | Broken page | Result |
|---|---|---|---|---|
Verify the price shown is $49. | Not run yet | |||
Verify the exact visible text of the price tag is "Price: $49". | Not run yet | |||
The two pages
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>store</title></head><body>
<h1>Store</h1>
<price-tag></price-tag>
<script>
class PriceTag extends HTMLElement {
constructor() {
super();
const root = this.attachShadow({ mode: 'open' });
root.innerHTML = '<span class="price">Price: $49</span>';
}
}
customElements.define('price-tag', PriceTag);
</script></body></html>
Source
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>store</title></head><body>
<h1>Store</h1>
<price-tag></price-tag>
<script>
class PriceTag extends HTMLElement {
constructor() {
super();
const root = this.attachShadow({ mode: 'open' });
root.innerHTML = '<span class="price">Price: $94</span>';
}
}
customElements.define('price-tag', PriceTag);
</script></body></html>
Reproduce it
Clone the repo, then run this behavior on your own Kane:
npm run suite -- shadow-dom-text