Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,16 @@ export default defineConfig({
{ label: 'Classical vs BDD', link: '/project/tests/classical-vs-bdd' },
{ label: 'Classical Test Case Editor', link: '/project/tests/classical-test-case-editor' },
{ label: 'BDD Test Case Editor', link: '/project/tests/bdd-test-case-editor' },
{ label: 'Converting to BDD', link: '/project/tests/converting-to-bdd' },
{ label: 'Copy and Move your Tests', link: '/project/tests/copy-and-move-your-tests' },
{ label: 'Test Case Creation and Editing', link: '/project/tests/test-case-creation-and-editing' },
{ label: 'Create a Test', link: '/project/tests/create-a-test' },
{ label: 'Test Steps and Expected Results', link: '/project/tests/test-steps-and-expected-results' },
{ label: 'Edit Test Steps', link: '/project/tests/edit-test-steps' },
{ label: 'Test Attachments', link: '/project/tests/test-attachments' },
{ label: 'Suites and Folders', link: '/project/tests/suites-and-folders' },
{ label: 'Tags, Labels, and Assignees', link: '/project/tests/tags-labels-and-assignees' },
{ label: 'Test Priority', link: '/project/tests/test-priority' },
{ label: 'Dynamic Parameters', link: '/project/tests/dynamic-parameters' },
{ label: 'Other Features for Test case Design', link: '/project/tests/other-features-for-test-case-design' },
],
},
Expand Down
1 change: 1 addition & 0 deletions redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const redirects = {
"/security/overview/": "/legal/security",
"/security/subprocessors": "/legal/security/subprocessors",
"/usage/continious-integration": "/integrations/continuous-integration",
"/project/tests/test-case-creation-and-editing": "/project/tests",
// "/usage/bdd-syntax": "", bdd-syntax locate in not-in-use folder
"/reference/reporter/pipes/testomatio.html": "/project/runs/reporter/pipes/testomatio",
"/usage/templates.html": "/management/project/templates",
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/advanced/mermaid-diagrams/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ Testomat.io can build a mindmap for you. **Generate Project Structure** reads yo

- [AI-Powered Features](https://docs.testomat.io/advanced/ai-powered-features/ai-powered-features)
- [Living Documentation](https://docs.testomat.io/advanced/living-doc)
- [Test Case Creation and Editing](https://docs.testomat.io/project/tests/test-case-creation-and-editing)
- [Create a Test](https://docs.testomat.io/project/tests/create-a-test)
6 changes: 3 additions & 3 deletions src/content/docs/advanced/test-artifacts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can add attachments during test case creation or editing by directly **dragg

![Testomat.io - Add attachment](./images/Add_attachment_1.gif)

For more details on adding and managing attachments, refer to the [Add Attachments to Test](https://docs.testomat.io/project/tests/test-case-creation-and-editing/#add-attachments-to-test).
For more details on adding and managing attachments, refer to the [Add Attachments to Test](https://docs.testomat.io/project/tests).

You can also manage attachments across Testomat.io by adding them to **suites**, **folders**, and the **readme section**. This streamline workflows by keeping all relevant files and documentation in one place. Whether you’re sharing important notes, reference materials, or test data, you can now attach them directly to the relevant test structures for easy access.

Expand All @@ -36,7 +36,7 @@ You can also manage attachments across Testomat.io by adding them to **suites**,

If you no longer need your attachments, you can delete them.

Go to [How to Delete Attachment from Test Case](https://docs.testomat.io/project/tests/test-case-creation-and-editing/#how-to-delete-attachment-from-test-case) section to read more about this feature.
Go to [How to Delete Attachment from Test Case](https://docs.testomat.io/project/tests) section to read more about this feature.

:::note

Expand All @@ -48,7 +48,7 @@ You can delete attachments from Suite, Folder and Readme section in the same way

Before the attachment is permanently deleted from the store, you can restore it.

Go to [How to Restore Deleted Attachment](https://docs.testomat.io/project/tests/test-case-creation-and-editing/#how-to-restore-deleted-attachment) section to read more about this feature.
Go to [How to Restore Deleted Attachment](https://docs.testomat.io/project/tests) section to read more about this feature.

:::note

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ You can create any number of folders and suites within a folder.

## Create Manual Test Cases

Read full article: [Test Case Creation and Editing](https://docs.testomat.io/project/tests/test-case-creation-and-editing/).
Read full article: [Create a Test](https://docs.testomat.io/project/tests/create-a-test).

After you’ve created test suites, you can start adding tests.
1. Select a test suite.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ To create a test case with **Dynamic Parameters** in a markdown file, you need t

:::

For more information about **Dynamic Parameters** follow the [link](https://docs.testomat.io/project/tests/test-case-creation-and-editing/#how-to-add-dynamic-parameters-to-a-test).
For more information about **Dynamic Parameters** follow the [link](https://docs.testomat.io/project/tests).

## How to Import Manual Tests from Markdown

Expand Down
156 changes: 156 additions & 0 deletions src/content/docs/project/tests/converting-to-bdd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
title: Converting to BDD
description: Three ways to move Classical tests into a BDD project in Testomat.io - the Transform Project to BDD AI agent, manual refactoring, and CodeceptJS as a middle ground. Includes a before-and-after refactoring example.
type: article
url: https://docs.testomat.io/project/tests/converting-to-bdd
head:
- tag: meta
attrs:
name: keywords
content: convert to BDD, Transform Project to BDD, AI agent, refactoring tests, Gherkin, CodeceptJS, migrate Classical to BDD, Testomat.io
---

To use a Markdown test as a BDD test, rewrite it as a Gherkin scenario. Changing the project setting alone does not convert the test.

![Three paths from a Classical project: the AI agent and a manual rewrite both build a new BDD project, CodeceptJS keeps you in the same one](./images/converting-to-bdd/three-paths-to-bdd.png)

You have three paths. Two build a new BDD project. The third keeps you in Classical.

| Path | What you end up with | Best when |
| --- | --- | --- |
| **Transform Project to BDD** | A new BDD project, built from your existing tests | You want everything moved quickly and written in one style |
| **Manual refactoring** | A new BDD project, written by your team | The logic is tricky and a person has to make the calls |
| **CodeceptJS** | No new project - you stay Classical | You want tests the business can read, without taking on Gherkin |

## Transform Project to BDD

**Transform Project to BDD** is an AI agent that reads your Classical tests and builds a BDD project out of them.

- It rewrites your steps into valid `Given/When/Then` syntax.
- It creates a **new BDD project** with the converted suites.
- Your original Classical project stays as it is.

Nothing is overwritten, so you can review the result. To run it:

1. On the **Tests** page, open the `...` menu.
2. Choose **AI Agents**.
3. Select **Transform Project to BDD**.

![The AI Agents list open, with Transform Project to BDD in it](./images/converting-to-bdd/1-transform-project-to-bdd.png)

The agent stays close to your original wording. A Classical step that did two things comes out as one line:

```gherkin
Scenario: Successful login with valid credentials
Given the user is on the Testomat.io login page
When the user enters a registered email and the correct password
Then the user should be redirected to the Project Dashboard
```

![The new BDD project created by the agent, next to the original Classical one](./images/converting-to-bdd/2-new-bdd-project.png)

This `When` line does two things at once, so no other scenario can reuse it.

:::note

Read more about the agents on the [AI-Agents](https://docs.testomat.io/advanced/ai-powered-features/ai-agents) page.

:::

## Manual Refactoring

Rewrite the tests yourself when a few of them carry logic only the author understands.

1. Create a new BDD project.
2. Rewrite each test so every step follows Gherkin rules.
3. Split any step that does more than one thing.
4. Match each new step to a step definition in your automation code.

Writing it yourself, you split that step:

```gherkin
Scenario: Successful login with valid credentials
Given the user is on the Testomat.io login page
When the user enters a registered email
And the user enters the correct password
Then the user should be redirected to the Project Dashboard
```

Every line here is a step definition other scenarios can call. To make the process faster you can:

- Split steps land in the [Steps Database](https://docs.testomat.io/project/steps-snippets/steps), so autocomplete offers them next time.
- If the Gherkin is not valid yet, **Save To Draft & View Test** keeps your work.

:::note

A BDD project cannot be moved back to Classical. The feature file history and its data would be lost.

:::

## CodeceptJS

If you just want your tests to be easy to read, you do not need to switch to BDD. CodeceptJS uses simple instructions that are easy for everyone on the team to follow. You can keep your current project without rewriting your tests or learning a new format.

The main difference is who the tests are written for. Gherkin scenarios are written in a way that both the team and the business can understand and review before the code is written. CodeceptJS is still code, just written in a way that is easier to read.

## Check the Converted Tests

Four things are worth checking after a conversion, whether the AI agent did the work or your team did.

**One action per step.** `Enter a registered email and the correct password` does two things at once, split it:

```gherkin
When the user enters a registered email
And the user enters the correct password
```

**The goal.** `Hit the blue 'Sign In' button at the bottom of the form` names the colour and the position. The next redesign makes both wrong. Redo:

```gherkin
When the user clicks the 'Sign In' button
```

**A clear starting point.** A Classical test often jumps straight in, assuming the user is already on the right page. BDD code has to know where the scenario begins, and scenarios that say so fail less often for the wrong reason.

```gherkin
Given the user is on the Testomat.io login page
```

**Valid syntax.** `Expected Result:` - in BDD the line has to carry a keyword and correct wording:

```gherkin
Then the user should be redirected to the Project Dashboard
```

## Connect to Code

A rewritten scenario is not finished until every step has a definition in your automation code. Import your feature files to make the connection.

1. On the **Tests** page, click **Import from other TMS**.
2. On the **Imports** page, click **Import**.
3. Select **Import from Source Code**.
4. Pick **Cucumber** as the framework.
5. Copy the command you are given.
6. Run it in your project folder:

```bash
TESTOMATIO={apiKey} npx check-cucumber@latest "**/*.feature" --dir features
```

7. Refresh the page. The imported feature files appear in the test tree.

![The import screen with Cucumber selected as the framework](./images/converting-to-bdd/3-import-cucumber.png)

:::note

The command needs **NodeJS 10+** with NPM. It looks in the `features` folder by default - change `--dir` if your feature files live somewhere else.

:::

See [Import Tests From Cucumber](https://docs.testomat.io/project/import-export/import/import-tests-from-cucumber) for the full guide.

## Next Steps

- [Classical vs BDD](https://docs.testomat.io/project/tests/classical-vs-bdd)
- [BDD Test Case Editor](https://docs.testomat.io/project/tests/bdd-test-case-editor#bdd-editor)
- [AI-Agents](https://docs.testomat.io/advanced/ai-powered-features/ai-agents)
80 changes: 80 additions & 0 deletions src/content/docs/project/tests/create-a-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
title: Create a Test
description: Create tests in Testomat.io from a full description, a title, or a list of titles.
type: article
url: https://docs.testomat.io/project/tests/create-a-test
head:
- tag: meta
attrs:
name: keywords
content: create a test, new test, test case creation, quick test creation, bulk create tests, save options, test editor, Testomat.io
---

When you start a new project, choose **Create a new suite** to add tests manually. To add tests tou haw 3 possibilities:

- write the test and its description,
- create test with the title only,
- create several tests in a bulk.

![Three ways to create a test: a full test with a description, a quick test from a title, and a bulk list](./images/create-test/create-test-ways.png)

You can also import automated tests from source code or a CSV file. See [Import tests](https://docs.testomat.io/project/import-export/import/import-tests-from-source-code).

![The three start options on a new project: create a suite, import from source code, import from CSV](./images/create-test/1-new-project.png)

## Add a New Test

1. Go to the **Tests** page.
2. Open a suite or create one.
3. Click **New Test**.
4. Enter the test title.
5. Add the preconditions, steps, and expected results.
6. Click **Save**.

![The test editor with the title field filled in and a description below it](./images/create-test/2-test-editor.png)

The test appears in the tree in its suite. New tests are marked **manual**.

See [Steps Database](https://docs.testomat.io/project/steps-snippets/steps) for examples of how to structure the test.

## Quick Test Creation

Enter only the titles when you have ideas for tests and want to add them quickly to the list. You can add the description, steps, and other details later.

1. Open a suite.
2. Enter the test title.
3. Click **Create**.

![Creating a test straight from the title field with the Create button](./images/create-test/3-quick-create-test.png)

Open test to add the details.

## Create Tests in a Bulk

1. Open a suite or create one.
2. Turn on the **Bulk** toggle.
3. Enter one test title per line.
4. Click **Create**.

Each written title in a line becomes a separate test in the suite. It is similar to the **Quick Test Creation** but a bit in other way. This is useful when you want to create the tests first and add description later.

You can also use [keyboard shortcuts](https://docs.testomat.io/usage/keyboard-shortcuts/) to create and edit tests and suites.

## Save a Test

All four save options save your changes. Choose one based on what you want to do next.

| Option | Result |
| --- | --- |
| **Save** | Saves the test and keeps it open. |
| **Save + View Test** | Saves the test and opens it in view mode. |
| **Save + Go To Suite** | Saves the test and returns to the suite. |
| **Save + Close All** | Saves the test and closes all open tests and suites. |

![The save button with its dropdown showing the four save options](./images/create-test/4-save-test-options.png)

## Next Steps

- [Classical Test Case Editor](https://docs.testomat.io/project/tests/classical-test-case-editor)
- [Steps Database](https://docs.testomat.io/project/steps-snippets/steps)
- [Tags](https://docs.testomat.io/advanced/tags-labels/tags)
Loading
Loading