Last active
October 8, 2021 09:57
-
-
Save mattonem/816ab5ccccd5e6cfef22bbc5a7331d15 to your computer and use it in GitHub Desktop.
browserstack/codeceptjs mark test session status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const event = require('codeceptjs').event; | |
module.exports = function() { | |
event.dispatcher.on(event.test.passed, function (test) { | |
const { I } = inject(); | |
I.executeScript(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'passed',reason: 'All passed :)'}})}`); | |
}); | |
event.dispatcher.on(event.test.failed, function (test) { | |
const { I } = inject(); | |
I.executeScript(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionStatus',arguments: {status: 'failed',reason: 'failed'}})}`); | |
}); | |
event.dispatcher.on(event.test.started, function (test) { | |
const { I } = inject(); | |
I.executeScript(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'setSessionName',arguments: {name: test.title}})}`); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment