-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be51ffb
commit 866e7a3
Showing
8 changed files
with
199 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {SuiteDecoratedMethod} from "./suite.decorator"; | ||
import {TestDecoratedMethod} from "./test.decorator"; | ||
|
||
/** | ||
* Marks a @test or @suite as "fixme", with the intention to fix (with optional reason). | ||
* Decorated tests or suites will not be run. | ||
*/ | ||
export const fixme = (reason?: string) => function(originalMethod: any, context?: any) { | ||
if ((originalMethod as SuiteDecoratedMethod)?.suiteDecorator) { | ||
originalMethod.suiteDecorator.fixme = reason || true; | ||
return; | ||
} | ||
|
||
if ((originalMethod as TestDecoratedMethod)?.testDecorator) { | ||
originalMethod.testDecorator.fixme = reason || true; | ||
return; | ||
} | ||
} |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import playwright, {expect} from "@playwright/test"; | ||
import {suite, test, slow, beforeAll, skip, fixme} from "../lib"; | ||
|
||
playwright.describe('@fixme decorator', () => { | ||
playwright.describe('with @suite', () => { | ||
const called: string[] = []; | ||
|
||
@fixme() | ||
@suite() | ||
class SkipSuite { | ||
@test() | ||
async test() { | ||
called.push('test'); | ||
} | ||
|
||
@test() | ||
async test2() { | ||
called.push('test2'); | ||
} | ||
} | ||
|
||
playwright('@fixme decorator should not call any @test methods from suite', () => { | ||
expect(called).toEqual([]); | ||
}); | ||
}); | ||
|
||
playwright.describe('with @test', () => { | ||
const called: string[] = []; | ||
|
||
@suite() | ||
class TestSuite { | ||
@test() | ||
async test() { | ||
called.push('test'); | ||
} | ||
|
||
@fixme() | ||
@test() | ||
async fixmeTest() { | ||
called.push('fixmeTest'); | ||
} | ||
|
||
@test() | ||
async test2() { | ||
called.push('test2'); | ||
} | ||
} | ||
|
||
playwright('@fixme decorator should not execute @test method', () => { | ||
expect(called).not.toContain('fixmeTest'); | ||
}) | ||
}); | ||
}); |