description
when using playwright pytest, if a test fails because of an unexpected uneditable element, the generated allure report will not be able to show details for that test and throw an error in the constructor.
here's the console error message in dev tools:
{
"name": "Error",
"message": "An \"el\" must exist in DOM for this region mnr340"
}
here is the javascript code that generated the error:
_ensureElement: function() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
if (e.isObject(this.el) || (this.$el = this.getEl(this.el),
this.el = this.$el[0],
this.$el = this.Dom.getEl(this.el)),
!this.$el || 0 === this.$el.length) {
if (void 0 === t.allowMissingEl ? e.result(this, "allowMissingEl") : t.allowMissingEl) {
return !1;
}
throw new j('An "el" must exist in DOM for this region ' + this.cid);
}
return !0;
}
steps to reproduce
- set up a project with playwright pytest and allure (the test needs to generate allure result files)
- create a test that opens a page
- expect an element on that page to be editable
- if element is not editable (not input or missing
contenteditable attribute) the test will fail
- generate allure report with the
allure generate command
- the report will not be able to display details for that specific test
here is an example test that can generate this error:
from playwright.sync_api import Page, expect
def test_allure(page: Page) -> None:
page.goto("https://github.com")
expect(page.locator("h1#hero-section-brand-heading")).to_be_editable()
return None
description
when using playwright pytest, if a test fails because of an unexpected uneditable element, the generated allure report will not be able to show details for that test and throw an error in the constructor.
here's the console error message in dev tools:
{ "name": "Error", "message": "An \"el\" must exist in DOM for this region mnr340" }here is the javascript code that generated the error:
steps to reproduce
contenteditableattribute) the test will failallure generatecommandhere is an example test that can generate this error: