Skip to content

Commit 115c942

Browse files
authored
docs(quickstart): some improvements (#125)
* docs: first priority changes draft * docs: add medium priority improvements to quickstart - Add links to reference sections for methods (browser.url, browser.openAndWait, $) - Add examples of different selector types (CSS, text, XPath) with recommendations - Expand --grep section with regex examples and .only() alternative - Add tips on selector priority and best practices * docs: fix --grep examples * docs: add improvements * docs(quickstart): simplify CI setup guide, focus on official action * docs(quickstart): add improvements to running tests section * docs(quickstart): add improvements * docs(quickstart): add improvements to index ans wrighting tests section * docs(quickstart): fix running-tests * docs(quickstart): remove ё * docs(quickstart): some fixes * docs(quickstart): some fixes, update examples * docs(quickstart): some fixes, translation * docs(quickstart): add improvements to index ans wrighting tests section * docs(quickstart): prettier fixes * docs(quickstart): tiny fix * docs(quickstart): add links and other improvements * docs(quickstart): translation --------- Authored-by: kseniataranov <kseniataranov@yandex-team.ru>
1 parent e2a9cea commit 115c942

8 files changed

Lines changed: 948 additions & 868 deletions

File tree

docs/quickstart/index.mdx

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
sidebar_position: 1
33
---
44

5-
import Tabs from "@theme/Tabs";
6-
import TabItem from "@theme/TabItem";
7-
import Admonition from "@theme/Admonition";
8-
95
# Installation and Setup
106

117
## System requirements
@@ -20,7 +16,7 @@ To run the Testplane installer using `npm`, execute the following command:
2016
npm init testplane@latest YOUR_PROJECT_PATH
2117
```
2218

23-
To configure the project instead of using defaults during initialization, specify the `-v` option.
19+
To configure the project in interactive mode with additional parameters (package manager selection, plugin installation), specify the <nobr>`-v`</nobr> option.
2420

2521
After running the installation command, the following set of files and folders will appear in the project directory:
2622

@@ -38,25 +34,23 @@ testplane.config.ts
3834

3935
The `testplane.config.ts` file contains a basic set of settings for running tests:
4036

41-
```typescript
37+
```typescript title="testplane.config.ts"
38+
import { setupBrowser } from "@testplane/testing-library";
39+
import type { WdioBrowser } from "testplane";
40+
4241
export default {
4342
gridUrl: "local",
4443
baseUrl: "http://localhost",
45-
pageLoadTimeout: 0,
46-
httpTimeout: 60000,
44+
pageLoadTimeout: 20000,
45+
httpTimeout: 20000,
4746
testTimeout: 90000,
4847
resetCursor: false,
49-
50-
// The `sets` parameter contains information about the directory where the tests are located
51-
// and a list of browsers in which they will be run:
5248
sets: {
5349
desktop: {
5450
files: ["testplane-tests/**/*.testplane.(t|j)s"],
5551
browsers: ["chrome", "firefox"],
5652
},
5753
},
58-
59-
// The `browsers` field describes the configuration of the browsers used:
6054
browsers: {
6155
chrome: {
6256
headless: true,
@@ -71,7 +65,9 @@ export default {
7165
},
7266
},
7367
},
74-
68+
prepareBrowser: (browser: WdioBrowser) => {
69+
setupBrowser(browser);
70+
},
7571
plugins: {
7672
"html-reporter/testplane": {
7773
enabled: true,
@@ -80,13 +76,77 @@ export default {
8076
diffMode: "3-up-scaled",
8177
},
8278
},
83-
};
79+
} satisfies import("testplane").ConfigInput;
8480
```
8581

82+
### Key configuration parameters
83+
84+
- `gridUrl` — where to run browsers: `"local"` for local execution or a URL for Selenium Grid or cloud (e.g., BrowserStack, Sauce Labs).
85+
- `sets` — test groups for different browsers (e.g., a test set for desktop Chrome or Firefox and a set for mobile Safari). Learn more: [Sets reference](../reference/config/sets.mdx).
86+
- `testTimeout` — maximum test execution time in milliseconds; the test is aborted after exceeding this limit.
87+
- `pageLoadTimeout` — maximum page load wait time.
88+
- `browsers` — browser configuration; `headless: true` — run without UI. Learn more: [Browsers](../basic-guides/browsers-overview.mdx).
89+
- `prepareBrowser` — hook before tests; in the config above it calls `setupBrowser(browser)` and adds Testing Library methods.
90+
- `plugins` — plugins; in the config above `html-reporter` for interactive reports (screenshots, logs, debugging). Learn more: [HTML Reporter](../html-reporter/overview.mdx).
91+
92+
For a complete list of configuration parameters, see the [configuration reference](../reference/config/main.mdx).
93+
8694
To download the browsers described in the config separately from running Testplane itself, execute the command:
8795

8896
```bash
8997
npx testplane install-deps
9098
```
9199

92100
Without running this command beforehand, missing browsers will be automatically downloaded the first time Testplane is launched.
101+
102+
## First run {#first-run}
103+
104+
After installation and setup, run the test example that was created automatically:
105+
106+
```bash
107+
npx testplane
108+
```
109+
110+
### What happens during the first run
111+
112+
Testplane will automatically perform the following actions:
113+
114+
1. Download browsers: if you haven't run `install-deps`, Testplane will download Chrome and Firefox
115+
2. Run the test: execute the example from `testplane-tests/example.testplane.ts`
116+
3. Generate a report: create an HTML report in the `testplane-report/` folder
117+
118+
### Viewing results
119+
120+
After the tests finish, open the interactive report:
121+
122+
```bash
123+
npx testplane gui
124+
```
125+
126+
The command will start a local server and open the report in your browser. In the interface you will see:
127+
128+
- List of passed tests
129+
- Execution statistics
130+
- Screenshots (if the test uses `assertView`)
131+
- Execution logs
132+
133+
### Expected outcome
134+
135+
If everything is configured correctly, you will see:
136+
137+
```
138+
✔ test examples › docs search test [chrome] - 3.2s
139+
✔ test examples › docs search test [firefox] - 3.5s
140+
141+
Total: 2 Passed: 2 Failed: 0 Skipped: 0 Retries: 0
142+
```
143+
144+
For the tests to pass successfully, they need access to [testplane.io](https://testplane.io/).
145+
146+
## What's next?
147+
148+
Now that Testplane is set up and running, you can:
149+
150+
- [Write your own tests](./writing-tests.mdx): test structure, selectors, and basic commands
151+
- [Run and debug tests](./running-tests.mdx): filtering, GUI mode, debugging
152+
- [Set up CI/CD](./usage-in-ci.mdx): automatic test runs in GitHub Actions

0 commit comments

Comments
 (0)