Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ npm-debug.log*
*storybook.log
storybook-static
tmp
.testplane
!exports
30 changes: 30 additions & 0 deletions clone-testplane.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');

const LOCAL = process.env.LOCAL ?? false;
const LOCAL_REPO_DIR = process.env.LOCAL_REPO_DIR;
const REPO_PATH = process.env.REPO_PATH ?? "https://github.com/gemini-testing/testplane";

const tempDir = path.join(__dirname, '.testplane');

if (fs.existsSync(tempDir)) {
fs.rmSync(tempDir, { recursive: true });
}

if (LOCAL) {
// Create a symlink to the local repo
execSync(`cp -r ${LOCAL_REPO_DIR}/. ${tempDir}`);
console.log(`Copied local testplane repo from ${LOCAL_REPO_DIR} to ${tempDir}`);
} else {
fs.mkdirSync(tempDir);

// Clone repo to temp
execSync(`git clone ${REPO_PATH} ${tempDir}`);
process.chdir(tempDir);

// Run npm ci to install dependencies
execSync('npm ci', { stdio: 'inherit' });

console.log(`Cloned remote testplane repo to ${tempDir}`);
}
74 changes: 74 additions & 0 deletions docs/api-reference/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# testplane

## Classes

| Class | Description |
| ------ | ------ |
| [AbortOnReconnectError](classes/AbortOnReconnectError.mdx) | - |
| [AssertViewError](classes/AssertViewError.mdx) | - |
| [CancelledError](classes/CancelledError.mdx) | - |
| [ClientBridgeError](classes/ClientBridgeError.mdx) | - |
| [Config](classes/Config.mdx) | - |
| [CoreError](classes/CoreError.mdx) | - |
| [HeightViewportError](classes/HeightViewportError.mdx) | Height of the element is larger than viewport |
| [ImageDiffError](classes/ImageDiffError.mdx) | - |
| [NoRefImageError](classes/NoRefImageError.mdx) | - |
| [OffsetViewportError](classes/OffsetViewportError.mdx) | Position of an element is outside of a viewport left, top or right bounds |
| [Suite](classes/Suite.mdx) | - |
| [Test](classes/Test.mdx) | - |
| [TestCollection](classes/TestCollection.mdx) | - |
| [Testplane](classes/Testplane.mdx) | - |
| [TestplaneInternalError](classes/TestplaneInternalError.mdx) | - |

## Interfaces

| Interface | Description |
| ------ | ------ |
| [AfterFileReadData](interfaces/AfterFileReadData.mdx) | - |
| [AssertViewOpts](interfaces/AssertViewOpts.mdx) | - |
| [AssertViewOptsConfig](interfaces/AssertViewOptsConfig.mdx) | - |
| [AssertViewResultDiff](interfaces/AssertViewResultDiff.mdx) | - |
| [AssertViewResultNoRefImage](interfaces/AssertViewResultNoRefImage.mdx) | - |
| [AssertViewResultSuccess](interfaces/AssertViewResultSuccess.mdx) | - |
| [BeforeFileReadData](interfaces/BeforeFileReadData.mdx) | - |
| [BrowserHistory](interfaces/BrowserHistory.mdx) | - |
| [BrowserInfo](interfaces/BrowserInfo.mdx) | - |
| [BuildDiffOptsConfig](interfaces/BuildDiffOptsConfig.mdx) | - |
| [CommandHistory](interfaces/CommandHistory.mdx) | - |
| [CommonConfig](interfaces/CommonConfig.mdx) | - |
| [CompareOptsConfig](interfaces/CompareOptsConfig.mdx) | - |
| [DiffOptions](interfaces/DiffOptions.mdx) | - |
| [ErrorDetails](interfaces/ErrorDetails.mdx) | - |
| [ExecutionThreadToolCtx](interfaces/ExecutionThreadToolCtx.mdx) | - |
| [ExpectOptsConfig](interfaces/ExpectOptsConfig.mdx) | - |
| [GlobalHelper](interfaces/GlobalHelper.mdx) | - |
| [HermioneCtx](interfaces/HermioneCtx.mdx) | - |
| [ImageBase64](interfaces/ImageBase64.mdx) | - |
| [ImageInfo](interfaces/ImageInfo.mdx) | - |
| [ImageSize](interfaces/ImageSize.mdx) | - |
| [InterceptData](interfaces/InterceptData.mdx) | - |
| [MochaOpts](interfaces/MochaOpts.mdx) | - |
| [ReadTestsOpts](interfaces/ReadTestsOpts.mdx) | - |
| [RefImageInfo](interfaces/RefImageInfo.mdx) | - |
| [RootSuite](interfaces/RootSuite.mdx) | - |
| [RunOpts](interfaces/RunOpts.mdx) | - |
| [SetsConfig](interfaces/SetsConfig.mdx) | - |
| [SystemConfig](interfaces/SystemConfig.mdx) | - |
| [TestError](interfaces/TestError.mdx) | - |
| [TestFunctionCtx](interfaces/TestFunctionCtx.mdx) | - |
| [TestResult](interfaces/TestResult.mdx) | - |
| [TestResultWithRetries](interfaces/TestResultWithRetries.mdx) | - |
| [TestplaneCtx](interfaces/TestplaneCtx.mdx) | - |

## Type Aliases

| Type alias | Description |
| ------ | ------ |
| [AssertViewResult](type-aliases/AssertViewResult.mdx) | - |
| [AsyncSessionEventCallback](type-aliases/AsyncSessionEventCallback.mdx) | - |
| [ConfigInput](type-aliases/ConfigInput.mdx) | - |
| [InterceptHandler](type-aliases/InterceptHandler.mdx) | - |
| [InterceptedEvent](type-aliases/InterceptedEvent.mdx) | - |
| [MasterEventHandler](type-aliases/MasterEventHandler.mdx) | - |
| [SyncSessionEventCallback](type-aliases/SyncSessionEventCallback.mdx) | - |
| [WorkerEventHandler](type-aliases/WorkerEventHandler.mdx) | - |
35 changes: 35 additions & 0 deletions docs/api-reference/classes/AbortOnReconnectError.mdx
Copy link
Member

Choose a reason for hiding this comment

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

Nice to have: is it possible to group all error classes in one group in the left sidebar?

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[testplane](../README.mdx) / AbortOnReconnectError

# Class: AbortOnReconnectError

## Extends

- `Error`

## Constructors

### new AbortOnReconnectError()

```ts
new AbortOnReconnectError(): AbortOnReconnectError
```

#### Returns

[`AbortOnReconnectError`](AbortOnReconnectError.mdx)

#### Overrides

`Error.constructor`

#### Defined in

[src/errors/abort-on-reconnect-error.ts:2](https://github.com/gemini-testing/testplane/blob/57d0b182c37e21d8bdf52acbb137a028841767af/src/errors/abort-on-reconnect-error.ts#L2)

## Properties

| Property | Type | Inherited from | Defined in |
| ------ | ------ | ------ | ------ |
| `message` | `string` | `Error.message` | ../node\_modules/typescript/lib/lib.es5.d.ts:1077 |
| `name` | `string` | `Error.name` | ../node\_modules/typescript/lib/lib.es5.d.ts:1076 |
| `stack?` | `string` | `Error.stack` | ../node\_modules/typescript/lib/lib.es5.d.ts:1078 |
41 changes: 41 additions & 0 deletions docs/api-reference/classes/AssertViewError.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[testplane](../README.mdx) / AssertViewError

# Class: AssertViewError

## Extends

- `Error`

## Constructors

### new AssertViewError()

```ts
new AssertViewError(message): AssertViewError
```

#### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `message` | `string` | `"image comparison failed"` |

#### Returns

[`AssertViewError`](AssertViewError.mdx)

#### Overrides

`Error.constructor`

#### Defined in

[src/browser/commands/assert-view/errors/assert-view-error.ts:2](https://github.com/gemini-testing/testplane/blob/57d0b182c37e21d8bdf52acbb137a028841767af/src/browser/commands/assert-view/errors/assert-view-error.ts#L2)

## Properties

| Property | Modifier | Type | Default value | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
| `message` | `public` | `string` | `"image comparison failed"` | `Error.message` | [src/browser/commands/assert-view/errors/assert-view-error.ts:2](https://github.com/gemini-testing/testplane/blob/57d0b182c37e21d8bdf52acbb137a028841767af/src/browser/commands/assert-view/errors/assert-view-error.ts#L2) |
| `name` | `public` | `string` | `undefined` | `Error.name` | ../node\_modules/typescript/lib/lib.es5.d.ts:1076 |
| `stack?` | `public` | `string` | `undefined` | `Error.stack` | ../node\_modules/typescript/lib/lib.es5.d.ts:1078 |
35 changes: 35 additions & 0 deletions docs/api-reference/classes/CancelledError.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[testplane](../README.mdx) / CancelledError

# Class: CancelledError

## Extends

- `Error`

## Constructors

### new CancelledError()

```ts
new CancelledError(): CancelledError
```

#### Returns

[`CancelledError`](CancelledError.mdx)

#### Overrides

`Error.constructor`

#### Defined in

[src/browser-pool/cancelled-error.ts:5](https://github.com/gemini-testing/testplane/blob/57d0b182c37e21d8bdf52acbb137a028841767af/src/browser-pool/cancelled-error.ts#L5)

## Properties

| Property | Type | Default value | Overrides | Inherited from | Defined in |
| ------ | ------ | ------ | ------ | ------ | ------ |
| `message` | `string` | `"Browser request was cancelled"` | `Error.message` | - | [src/browser-pool/cancelled-error.ts:3](https://github.com/gemini-testing/testplane/blob/57d0b182c37e21d8bdf52acbb137a028841767af/src/browser-pool/cancelled-error.ts#L3) |
| `name` | `string` | `"CancelledError"` | `Error.name` | - | [src/browser-pool/cancelled-error.ts:2](https://github.com/gemini-testing/testplane/blob/57d0b182c37e21d8bdf52acbb137a028841767af/src/browser-pool/cancelled-error.ts#L2) |
| `stack?` | `string` | `undefined` | - | `Error.stack` | ../node\_modules/typescript/lib/lib.es5.d.ts:1078 |
41 changes: 41 additions & 0 deletions docs/api-reference/classes/ClientBridgeError.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[testplane](../README.mdx) / ClientBridgeError

# Class: ClientBridgeError

## Extends

- `Error`

## Constructors

### new ClientBridgeError()

```ts
new ClientBridgeError(message): ClientBridgeError
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `message` | `string` |

#### Returns

[`ClientBridgeError`](ClientBridgeError.mdx)

#### Overrides

`Error.constructor`

#### Defined in

[src/browser/client-bridge/error.ts:2](https://github.com/gemini-testing/testplane/blob/57d0b182c37e21d8bdf52acbb137a028841767af/src/browser/client-bridge/error.ts#L2)

## Properties

| Property | Type | Inherited from | Defined in |
| ------ | ------ | ------ | ------ |
| `message` | `string` | `Error.message` | ../node\_modules/typescript/lib/lib.es5.d.ts:1077 |
| `name` | `string` | `Error.name` | ../node\_modules/typescript/lib/lib.es5.d.ts:1076 |
| `stack?` | `string` | `Error.stack` | ../node\_modules/typescript/lib/lib.es5.d.ts:1078 |
Loading