Skip to content

Commit

Permalink
Merge pull request #95 from reportportal/develop
Browse files Browse the repository at this point in the history
Release 5.0.11
  • Loading branch information
AmsterGet authored Apr 13, 2023
2 parents f562744 + 3432252 commit 1630ad5
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Fixed
- Errors in case of Playwright doesn't provide the internal `_staticAnnotations` property to the `TestCase`s.
### Added
- [`printsToStdio`](https://playwright.dev/docs/api/class-reporter#reporter-prints-to-stdio) method implemented. Now the Playwright will provide additional output to the terminal to enhance user experience in case of only `@reportportal/agent-js-playwright` reporter used.

## [5.0.10] - 2023-04-12
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.10
5.0.11-SNAPSHOT
28 changes: 28 additions & 0 deletions src/__tests__/reporter/printsToStdio.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2023 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { RPReporter } from '../../reporter';
import { mockConfig } from '../mocks/configMock';
import { RPClientMock } from '../mocks/RPClientMock';

describe('printsToStdio', () => {
const reporter = new RPReporter(mockConfig);
reporter.client = new RPClientMock(mockConfig);

test('should return "false" as the agent doesn\'t report anything to the console', () => {
expect(reporter.printsToStdio()).toBe(false);
});
});
21 changes: 15 additions & 6 deletions src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,17 @@ export class RPReporter implements Reporter {
let decreaseIndex = 1;
const isTestFinishedFromHookOrStaticAnnotation = result.workerIndex === -1;
const testOutcome = test.outcome();
// @ts-ignore access to private property _staticAnnotations
const isStaticallyAnnotatedWithSkippedAnnotation = test._staticAnnotations.some(
(annotation: { type: TEST_ANNOTATION_TYPES; description: string }) =>
annotation.type === TEST_ANNOTATION_TYPES.SKIP ||
annotation.type === TEST_ANNOTATION_TYPES.FIXME,
);
const isTestHasStaticAnnotations =
// @ts-ignore access to private property _staticAnnotations
test._staticAnnotations && Array.isArray(test._staticAnnotations);
const isStaticallyAnnotatedWithSkippedAnnotation = isTestHasStaticAnnotations
? // @ts-ignore access to private property _staticAnnotations
test._staticAnnotations.some(
(annotation: { type: TEST_ANNOTATION_TYPES; description: string }) =>
annotation.type === TEST_ANNOTATION_TYPES.SKIP ||
annotation.type === TEST_ANNOTATION_TYPES.FIXME,
)
: false;

// TODO: post an issue on GitHub for playwright/test to provide clear output for this purpose
const isFinishedFromHook =
Expand Down Expand Up @@ -569,4 +574,8 @@ export class RPReporter implements Reporter {
await Promise.all(this.promises);
this.launchId = null;
}

printsToStdio(): boolean {
return false;
}
}

0 comments on commit 1630ad5

Please sign in to comment.