diff --git a/docs/src/api/class-androiddevice.md b/docs/src/api/class-androiddevice.md index 5ad7c37ef0..560e225c06 100644 --- a/docs/src/api/class-androiddevice.md +++ b/docs/src/api/class-androiddevice.md @@ -328,7 +328,7 @@ Waits for the specific [`param: selector`] to either appear or disappear, depend Selector to wait for. ### option: AndroidDevice.wait.state -- `state` <"gone"> +- `state` <[AndroidDeviceState]<"gone">> Optional state. Can be either: * default - wait for element to be present. diff --git a/docs/src/api/class-logger.md b/docs/src/api/class-logger.md index b6b3a03f8b..159ae99fa0 100644 --- a/docs/src/api/class-logger.md +++ b/docs/src/api/class-logger.md @@ -28,7 +28,7 @@ Determines whether sink is interested in the logger with the given name and seve logger name ### param: Logger.isEnabled.severity -- `severity` <"verbose"|"info"|"warning"|"error"> +- `severity` <[LogSeverity]<"verbose"|"info"|"warning"|"error">> ## method: Logger.log @@ -38,7 +38,7 @@ logger name logger name ### param: Logger.log.severity -- `severity` <"verbose"|"info"|"warning"|"error"> +- `severity` <[LogSeverity]<"verbose"|"info"|"warning"|"error">> ### param: Logger.log.message - `message` <[string]|[Error]> diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 242aa1d89a..755e57b567 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -902,7 +902,7 @@ Note that outer and inner locators must belong to the same frame. Inner locator - %%-locator-option-has-%% ## screenshot-option-animations -- `animations` <"disabled"> +- `animations` <[ScreenshotAnimations]<"disabled">> When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration: * finite animations are fast-forwarded to completion, so they'll fire `transitionend` event. diff --git a/docs/src/test-api/class-test.md b/docs/src/test-api/class-test.md index fd831db1f0..f02813bd58 100644 --- a/docs/src/test-api/class-test.md +++ b/docs/src/test-api/class-test.md @@ -288,7 +288,7 @@ test('runs second', async ({ page }) => {}); ``` ### option: Test.describe.configure.mode -- `mode` <"parallel"|"serial"> +- `mode` <[TestMode]<"parallel"|"serial">> diff --git a/utils/doclint/documentation.js b/utils/doclint/documentation.js index d636970aa4..40b8c941dd 100644 --- a/utils/doclint/documentation.js +++ b/utils/doclint/documentation.js @@ -448,7 +448,11 @@ Documentation.Type = class { * @return {Documentation.Type} */ static fromParsedType(parsedType, inUnion = false) { - if (!inUnion && parsedType.union) { + if (!inUnion && !parsedType.unionName && isStringUnion(parsedType) ) { + throw new Error('Enum must have a name:\n' + JSON.stringify(parsedType, null, 2)); + } + + if (!inUnion && (parsedType.union || parsedType.unionName)) { const type = new Documentation.Type(parsedType.unionName || ''); type.union = []; for (let t = parsedType; t; t = t.union) { @@ -568,8 +572,6 @@ Documentation.Type = class { * @returns {boolean} */ function isStringUnion(type) { - if (!type.union) - return false; while (type) { if (!type.name.startsWith('"') || !type.name.endsWith('"')) return false;