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) => {
describe('With CSP enabled', () => {
it('should load inline script by hash', async () => {
const browser = await webdriver(context.appPort, '/?withCSP=hash')
if (browser.log) {
if (global.browserName === 'chrome') {
const errLog = await browser.log('browser')
expect(errLog.filter(e => e.source === 'security')).toEqual([])
}
......@@ -14,7 +14,7 @@ export default (context, render) => {
it('should load inline script by nonce', async () => {
const browser = await webdriver(context.appPort, '/?withCSP=nonce')
if (browser.log) {
if (global.browserName === 'chrome') {
const errLog = await browser.log('browser')
expect(errLog.filter(e => e.source === 'security')).toEqual([])
}
......
......@@ -58,7 +58,7 @@ export default (context, render) => {
/Browser hydrated/
)
if (browser.log) {
if (global.browserName === 'chrome') {
const logs = await browser.log('browser')
logs.forEach(logItem => {
......
......@@ -453,7 +453,7 @@ describe('Production Usage', () => {
it('should reload the page on page script error with prefetch', async () => {
const browser = await webdriver(appPort, '/counter')
if (!browser.log) return
if (global.browserName !== 'chrome') return
const counter = await browser
.elementByCss('#increase')
.click()
......
......@@ -124,7 +124,7 @@ class CustomEnvironment extends NodeEnvironment {
}
}
}
this.global.browserName = BROWSER_NAME
this.global.browserName = browserOptions.browserName
this.global.isBrowserStack = isBrowserStack
// Mock current browser set up
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