Skip to content

Commit

Permalink
add to test spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Abinet18 committed Sep 24, 2024
1 parent 9074edd commit 08703f9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/web/integration-tests/tests/errors/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,21 @@ module.exports = {
// click on button1 to trigger error
await browser.click('#button1');
await browser.pause(1000);
const errorSpan1 = await browser.globals.findSpan(s => s.name === 'onerror');
await browser.assert.ok(!!errorSpan1, 'Checking presence of error span.');
await browser.assert.strictEqual(errorSpan1.tags['error.message'], 'Error from script1.js');
// check errorSpan2.tags['error.source_map_ids'] contains the strings script1.min.js and the hash text
await browser.assert.ok(errorSpan1.tags['error.source_map_ids'].includes('script1.min.js'));
await browser.assert.ok(errorSpan1.tags['error.source_map_ids'].includes('9663c60664c425cef3b141c167e9b324240ce10ae488726293892b7130266a6b'));

// clear spans and do same for button2
browser.globals.clearReceivedSpans();
await browser.click('#button2');
await browser.pause(1000);
const errorSpan2 = await browser.globals.findSpan(s => s.name === 'onerror');
await browser.assert.ok(!!errorSpan2, 'Checking presence of error span.');
await browser.assert.strictEqual(errorSpan2.tags['error.message'], 'Error from script1.js');
// check errorSpan2.tags['error.source_map_ids'] contains the strings script1.min.js and the hash text
await browser.assert.ok(errorSpan2.tags['error.source_map_ids'].includes('script1.min.js'));
await browser.assert.ok(errorSpan2.tags['error.source_map_ids'].includes('9663c60664c425cef3b141c167e9b324240ce10ae488726293892b7130266a6b'));
await browser.assert.strictEqual(errorSpan2.tags['error.message'], 'Error from script2.js');
await browser.assert.ok(errorSpan2.tags['error.source_map_ids'].includes('script2.min.js'));
await browser.assert.ok(errorSpan2.tags['error.source_map_ids'].includes('9793573cdc2ab308a0b1996bea14253ec8832bc036210475ded0813cafa27066'));
}
};

0 comments on commit 08703f9

Please sign in to comment.