Implements Phases 1-8 of the TFTSR implementation plan. Rust backend (Tauri 2.x, src-tauri/): - Multi-provider AI: OpenAI-compatible, Anthropic, Gemini, Mistral, Ollama - PII detection engine: 11 regex patterns with overlap resolution - SQLCipher AES-256 encrypted database with 10 versioned migrations - 28 Tauri IPC commands for triage, analysis, document, and system ops - Ollama: hardware probe, model recommendations, pull/delete with events - RCA and blameless post-mortem Markdown document generators - PDF export via printpdf - Audit log: SHA-256 hash of every external data send - Integration stubs for Confluence, ServiceNow, Azure DevOps (v0.2) Frontend (React 18 + TypeScript + Vite, src/): - 9 pages: full triage workflow NewIssue→LogUpload→Triage→Resolution→RCA→Postmortem→History+Settings - 7 components: ChatWindow, TriageProgress, PiiDiffViewer, DocEditor, HardwareReport, ModelSelector, UI primitives - 3 Zustand stores: session, settings (persisted), history - Type-safe tauriCommands.ts matching Rust backend types exactly - 8 IT domain system prompts (Linux, Windows, Network, K8s, DB, Virt, HW, Obs) DevOps: - .woodpecker/test.yml: rustfmt, clippy, cargo test, tsc, vitest on every push - .woodpecker/release.yml: linux/amd64 + linux/arm64 builds, Gogs release upload Verified: - cargo check: zero errors - tsc --noEmit: zero errors - vitest run: 13/13 unit tests passing Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
116 lines
5.8 KiB
TypeScript
116 lines
5.8 KiB
TypeScript
/**
|
|
*
|
|
* Return true if the selected DOM-element is displayed (even when the element is outside the viewport). It is using
|
|
* the [`checkVisibility`](https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#visibilityproperty)
|
|
* method provided by the browser to determine if an element is being displayed or not. Since WebdriverIO acts as a
|
|
* real user, the default values for the `contentVisibilityAuto`, `opacityProperty`, and `visibilityProperty` flags
|
|
* are set to `true` to default to a more strict behavior. This means that the command will check if the element is
|
|
* visible due to the value of its `content-visibility`, `opacity`, and `visibility` properties.
|
|
*
|
|
* If you want to also verify that the element is also within the viewport, provide the `withinViewport` flag to the command.
|
|
*
|
|
* :::info
|
|
*
|
|
* As opposed to other element commands WebdriverIO will not wait for the element
|
|
* to exist to execute this command.
|
|
*
|
|
* :::
|
|
*
|
|
* WebdriverIO, when conducting browser tests, utilizes a [custom script](https://github.com/webdriverio/webdriverio/blob/59d349ca847950354d02b9e548f60cc50e7871f0/packages/webdriverio/src/scripts/isElementDisplayed.ts)
|
|
* specifically designed to assess the visibility of elements. This script is key in determining whether an
|
|
* element is displayed on the page. Conversely, for native mobile testing scenarios with Appium, WebdriverIO
|
|
* defers to the [`isElementDisplayed`](https://appium.io/docs/en/2.1/reference/interfaces/appium_types.ExternalDriver/#elementdisplayed)
|
|
* command provided by Appium. This command evaluates the visibility of elements using criteria established by the
|
|
* underlying Appium driver, ensuring accurate and driver-specific assessments for mobile applications.
|
|
*
|
|
* <example>
|
|
:index.html
|
|
<div id="noSize"></div>
|
|
<div id="noSizeWithContent">Hello World!</div>
|
|
<div id="notDisplayed" style="width: 10px; height: 10px; display: none"></div>
|
|
<div id="notVisible" style="width: 10px; height: 10px; visibility: hidden"></div>
|
|
<div id="zeroOpacity" style="width: 10px; height: 10px; opacity: 0"></div>
|
|
<div id="notInViewport" style="width: 10px; height: 10px; position:fixed; top: 999999; left: 999999"></div>
|
|
:isDisplayed.js
|
|
it('should detect if an element is displayed', async () => {
|
|
elem = await $('#notExisting');
|
|
isDisplayed = await elem.isDisplayed();
|
|
console.log(isDisplayed); // outputs: false
|
|
|
|
let elem = await $('#noSize');
|
|
let isDisplayed = await elem.isDisplayed();
|
|
console.log(isDisplayed); // outputs: false
|
|
|
|
let elem = await $('#noSizeWithContent');
|
|
let isDisplayed = await elem.isDisplayed();
|
|
console.log(isDisplayed); // outputs: true
|
|
|
|
let elem = await $('#notDisplayed');
|
|
let isDisplayed = await elem.isDisplayed();
|
|
console.log(isDisplayed); // outputs: false
|
|
|
|
elem = await $('#notVisible');
|
|
isDisplayed = await elem.isDisplayed();
|
|
console.log(isDisplayed); // outputs: false
|
|
|
|
elem = await $('#zeroOpacity');
|
|
isDisplayed = await elem.isDisplayed();
|
|
console.log(isDisplayed); // outputs: false
|
|
|
|
elem = await $('#notInViewport');
|
|
isDisplayed = await elem.isDisplayed();
|
|
console.log(isDisplayed); // outputs: true
|
|
});
|
|
isDisplayedWithinViewport.js
|
|
it('should detect if an element is visible within the viewport', async () => {
|
|
let isDisplayedInViewport = await $('#notDisplayed').isDisplayed({ withinViewport: true });
|
|
console.log(isDisplayedInViewport); // outputs: false
|
|
|
|
isDisplayedInViewport = await $('#notVisible').isDisplayed({ withinViewport: true });
|
|
console.log(isDisplayedInViewport); // outputs: false
|
|
|
|
isDisplayedInViewport = await $('#notExisting').isDisplayed({ withinViewport: true });
|
|
console.log(isDisplayedInViewport); // outputs: false
|
|
|
|
isDisplayedInViewport = await $('#notInViewport').isDisplayed({ withinViewport: true });
|
|
console.log(isDisplayedInViewport); // outputs: false
|
|
|
|
isDisplayedInViewport = await $('#zeroOpacity').isDisplayed({ withinViewport: true });
|
|
console.log(isDisplayedInViewport); // outputs: false
|
|
});
|
|
* </example>
|
|
*
|
|
* @alias element.isDisplayed
|
|
* @param {Boolean} [withinViewport=false] `true` to check if the element is within the viewport. `false` by default.
|
|
* @param {Boolean} [contentVisibilityAuto=true] `true` to check if the element content-visibility property has (or inherits) the value auto, and it is currently skipping its rendering. `true` by default.
|
|
* @param {Boolean} [opacityProperty=true] `true` to check if the element opacity property has (or inherits) a value of 0. `true` by default.
|
|
* @param {Boolean} [visibilityProperty=true] `true` to check if the element is invisible due to the value of its visibility property. `true` by default.
|
|
* @return {Boolean} true if element is displayed
|
|
* @uses protocol/elements, protocol/elementIdDisplayed
|
|
* @type state
|
|
*/
|
|
export declare function isDisplayed(this: WebdriverIO.Element, commandParams?: IsDisplayedParams): Promise<boolean>;
|
|
interface IsDisplayedParams {
|
|
/**
|
|
* `true` to check if the element is within the viewport. false by default.
|
|
*/
|
|
withinViewport?: boolean;
|
|
/**
|
|
* `true` to check if the element content-visibility property has (or inherits) the value auto,
|
|
* and it is currently skipping its rendering. `true` by default.
|
|
* @default true
|
|
*/
|
|
contentVisibilityAuto?: boolean;
|
|
/**
|
|
* `true` to check if the element opacity property has (or inherits) a value of 0. `true` by default.
|
|
* @default true
|
|
*/
|
|
opacityProperty?: boolean;
|
|
/**
|
|
* `true` to check if the element is invisible due to the value of its visibility property. `true` by default.
|
|
* @default true
|
|
*/
|
|
visibilityProperty?: boolean;
|
|
}
|
|
export {};
|
|
//# sourceMappingURL=isDisplayed.d.ts.map
|