You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when a UI element is interacted with it reports the "type" and that's it.
What is the expected behavior?
It would be good to get more information reported, such as "aria-label" which may help indicate what was happening for the system to break.
It would also be useful to know what information was entered into the field.
I tried making a change to the raven-js but can't seem to get it working, can anyone guide me in the right direction?
The test
it('should record record an aria-label if one is present', function(done) {
var iframe = this.iframe;
iframeExecute(
iframe,
done,
function() {
setTimeout(done);
// some browsers trigger onpopstate for load / reset breadcrumb state
Raven._breadcrumbs = [];
// add an event listener to the input. we want to make sure that
// our breadcrumbs still work even if the page has an event listener
// on an element that cancels event bubbling
var input = document.getElementsByTagName('input')[0];
var clickHandler = function(evt) {
evt.stopPropagation(); // don't bubble
};
input.addEventListener('click', clickHandler);
// click <input/>
var click = new MouseEvent('click');
input.dispatchEvent(click);
},
function() {
var Raven = iframe.contentWindow.Raven,
breadcrumbs = Raven._breadcrumbs;
assert.equal(breadcrumbs.length, 1);
assert.equal(breadcrumbs[0].category, 'ui.click');
assert.equal(
breadcrumbs[0].message,
'body > form#foo-form > input[name="foo"][aria-label="This is the aria-label"]'
);
}
);
});
I updated frame.html to have
<input name="foo" placeholder="lol" aria-label="This is the aria-label" />
I can't get it to recognise aria-label being in the whitelist, however i am struggling to test this too because I can't find out how to debug the tests.
@HazAT I've been trying to get this working over the weekend, but have not had any luck.
Can you guide me at all in how to go about debugging the tests, since I can't see what any elements have with console logs etc because I can't see the actual console.log lines at all when running the tests.
Activity
alexbowers commentedon Aug 9, 2018
I tried making a change to the raven-js but can't seem to get it working, can anyone guide me in the right direction?
The test
I updated
frame.htmlto haveAs the input element
and I updated
utils/misc.tsto havein the
htmlElementAsStringfunction.But it isn't working, any ideas where I've gone wrong on this?
alexbowers commentedon Aug 9, 2018
On a second note, how do you debug and test these tests, because console logging doesn't seem to work for me.
HazAT commentedon Aug 10, 2018
Please consider adding new functionality to this package https://github.com/getsentry/sentry-javascript/tree/master/packages/browser
since this will be our new SDK for the future.
There is this integration which handles breadcrumbs.
https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/breadcrumbs.ts
alexbowers commentedon Aug 10, 2018
I am still having the same issues where changing
htmlElementAsStringwhich is still being used byhttps://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/integrations/helpers.ts#L124
I can't get it to recognise aria-label being in the whitelist, however i am struggling to test this too because I can't find out how to debug the tests.
alexbowers commentedon Aug 12, 2018
@HazAT I've been trying to get this working over the weekend, but have not had any luck.
Can you guide me at all in how to go about debugging the tests, since I can't see what any elements have with console logs etc because I can't see the actual console.log lines at all when running the tests.
kamilogorek commentedon Sep 4, 2018
It's doable through breadcrumb hints now.
Soooo eaaaassssyyyy :D