-
Notifications
You must be signed in to change notification settings - Fork 3
docs: waitForStaticToLoad #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,64 @@ | ||
| import Admonition from "@theme/Admonition"; | ||
| import Version from "../../_partials/specs/version.mdx"; | ||
|
|
||
| # waitForStaticToLoad | ||
|
|
||
| <Version version="8.32.0" /> | ||
|
|
||
| ## Overview {#overview} | ||
|
|
||
| Use the `waitForStaticToLoad` command to wait for static elements on the page to load, such as fonts, CSS styles, and images. | ||
|
|
||
| When the timeout is reached, if the page is still not loaded, it does not throw an error but returns a result with the reason. | ||
|
|
||
| Automatically called when executing `assertView`. | ||
|
|
||
| <Admonition type="warning"> | ||
| If an image is loaded via the `background-image` property defined in external CSS styles, | ||
| Testplane will only be able to wait for this image if these styles are served from a local | ||
| server, or if the element has a `crossorigin` attribute set to `anonymous`. | ||
| </Admonition> | ||
|
|
||
| ## Usage {#usage} | ||
|
|
||
| ```javascript | ||
| const result = await browser.waitForStaticToLoad({ timeout: 5000, interval: 300 }); | ||
| // { ready: true } | ||
| // { ready: false, reason: "Document is loading" } | ||
| // { ready: false, reason: "JavaScript is running" } | ||
| // { ready: false, reason: "Fonts are loading" } | ||
| // { ready: false, reason: "Image from https://example.com/image.jpg is loading" } | ||
| // { ready: false, reason: "Styles from https://example.com/style.css are loading" } | ||
| // { ready: false, reason: "Resources are not loaded", pendingResources: ["https://example.com/image.jpg"] } | ||
| ``` | ||
|
|
||
| ## Command Parameters {#parameters} | ||
|
|
||
| <table> | ||
| <thead> | ||
| <tr> | ||
| <td>**Name**</td> | ||
| <td>**Type**</td> | ||
| <td>**Default**</td> | ||
| <td>**Description**</td> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td>timeout</td> | ||
| <td>Number</td> | ||
| <td>5000</td> | ||
| <td>Timeout in milliseconds.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>interval</td> | ||
| <td>Number</td> | ||
| <td>500</td> | ||
| <td>Interval in milliseconds between condition checks.</td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| ## Related Commands {#related} | ||
|
|
||
| - [browser.assertView](../../browser/assertView) |
This file contains hidden or 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 hidden or 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
64 changes: 64 additions & 0 deletions
64
...docusaurus-plugin-content-docs/current/commands/browser/waitForStaticToLoad.mdx
This file contains hidden or 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,64 @@ | ||
| import Admonition from "@theme/Admonition"; | ||
| import Version from "../../_partials/specs/version.mdx"; | ||
|
|
||
| # waitForStaticToLoad | ||
|
|
||
| <Version version="8.32.0" /> | ||
|
|
||
| ## Обзор {#overview} | ||
|
|
||
| Используйте команду `waitForStaticToLoad`, чтобы дождаться загрузки статических элементов на странице, таких как шрифты, CSS-стили и картинки. | ||
|
|
||
| По достижении таймаута, если страница все еще не загружена, не выбрасывает ошибку, а возвращает результат с причиной. | ||
|
|
||
| Автоматически вызывается при выполнении `assertView`. | ||
|
|
||
| <Admonition type="warning"> | ||
| Если картинка загружается из-за свойства `background-image`, описанного во внешних CSS-стилях, | ||
| Testplane сможет дождаться этой картинки только если эти стили раздаются с локального сервера, | ||
| либо если у элемента присутствует атрибут `crossorigin` в значении `anonymous`. | ||
| </Admonition> | ||
|
|
||
| ## Использование {#usage} | ||
|
|
||
| ```javascript | ||
| const result = await browser.waitForStaticToLoad({ timeout: 5000, interval: 300 }); | ||
| // { ready: true } | ||
| // { ready: false, reason: "Document is loading" } | ||
| // { ready: false, reason: "JavaScript is running" } | ||
| // { ready: false, reason: "Fonts are loading" } | ||
| // { ready: false, reason: "Image from https://example.com/image.jpg is loading" } | ||
| // { ready: false, reason: "Styles from https://example.com/style.css are loading" } | ||
| // { ready: false, reason: "Resources are not loaded", pendingResources: ["https://example.com/image.jpg"] } | ||
| ``` | ||
|
|
||
| ## Параметры команды {#parameters} | ||
|
|
||
| <table> | ||
| <thead> | ||
| <tr> | ||
| <td>**Имя**</td> | ||
| <td>**Тип**</td> | ||
| <td>**По умолчанию**</td> | ||
| <td>**Описание**</td> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td>timeout</td> | ||
| <td>Number</td> | ||
| <td>5000</td> | ||
| <td>Таймаут в миллисекундах.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>interval</td> | ||
| <td>Number</td> | ||
| <td>500</td> | ||
| <td>Интервал в миллисекундах между проверками условия.</td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| ## Связанные команды {#related} | ||
|
|
||
| - [browser.assertView](../../browser/assertView) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а почему у тебя здесь таблица html-разметкой, а на англ. версии - md?
Таблицы в новых доках мы договорились сразу оформлять "красиво" (с отступами):