[Reporting/Screenshots] add error for no shared items found on the page (#52022) (#52946)

* [Reporting/Screenshots] add error for no shared items container found on the page

* wording adjustment
This commit is contained in:
Tim Sullivan 2019-12-12 14:24:17 -07:00 committed by GitHub
parent c95fa975d8
commit b184978f1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,5 +47,11 @@ export const getElementPositionAndAttributes = async (
args: [layout.selectors.screenshot, { title: 'data-title', description: 'data-description' }],
});
if (elementsPositionAndAttributes.length === 0) {
throw new Error(
`No shared items containers were found on the page! Reporting requires a container element with the '${layout.selectors.screenshot}' attribute on the page.`
);
}
return elementsPositionAndAttributes;
};