-
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
Showing
51 changed files
with
674 additions
and
301 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export {doAfterPack} from './doAfterPack'; | ||
export {doBeforePack} from './doBeforePack'; | ||
export {mapLogPayloadInConsole} from './mapLogPayloadInConsole'; | ||
export {mapLogPayloadInReport} from './mapLogPayloadInReport'; | ||
export {skipTests} from './skipTests'; |
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,27 @@ | ||
import {replaceFields} from 'e2ed/configurator'; | ||
|
||
import type {MapLogPayloadInReport} from 'autotests/types/packSpecific'; | ||
import type {FieldReplacer} from 'e2ed/types'; | ||
|
||
const maxStringLengthInReportLogs = 512; | ||
|
||
const replacer: FieldReplacer = (path, value) => { | ||
if (typeof value === 'string' && value.length > maxStringLengthInReportLogs) { | ||
const halfOfLength = Math.floor(maxStringLengthInReportLogs / 2); | ||
const numberOfCuttedSymbols = value.length - 2 * halfOfLength; | ||
|
||
return `${value.slice(0, halfOfLength)}...(${numberOfCuttedSymbols} symbols)...${value.slice( | ||
-halfOfLength, | ||
)}`; | ||
} | ||
|
||
return value; | ||
}; | ||
|
||
/** | ||
* Maps log payload for logging in HTML console to clarify, shorten or skip a console log entry. | ||
* If the mapping returns `null`, the log entry is skipped. | ||
* If the mapping returns `undefined`, the log entry is not skipped, but is printed with an empty payload. | ||
*/ | ||
export const mapLogPayloadInReport: MapLogPayloadInReport = (_message, payload) => | ||
replaceFields(payload, replacer); |
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
Oops, something went wrong.