-
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.
* fix: skip decorator do not pass reason * fix: display annotation on skipped tests * fix: rewrite error messages to be more detailed * docs: refactor main example * docs: fix tests badge * chore: generate changeset
- Loading branch information
1 parent
173256e
commit 7398cc2
Showing
6 changed files
with
47 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'playwright-decorators': patch | ||
--- | ||
|
||
- Display `reason` from `@skip` decorator. | ||
- Show tags from `@skip` tests. | ||
- Provide more detailed info in error messages. | ||
- Cosmetic changes in readme file |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Tests | ||
name: PR | ||
|
||
on: | ||
pull_request: | ||
|
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 |
---|---|---|
@@ -1,17 +1,37 @@ | ||
export class NotSuiteDecoratedMethodError extends Error { | ||
constructor(decoratorName: string ,method: any) { | ||
super(`${decoratorName} decorator can be applied only to methods decorated by @suite. ${method?.name} is not decorated by @suite`); | ||
super(` | ||
The @${decoratorName} decorator can only be used on class that also have the @suite decorator. | ||
Make sure ${method?.name} is marked with @suite, and that ${decoratorName} comes before @suite, like this: | ||
@${decoratorName} | ||
@suite() | ||
${method?.name}() {}`); | ||
} | ||
} | ||
|
||
export class NotTestDecoratedMethodError extends Error { | ||
constructor(decoratorName: string, method: any) { | ||
super(`${decoratorName} decorator can be applied only to methods decorated by @test. ${method?.name} is not decorated by @test`); | ||
super(` | ||
The @${decoratorName} decorator can only be used on methods that also have the @test decorator. | ||
Make sure ${method?.name} is marked with @test, and that ${decoratorName} comes before @test, like this: | ||
@${decoratorName} | ||
@test() | ||
${method?.name}() {}` | ||
); | ||
} | ||
} | ||
|
||
export class NotSuiteOrTestDecoratedMethodError extends Error { | ||
constructor(decoratorName: string, method: any) { | ||
super(`${decoratorName} decorator can be applied only to methods decorated by @test or classes decorated by @suite. ${method?.name} is not decorated by any of them`); | ||
super(` | ||
The @${decoratorName} decorator can only be used on classes/methods that also have the @suite or @test decorator. | ||
Make sure ${method?.name} is marked with @suite or @test, and that ${decoratorName} comes before @suite or @test, like this: | ||
@${decoratorName} | ||
@suite() / @test() | ||
${method?.name}() {} | ||
`); | ||
} | ||
} |
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