-
Notifications
You must be signed in to change notification settings - Fork 2
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
docs(commands): add documentation about missing browser commands #23
Conversation
✅ Successfully deployed static |
docs/commands/browser/runStep.mdx
Outdated
<tr><td>**Имя**</td><td>**Тип**</td><td>**Описание**</td></tr> | ||
</thead> | ||
<tbody> | ||
<tr><td>stepName</td><td>String</td><td>Название шага.</td></tr> |
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.
Why is everyone copying this flat weirdly looking table markup with wrong indents, LOL. It wasn't intended, it's a temporary consequence of migrating from yfm. I suggest using proper markup, which will be automatically formatted by prettier e.g. https://github.com/gemini-testing/testplane-docs/pull/26/files
For some reason when tables are formatted this way, Prettier doesn't pick them up. If you add at least one indent, it will format it automatically.
Applies to all pages
docs/commands/browser/runStep.mdx
Outdated
<tr><td>**Имя**</td><td>**Тип**</td><td>**Описание**</td></tr> | ||
</thead> | ||
<tbody> | ||
<tr><td>stepName</td><td>String</td><td>Название шага.</td></tr> |
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.
Another thing we need to come to agreement about is formatting such tables with parameters.
I suggest to wrap param names in backticks and write types in TypeScript style, i.e.
stepName
, string
.
stepCb
, () => Promise<any>
In my opinion it makes things a lot more clear and you can't express much with Javascript types "Object" or "Function". You have no way to express unions with JS types. And generally as far as I understand we're moving towards making TypeScript the primary language in Testplane
docs/commands/browser/runStep.mdx
Outdated
|
||
## Примеры использования {#examples} | ||
|
||
```javascript |
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.
Let's use typescript in all code blocks?
It won't change a thing here, I know, but I see two reasons why it will be useful:
- When we enable that plugin for automatic Typescript=>JS translation of code blocks, we'll get nice&consistent experience across the whole site. If we keep js blocks, they will be the only ones without the TS/JS switch.
- Anyone in the future will be able to add types / typescript specific syntax
docs/commands/browser/runStep.mdx
Outdated
|
||
```javascript | ||
const parsedPage = await browser.runStep('parse page', async () => { | ||
... |
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.
Code in all code blocks should be actual valid JavaScript/TS.
This is very important, because only then Prettier will be able to format code blocks inside mdx, depending on the language of the code block. You can see that this code block is already formatted wrong — it uses '
instead of "
used everywhere else. ...
makes it invalid, should be a comment.
Another reason, again will be that auto TS/JS plugin won't be able to convert code blocks that aren't valid code.
docs/commands/browser/runStep.mdx
Outdated
|
||
## Примеры использования {#examples} | ||
|
||
```javascript |
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.
Optionally, we can move large enough examples to partial files and import them in ru/en from one place (see my PR). But that's not critical to me, we can keep it as is.
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.
Other than that, looks good to me!
No description provided.