From 08703f9321c45f5441400dd98e367940d9b56f54 Mon Sep 17 00:00:00 2001 From: Abinet Debele Date: Tue, 24 Sep 2024 11:30:41 -0700 Subject: [PATCH] add to test spec --- .../tests/errors/index.spec.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/web/integration-tests/tests/errors/index.spec.js b/packages/web/integration-tests/tests/errors/index.spec.js index 64192081..778b604a 100644 --- a/packages/web/integration-tests/tests/errors/index.spec.js +++ b/packages/web/integration-tests/tests/errors/index.spec.js @@ -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')); } };