ocrWaitForTextDisplayed
화면에 특정 텍스트가 표시될 때까지 기다립니다.
사용법
await browser.ocrWaitForTextDisplayed({
text: "specFileRetries",
});
출력
로그
[0-0] 2024-05-26T04:32:52.005Z INFO webdriver: COMMAND ocrWaitForTextDisplayed(<object>)
......................
# ocrWaitForTextDisplayed uses ocrGetElementPositionByText under the hood, that is why you see the command ocrGetElementPositionByText in the logs
[0-0] 2024-05-26T04:32:52.735Z INFO @wdio/ocr-service:ocrGetElementPositionByText: Multiple matches were found based on the word "specFileRetries". The match "specFileRetries" with score "100%" will be used.
옵션
text
- 타입:
string - 필수 여부: 예
클릭하기 위해 검색하려는 텍스트입니다.
예시
await browser.ocrWaitForTextDisplayed({ text: "specFileRetries" });
timeout
- 타입:
number - 필수 여부: 아니오
- 기본값: 18000 (18초)
밀리초 단위의 시간입니다. OCR 처리에는 시간이 걸릴 수 있으므로 너무 낮게 설정하지 마세요.
예시
await browser.ocrWaitForTextDisplayed({
text: "specFileRetries"
timeout: 25000 // 25초 동안 대기
});
timeoutMsg
- 타입:
string - 필수 여부: 아니오
- 기본값:
Could not find the text "{selector}" within the requested time.
기본 오류 메시지를 재정의합니다.
예시
await browser.ocrWaitForTextDisplayed({
text: "specFileRetries"
timeoutMsg: "My new timeout message."
});
contrast
- 타입:
number - 필수 여부: 아니오
- 기본값:
0.25
대비가 높을수록 이미지가 더 어두워지고 그 반대도 마찬가지입니다. 이는 이미지에서 텍스트를 찾는 데 도움이 될 수 있습니다. -1과 1 사이의 값을 허용합니다.
예시
await browser.ocrWaitForTextDisplayed({
text: "specFileRetries",
contrast: 0.5,
});
haystack
- 타입:
number - 필수 여부:
WebdriverIO.Element | ChainablePromiseElement | Rectangle
OCR이 텍스트를 찾아야 하는 화면의 검색 영역입니다. 이는 요소나 x, y, width 및 height를 포함하는 직사각형일 수 있습니다.