Commit 6ddb5ee3 authored by JJ Kasper's avatar JJ Kasper Committed by Tim Neutkens

Update to check browserName instead of browser.log (#8234)

* Update to check browserName instead of browser.log

* Fix browserName check for some tests
parent 487d62b1
...@@ -5,7 +5,7 @@ export default (context, render) => { ...@@ -5,7 +5,7 @@ export default (context, render) => {
describe('With CSP enabled', () => { describe('With CSP enabled', () => {
it('should load inline script by hash', async () => { it('should load inline script by hash', async () => {
const browser = await webdriver(context.appPort, '/?withCSP=hash') const browser = await webdriver(context.appPort, '/?withCSP=hash')
if (browser.log) { if (global.browserName === 'chrome') {
const errLog = await browser.log('browser') const errLog = await browser.log('browser')
expect(errLog.filter(e => e.source === 'security')).toEqual([]) expect(errLog.filter(e => e.source === 'security')).toEqual([])
} }
...@@ -14,7 +14,7 @@ export default (context, render) => { ...@@ -14,7 +14,7 @@ export default (context, render) => {
it('should load inline script by nonce', async () => { it('should load inline script by nonce', async () => {
const browser = await webdriver(context.appPort, '/?withCSP=nonce') const browser = await webdriver(context.appPort, '/?withCSP=nonce')
if (browser.log) { if (global.browserName === 'chrome') {
const errLog = await browser.log('browser') const errLog = await browser.log('browser')
expect(errLog.filter(e => e.source === 'security')).toEqual([]) expect(errLog.filter(e => e.source === 'security')).toEqual([])
} }
......
...@@ -58,7 +58,7 @@ export default (context, render) => { ...@@ -58,7 +58,7 @@ export default (context, render) => {
/Browser hydrated/ /Browser hydrated/
) )
if (browser.log) { if (global.browserName === 'chrome') {
const logs = await browser.log('browser') const logs = await browser.log('browser')
logs.forEach(logItem => { logs.forEach(logItem => {
......
...@@ -453,7 +453,7 @@ describe('Production Usage', () => { ...@@ -453,7 +453,7 @@ describe('Production Usage', () => {
it('should reload the page on page script error with prefetch', async () => { it('should reload the page on page script error with prefetch', async () => {
const browser = await webdriver(appPort, '/counter') const browser = await webdriver(appPort, '/counter')
if (!browser.log) return if (global.browserName !== 'chrome') return
const counter = await browser const counter = await browser
.elementByCss('#increase') .elementByCss('#increase')
.click() .click()
......
...@@ -124,7 +124,7 @@ class CustomEnvironment extends NodeEnvironment { ...@@ -124,7 +124,7 @@ class CustomEnvironment extends NodeEnvironment {
} }
} }
} }
this.global.browserName = BROWSER_NAME this.global.browserName = browserOptions.browserName
this.global.isBrowserStack = isBrowserStack this.global.isBrowserStack = isBrowserStack
// Mock current browser set up // Mock current browser set up
this.global.bsWd = async (appPort, pathname) => { this.global.bsWd = async (appPort, pathname) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment