Skip to content

Testplane-quickstart#114

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

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

Conversation

@Nikolaengel
Copy link

Pull request for quick start

[testplane-test-repeater]: ../../plugins/testplane-test-repeater
### Отладка через Testplane UI

Наиболее удобным способом для работы с отладкой тестов является UI-режим, в нем вы можете в реальном времени наблюдать выполнения тестов.

Choose a reason for hiding this comment

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

"выполнение" вместо "выполнения"

Если вы не хотите использовать дефолты при инициализации проекта, а настроить его с помощью визарда, укажите опцию `-v`.
Чтобы настроить проект, а не использовать дефолты при его инициализации, укажите опцию `-v`.

После выполнения команды установки, в директории проекта появится следующий набор файлов и папок:

Choose a reason for hiding this comment

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

убрать запятую после "установки": После выполнения команды установки в директории проекта...

## Опция `--grep`
### Запуск конкретного теста

У вас имеется набор тестов и вам нужно запустить только один из них.

Choose a reason for hiding this comment

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

нужна запятая после "тестов": У вас имеется набор тестов, и вам нужно запустить только один из них.

testplane ../testplane-tests/example.testplane.ts
```

Где `../testplane-tests/example.testplane.ts` это путь к файлу с тестами.

Choose a reason for hiding this comment

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

нужно тире перед "это": Где ../testplane-tests/example.testplane.ts — это путь к файлу с тестами.


### Режим пользовательского интерфейса

В Testplane вы можете работать с тестами в UI формате с помощью Testplane UI.

Choose a reason for hiding this comment

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

нужен дефис: UI-формате


### Отладка в gui-формате

Отслеживать процесс выполнения тестов очень легко, если запустить их в `gui`-режиме. В подобном формате работы html-reporter продемонстрирует, какие тесты были успешно выполнены, а в каких присутствуют ошибки и какого они характера.
Copy link

@janair77 janair77 Jan 30, 2026

Choose a reason for hiding this comment

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

я бы перестроила, так как слово "характер" в этом случае относится не к тестам, а к ошибкам: "...какие тесты были успешно выполнены, а в каких присутствуют ошибки, а также укажет характер этих ошибок."

browsers: ["chrome", "firefox"];
```

При выполнении команды `npx testplane` тесты запустятся в браузерах Google Chrome и Mozila Firefox.

Choose a reason for hiding this comment

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

Mozilla нужно с двумя l

await browser.url("/page");

// browser.debug() останавливает выполнение теста
// и открывает интерактивную консоль (REPL - Read-Eval-Print Loop)

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: REPL — Read-Eval-Print Loop

const assert = require("assert");

describe("tests", () => {
it("WebdriverIO assert - проверка URL", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса? it("WebdriverIO assert — проверка URL"

await expect(browser).toHaveUrl("https://testplane.io/ru/");
});

it("WebdriverIO assert - проверка существования элемента", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса? it("WebdriverIO assert — проверка существования элемента"

await expect(logo).toExist();
});

it("WebdriverIO assert - проверка видимости элемента", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса? it("WebdriverIO assert — проверка видимости элемента"

});

// Примеры с Jest ассертами
it("Jest assert - проверка заголовка страницы", async ({ browser }) => {
Copy link

@janair77 janair77 Jan 30, 2026

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса? it("Jest assert — проверка заголовка страницы"

expect(title).toContain("Testplane");
});

it("Jest assert - проверка количества элементов", async ({ browser }) => {
Copy link

@janair77 janair77 Jan 30, 2026

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса? it("Jest assert — проверка количества элементов"

expect(href).toBe("/ru/docs/v8/");
});

it("Jest assert - проверка URL с регулярным выражением", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса? it("Jest assert — проверка URL с регулярным выражением"

const assert = require("assert");

describe("Примеры работы с хуками", () => {
// beforeEach - выполняется перед каждым тестом

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: beforeEach — выполняется перед каждым тестом

describe("Примеры работы с хуками", () => {
// beforeEach - выполняется перед каждым тестом
beforeEach(async ({ browser }) => {
console.log("--- Выполняется BEFOREEACH - перед каждым тестом ---");

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: Выполняется BEFOREEACH — перед каждым тестом

await browser.pause(500);
});

// afterEach - выполняется после каждого теста

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: afterEach — выполняется после каждого теста


// afterEach - выполняется после каждого теста
afterEach(async ({ browser }) => {
console.log("--- Выполняется AFTEREACH - после каждого теста ---");

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: Выполняется AFTEREACH — после каждого теста

// Можно делать скриншоты, очищать данные и т.д.
});

it("Тест 1 - проверка заголовка", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: Тест 1 — проверка заголовка

assert.ok(title.includes("Testplane"));
});

it("Тест 2 - проверка логотипа", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: Тест 2 — проверка логотипа

assert.strictEqual(isDisplayed, true);
});

it("Тест 3 - проверка поиска", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: Тест 3 — проверка поиска


### Работа с формами

Testplane предоставляет специальные методы для работы с различными элементами форм. Чекбоксы и радио-кнопки управляются через клик. Для выпадающих списков `(<select>)` есть удобные методы выбора опций по видимому тексту или значению атрибута.

Choose a reason for hiding this comment

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

нужно слитно: радиокнопки

assert.strictEqual(isSelected, false);
});

it("Работа с радио-кнопками через клик", async ({ browser }) => {

Choose a reason for hiding this comment

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

нужно слитно: радиокнопками

const link = await browser.$("a[href='/forgot_password']");
await link.click();

// Работа с полем email (как пример радио-кнопок)

Choose a reason for hiding this comment

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

нужно слитно: радиокнопок


### Работа с JavaScript кодом

Иногда нужно выполнить произвольный JavaScript код в контексте страницы — например, для работы с `localStorage`, вызова функций или манипуляции `DOM` напрямую. Метод `execute()` выполняет код в браузере и может возвращать результат.

Choose a reason for hiding this comment

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

нужен дефис: JavaScript-код


### Хуки

Хуки — это специальные функции, которые автоматически выполняются в определенные моменты жизненного цикла тестов. Они позволяют подготовить окружение перед тестами и очистить его после выполнения. По умолчанию доступны два вида хуков — `beforeEach` и `afterEach`, первый выполняется перед каждым тестом, а второй после.

Choose a reason for hiding this comment

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

нужно тире после "второй": "...а второй — после."

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

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

Choose a reason for hiding this comment

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

нужно длинное тире: Пример двойного клика — выделение текста заголовка

assert.strictEqual(isDisplayed, true);
});

it("Пример ввода текста - поиск по документации", async ({browser}) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: Пример ввода текста — поиск по документации


describe("tests, () => {

it("Пример клика - открытие поиска", async ({browser}) => {

Choose a reason for hiding this comment

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

нужно длинное тире вместо дефиса: Пример клика — открытие поиска

});
```

После установки testplane, вы можете ознакомиться с примером теста, для этого перейдите в папку `testplane-tests` и откройте файл `example.testplane.ts`.

Choose a reason for hiding this comment

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

запятую после testplane убрать: "После установки testplane вы можете ознакомиться..."

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