add browser logs

pull/2356/head
filip mertens 3 years ago
parent 9ddd571818
commit a83f47c5d0
  1. 1
      apps/remix-ide-e2e/src/buildGroupTests.js
  2. 17
      apps/remix-ide-e2e/src/commands/getBrowserLogs.ts
  3. 1
      apps/remix-ide-e2e/src/types/index.d.ts

@ -47,7 +47,6 @@ function createFlakyTestFiles(file, text) {
lines.forEach((line, index) => {
// if line contains #flaky
if (line.includes('#flaky')) {
console.log(line)
const matches = line.match(/group\d+/g)
const unique = matches.filter(onlyUnique)
createFiles(file, matches, true)

@ -0,0 +1,17 @@
import { NightwatchBrowser } from 'nightwatch'
import EventEmitter from 'events'
class GetBrowserLogs extends EventEmitter {
command(this: NightwatchBrowser): NightwatchBrowser {
this.api.getLog('browser', function (logs) {
logs.forEach(function (log) {
console.log(log)
}
)
}).perform(() => {
this.emit('complete')
})
return this
}
}
module.exports = GetBrowserLogs

@ -61,6 +61,7 @@ declare module 'nightwatch' {
acceptAndRemember (this: NightwatchBrowser, remember: boolean, accept: boolean): NightwatchBrowser
clearConsole (this: NightwatchBrowser): NightwatchBrowser
clearTransactions (this: NightwatchBrowser): NightwatchBrowser
getBrowserLogs (this: NightwatchBrowser): NightwatchBrowser
currentSelectedFileIs (name: string): NightwatchBrowser
}

Loading…
Cancel
Save