From 53794fdead9f0d9bcc3ca1a6278e768f93625529 Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Thu, 11 Jun 2020 16:21:38 -0500 Subject: [PATCH 1/4] WIP --- browsers/browsers.test.ts | 11 ++++++++++- src/components/chart.tsx | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/browsers/browsers.test.ts b/browsers/browsers.test.ts index 8369b2491d..a10138f3ad 100644 --- a/browsers/browsers.test.ts +++ b/browsers/browsers.test.ts @@ -19,7 +19,7 @@ import path from 'path'; -import webdriver, { By } from 'selenium-webdriver'; +import webdriver, { By, logging } from 'selenium-webdriver'; jest.setTimeout(30000); @@ -60,6 +60,15 @@ describe('smoke tests', () => { }); afterAll(async() => { + const entries = await driver.manage().logs().get(logging.Type.BROWSER); + console.log(JSON.stringify(entries)); + + entries.forEach((entry) => { + if (entry.level.name === 'error') { + console.log('[%s] %s', entry.level.name, entry.message); + } + }); + await driver.quit(); }); diff --git a/src/components/chart.tsx b/src/components/chart.tsx index 22548e06e3..5b518e830b 100644 --- a/src/components/chart.tsx +++ b/src/components/chart.tsx @@ -68,6 +68,9 @@ export class Chart extends React.Component { this.chartContainerRef = createRef(); this.chartStageRef = createRef(); + // eslint-disable-next-line no-console + console.error('this thing errored'); + const id = props.id ?? uuid.v4(); const storeReducer = chartStoreReducer(id); const enhancers = typeof window !== 'undefined' && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ From e5a456a5d1a1987c272fdaf9062ea578f99d4f09 Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Thu, 11 Jun 2020 16:47:28 -0500 Subject: [PATCH 2/4] WIP --- .playground/index.tsx | 2 +- browsers/browsers.test.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.playground/index.tsx b/.playground/index.tsx index 84e78a0349..2511c4c008 100644 --- a/.playground/index.tsx +++ b/.playground/index.tsx @@ -17,7 +17,7 @@ * under the License. */ -import 'core-js'; +// import 'core-js'; import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/browsers/browsers.test.ts b/browsers/browsers.test.ts index a10138f3ad..317f2c2912 100644 --- a/browsers/browsers.test.ts +++ b/browsers/browsers.test.ts @@ -61,7 +61,9 @@ describe('smoke tests', () => { afterAll(async() => { const entries = await driver.manage().logs().get(logging.Type.BROWSER); - console.log(JSON.stringify(entries)); + const entries2 = await driver.manage().logs().get(logging.Type.CLIENT); + console.log('ERRRORS BROWSER', JSON.stringify(entries)); + console.log('ERRRORS CLIENT', JSON.stringify(entries2)); entries.forEach((entry) => { if (entry.level.name === 'error') { From fb7436a2ac96bed4b6b89f11d13d72fb5f28313c Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Fri, 12 Jun 2020 15:12:28 -0500 Subject: [PATCH 3/4] WIP --- browsers/browsers.test.ts | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/browsers/browsers.test.ts b/browsers/browsers.test.ts index 317f2c2912..9f250feb9c 100644 --- a/browsers/browsers.test.ts +++ b/browsers/browsers.test.ts @@ -21,7 +21,7 @@ import path from 'path'; import webdriver, { By, logging } from 'selenium-webdriver'; -jest.setTimeout(30000); +jest.setTimeout(6000); /* eslint-disable global-require */ @@ -59,17 +59,27 @@ describe('smoke tests', () => { } }); - afterAll(async() => { - const entries = await driver.manage().logs().get(logging.Type.BROWSER); - const entries2 = await driver.manage().logs().get(logging.Type.CLIENT); - console.log('ERRRORS BROWSER', JSON.stringify(entries)); - console.log('ERRRORS CLIENT', JSON.stringify(entries2)); + beforeAll(async() => { + await driver.executeScript(() => { + // @ts-ignore + window.browserErrors = []; - entries.forEach((entry) => { - if (entry.level.name === 'error') { - console.log('[%s] %s', entry.level.name, entry.message); - } + window.console.error = (...args: any[]) => { + // @ts-ignore + window.browserErrors.push(...args); + }; }); + }); + + afterAll(async() => { + const errors = await driver.executeScript(() => + // @ts-ignore + JSON.stringify(window.browserErrors) + // if (entry.level.name === 'error') { + // console.log('[%s] %s', entry.level.name, entry.message); + // } + ); + console.log('ERRRORS CLIENT', JSON.stringify(errors)); await driver.quit(); }); From e3ae60e648bc31bafacd9df03d9f6de0b1c4cc42 Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Fri, 12 Jun 2020 15:22:07 -0500 Subject: [PATCH 4/4] WIP --- browsers/browsers.test.ts | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/browsers/browsers.test.ts b/browsers/browsers.test.ts index 9f250feb9c..17a57a24ad 100644 --- a/browsers/browsers.test.ts +++ b/browsers/browsers.test.ts @@ -19,9 +19,9 @@ import path from 'path'; -import webdriver, { By, logging } from 'selenium-webdriver'; +import webdriver, { By } from 'selenium-webdriver'; -jest.setTimeout(6000); +jest.setTimeout(30000); /* eslint-disable global-require */ @@ -56,19 +56,17 @@ describe('smoke tests', () => { } if (capabilities) { driver = await new webdriver.Builder().withCapabilities(capabilities).build(); - } - }); - beforeAll(async() => { - await driver.executeScript(() => { - // @ts-ignore - window.browserErrors = []; - - window.console.error = (...args: any[]) => { + await driver.executeScript(() => { // @ts-ignore - window.browserErrors.push(...args); - }; - }); + window.browserErrors = []; + + window.console.error = (...args: any[]) => { + // @ts-ignore + window.browserErrors.push(...args); + }; + }); + } }); afterAll(async() => {