-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
8 changed files
with
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 1.1.5 | ||
|
||
- **docs:** add example | ||
|
||
## 1.1.4 | ||
|
||
- **docs:** update README | ||
|
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,40 @@ | ||
# Test Reporter - Usage example | ||
|
||
## Example with Allure Report Adapter | ||
|
||
1. Add `allure_report` and `test_reporter` to your dependencies. | ||
|
||
```yaml | ||
dev_dependencies: | ||
# reporter | ||
allure_report: ^1.0.0 | ||
test_reporter: ^1.0.0 | ||
``` | ||
2. Create `reporter.dart` in `test` directory. If no file created, **Basic Console Reporter** will be used. | ||
|
||
```dart | ||
import 'package:allure_report/allure_report.dart'; | ||
import 'package:test_reporter/test_reporter.dart'; | ||
TestReporter create() { | ||
return AllureReporter(); | ||
} | ||
``` | ||
|
||
3. Run test_reporter command with your tests | ||
|
||
```bash | ||
dart run test_reporter -- dart test | ||
``` | ||
|
||
```bash | ||
dart run test_reporter -- flutter test | ||
``` | ||
|
||
### Output | ||
|
||
Allure results are placed in `allure-results` folder in project root folder. | ||
|
||
Proceed to [Allure / How to view a report](https://allurereport.org/docs/gettingstarted-view-report/#start-a-local-web-server) |
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,6 +1,7 @@ | ||
import 'package:test_reporter/src/reporter/basic_reporter.dart'; | ||
import 'package:test_reporter/test_reporter.dart'; | ||
|
||
/// Entrypoint to create test reporter when `--reporter` arg used. | ||
TestReporter createReporter(List<String> args) { | ||
return BasicReporter(); | ||
} |
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,7 +1,12 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:test_reporter/src/model/models.dart'; | ||
import 'package:test_reporter/src/reporter/basic_reporter.dart'; | ||
|
||
/// Special reporter class to implement test report formats. | ||
/// | ||
/// See [BasicReporter] for example or [AllureReporter] from `allure_report` package. | ||
abstract interface class TestReporter { | ||
/// This method will be called for every test event from `dart test`/`flutter test` process. | ||
FutureOr<void> onEvent(TestEvent event); | ||
} |
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