Skip to content
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

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

sipayRT
Copy link
Member

@sipayRT sipayRT commented Aug 8, 2024

No description provided.

Copy link

github-actions bot commented Aug 8, 2024

✅ Successfully deployed static

@sipayRT
Copy link
Member Author

sipayRT commented Aug 8, 2024

<tr><td>**Имя**</td><td>**Тип**</td><td>**Описание**</td></tr>
</thead>
<tbody>
<tr><td>stepName</td><td>String</td><td>Название шага.</td></tr>
Copy link
Member

@shadowusr shadowusr Aug 9, 2024

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

<tr><td>**Имя**</td><td>**Тип**</td><td>**Описание**</td></tr>
</thead>
<tbody>
<tr><td>stepName</td><td>String</td><td>Название шага.</td></tr>
Copy link
Member

@shadowusr shadowusr Aug 9, 2024

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


## Примеры использования {#examples}

```javascript
Copy link
Member

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


```javascript
const parsedPage = await browser.runStep('parse page', async () => {
...
Copy link
Member

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.


## Примеры использования {#examples}

```javascript
Copy link
Member

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.

Copy link
Member

@shadowusr shadowusr left a 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!

@sipayRT sipayRT merged commit a86d194 into master Aug 13, 2024
2 checks passed
@sipayRT sipayRT deleted the sp.commands branch August 13, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants