Skip to content

Testplane-quickstart#114

Open
Nikolaengel wants to merge 23 commits intogemini-testing:masterfrom
Nikolaengel:testplane-quickstart
Open

Testplane-quickstart#114
Nikolaengel wants to merge 23 commits intogemini-testing:masterfrom
Nikolaengel:testplane-quickstart

Conversation

@Nikolaengel
Copy link

Pull request for quick start

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.

В целом получилось прикольно, мне понравилось!

Что нужно доделать, чтобы это можно было влить и опубликовать:

  • поправить несколько минорных замечаний, особенно про скриншот старого дизайна
  • починить ошибки линтеров — можно увидеть их, запустив npm test, форматирование можно авто-поправить с помощью команды npm run reformat
  • добавить версии статей на английском, т.к. без этого эти статьи не будут отображаться на сайте, нужно выкатывать сразу в 2 вариантах

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю, лучше использовать скриншоты из New UI, так как именно новый интерфейс является актуальным. Для этого нужно нажать на кнопку Try New UI


## Установка {#install}

Для запуска установщика testplane, с помощью `npm` выполните следующую команду:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут лишняя запятая

```javascript
const assert = require("assert");

describe("tests", () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут пример можно сократить до двух тестов (двух конструкций it), будет меньше текста, читать легче

const searchButton = await browser.$("button.DocSearch");
await searchButton.waitForClickable({timeout: 5000});
await searchButton.click();
await browser.pause(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно убрать browser.pause из всех примеров, это плохая практика

assert.strictEqual(inputValue, "browser");
});

it("Пример двойного клика — выделение текста заголовка", async ({browser}) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В этом примере было бы прикольнее, наверное, разбить на секции — "Взаимодействие с кнопками и клики", "Заполнение форм", и т.д. В эту же секцию я бы перенес раздел про работу с формами, т.к. это тоже про взаимодействие с элементами

Comment on lines +263 to +295
describe("Примеры работы с хуками", () => {
// beforeEach — выполняется перед каждым тестом
beforeEach(async ({ browser }) => {
console.log("--- Выполняется BEFOREEACH — перед каждым тестом ---");
await browser.url("https://testplane.io/ru/");
await browser.pause(500);
});

// afterEach — выполняется после каждого теста
afterEach(async ({ browser }) => {
console.log("--- Выполняется AFTEREACH — после каждого теста ---");
const currentUrl = await browser.getUrl();
console.log("Текущий URL:", currentUrl);
// Можно делать скриншоты, очищать данные и т.д.
});

it("Тест 1 — проверка заголовка", async ({ browser }) => {
const title = await browser.getTitle();
assert.ok(title.includes("Testplane"));
});

it("Тест 2 — проверка логотипа", async ({ browser }) => {
const logo = await browser.$("a.navbar__brand");
const isDisplayed = await logo.isDisplayed();
assert.strictEqual(isDisplayed, true);
});

it("Тест 3 — проверка поиска", async ({ browser }) => {
const searchButton = await browser.$("button.DocSearch");
const isExisting = await searchButton.isExisting();
assert.strictEqual(isExisting, true);
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю это можно удалить, так как пример с вложенностью ниже покрывает сразу все кейсы.

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.

Нужно точно поправить проблему с бэктиками

import Admonition from "@theme/Admonition";

# Installation {#install}
# Installation and setup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installation and Setup, такой формат указан в гайдлайнах, английские заголовки самого верхнего уровня — каждой слово с большой буквы, кроме предлогов

---

# Running Tests
# Running and debugging
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running and Debugging Tests


### Running a specific test

You have a set of tests and need to run just one of them.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider the following set of tests:

...

If you want to run just one of them, use --grep option:

```

## The `--grep` Option {#the_grep_option}
In the quotes, you need to pass the content of the parentheses in the `it` keyword.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не обязательно содержимое it целиком. Лучше написать так: You can pass the whole test name, some part of it or regex pattern to run only those tests whose names will match..


The `describe` block is used to group related tests.

````javascript
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут есть проблема с синтаксисом: слишком много бэктиков, и они не закрыты.

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.

3 participants