8000 Feat/workdir suite enhancements by DavertMik · Pull Request #548 · testomatio/reporter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feat/workdir suite enhancements #548

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

Merged
merged 6 commits into from
Jun 5, 2025
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
23 changes: 22 additions & 1 deletion 10000 .github/workflows/linter-and-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:
linter-and-tests-on-latest-node:
runs-on: ubuntu-latest
name: Linter&tests (latest node)
name: Linter & Tests (latest node)
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -29,6 +29,27 @@ jobs:
- run: npm run test
- run: npm run test:storage

framework-tests:
runs-on: ubuntu-latest
name: Framework Adapter Tests (latest node)
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- run: node -v
- run: npm ci
- run: npm run build

# Install framework dependencies from example directories
- name: Install example dependencies
run: npm run install-example-deps
- name: Install Playwright browsers
run: npx playwright install chromium

# Run framework adapter tests
- run: npm run test:frameworks

tests:
runs-on: ubuntu-latest
needs: linter-and-tests-on-latest-node
Expand Down
8 changes: 8 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ Create test which are not yet exist in a project
TESTOMATIO={API_KEY} TESTOMATIO_CREATE=1 <actual run command>
```

#### `TESTOMATIO_WORKDIR`

Specify a custom working directory for relative file paths in test reports. When tests are created with `TESTOMATIO_CREATE=1`, file paths will be relative to this directory instead of the current working directory.

```
TESTOMATIO={API_KEY} TESTOMATIO_CREATE=1 TESTOMATIO_WORKDIR=/path/to/project <actual run command>
```

#### `TESTOMATIO_SUITE`

Place newly created tests into a specific suite. Can be used on XML import or combined with `TESTOMATIO_CREATE=1`. Suite should be specified by its ID:
Expand Down
61 changes: 61 additions & 0 deletions example/codecept/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# CodeceptJS Example with Testomat.io Reporter

This example demonstrates how to use the Testomat.io reporter with CodeceptJS tests.

## Setup

1. Install dependencies:
```bash
npm install
```

## Running Tests

### Basic test run:
```bash
npm run test:simple
```

### Run with Testomat.io reporter (requires API key):
```bash
TESTOMATIO=your-api-key npm run test:simple
```

### Create tests in Testomat.io:
```bash
TESTOMATIO=your-api-key TESTOMATIO_CREATE=1 npm run test:simple
```

### Use custom working directory for relative paths:
```bash
TESTOMATIO=your-api-key TESTOMATIO_CREATE=1 TESTOMATIO_WORKDIR=/path/to/project npm run test:simple
```

## Test Files

- **simple_test.js**: Basic test scenarios including:
- Passing test with simple assertion
- Failing test with intentional failure

## Configuration

The `codecept.conf.js` is configured to use the Testomat.io reporter through the testomat plugin. Key features:

- **CommonJS**: Uses `module.exports` format for compatibility
- **No Browser Dependencies**: Uses FileSystem helper instead of Puppeteer for simplicity
- **Testomat Plugin**: Configured to use the local adapter

## Package Configuration

The `package.json` is configured as CommonJS (`"type": "commonjs"`) to ensure compatibility with the reporter's ESM format.

## Features Demonstrated

1. **Basic Test Execution**: Simple passing and failing scenarios
2. **Plugin Integration**: Using testomat plugin with CodeceptJS
3. **File Path Handling**: Relative paths for cleaner reporting
4. **Error Handling**: Proper failure reporting

## Note

This example currently demonstrates basic CodeceptJS integration. For advanced features like annotation metadata and debug pipe integration, the CodeceptJS adapter may need additional enhancements to match the Playwright adapter capabilities.
7 changes: 2 additions & 5 deletions example/codecept/codecept.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
Puppeteer: {
url: 'http://localhost',
show: true,
},
// Remove Puppeteer helper to avoid browser dependency
FileSystem: {},
},
include: {
I: './steps_file.js',
Expand All @@ -23,7 +21,6 @@ exports.config = {
testomat: {
enabled: true,
require: '../../lib/adapter/codecept',
apiKey: 'lz8ea4948ud5',
},
},
};
Loading
0