Skip to content

Commit

Permalink
Fix preferScenarioName option to be applicable for all scenarios with…
Browse files Browse the repository at this point in the history
… status different of skipped.
  • Loading branch information
denise-maia-ribeiro committed Nov 23, 2021
1 parent 6fe38d7 commit 1eb72c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/wdio-browserstack-service/src/service.ts
Expand Up @@ -121,7 +121,7 @@ export default class BrowserstackService implements Services.ServiceInstance {
*/
afterScenario (world: Frameworks.World) {
const status = world.result?.status.toLowerCase()
if (status === 'skipped') {
if (status !== 'skipped') {
this._scenariosThatRan.push(world.pickle.name || 'unknown pickle name')
}

Expand Down
9 changes: 2 additions & 7 deletions packages/wdio-browserstack-service/tests/service.test.ts
Expand Up @@ -670,13 +670,8 @@ describe('after', () => {
describe('enabled', () => {
[
{ status: 'FAILED', body: {
name: 'Feature1',
reason: 'Unknown Error',
status: 'failed',
} },
{ status: 'SKIPPED', body: {
name: 'Can do something single',
reason: undefined,
reason: 'Unknown Error',
status: 'failed',
} }
/*, 5, 4, 0*/
Expand Down Expand Up @@ -705,7 +700,7 @@ describe('after', () => {

await service.beforeFeature(null, { name: 'Feature1' })

await service.afterScenario({ pickle: { name: 'Can do something single' }, result: { status: 'SKIPPED' } })
await service.afterScenario({ pickle: { name: 'Can do something single' }, result: { status: 'passed' } })

await service.after(0)

Expand Down

0 comments on commit 1eb72c4

Please sign in to comment.