Skip to content

Commit

Permalink
Register API doc
Browse files Browse the repository at this point in the history
  • Loading branch information
flaurida committed Mar 9, 2020
1 parent f789bae commit c2e041b
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 3 deletions.
24 changes: 24 additions & 0 deletions docs/docs/api/components/qawolf/ArgumentRegister.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import Argument from '../Argument';

function ArgumentRegister() {
return (
<React.Fragment>
<Argument
description={
<React.Fragment>
The{' '}
<a href="https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browsercontext">
Playwright <code>BrowserContext</code>
</a>{' '}
instance.
</React.Fragment>
}
name="context"
type="BrowserContext"
/>
</React.Fragment>
);
}

export default ArgumentRegister;
2 changes: 1 addition & 1 deletion docs/docs/api/environment_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Video is only supported on Chromium. We are waiting for Playwright to add suppor

If [FFmpeg](https://www.ffmpeg.org) is not installed, videos will not be included. Install [`ffmpeg-static`](https://www.npmjs.com/package/ffmpeg-static) as a dependency or set the `FFMPEG_PATH` environment variable.

Note that your code must call [`qawolf.register`](TODOFIXLINK) for artifacts to be saved.
Note that your code must call [`qawolf.register`](qawolf/register) for artifacts to be saved.

#### Examples

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/qawolf/create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Converts your browser actions to code. Call `create` in a code file to insert ne

### Examples

Create new code in an existing file, after calling [`qawolf.register(context)`](TODOFIXLINK) to register a [Playwright `BrowserContext`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browsercontext) instance:
Create new code in an existing file, after calling [`qawolf.register(context)`](register) to register a [Playwright `BrowserContext`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browsercontext) instance:

```js
const qawolf = require('qawolf');
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/api/qawolf/register.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
id: register
sidebar_label: register
title: qawolf.register
---

import ArgumentRegister from '../components/qawolf/ArgumentRegister';
import ReturnVoid from '../components/qawolf/ReturnVoid';
import Syntax from '../components/Syntax';

<Syntax code="register(context)" />

Allow QA Wolf to access the specified [Playwright `BrowserContext`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browsercontext) instance. This enables the [default selector logic](../../use_custom_selectors#default-selector-logic) to work. It also automatically creates [debug artifacts](../../run_tests_in_ci#debug) for your tests and scripts.

### Arguments

<ArgumentRegister />

### Returns

<ReturnVoid />

### Examples

Give QA Wolf access to the [Playwright `BrowserContext`](https://github.com/microsoft/playwright/blob/master/docs/api.md#class-browsercontext) instance that your test or script is running against.

```js
const qawolf = require('qawolf');
// ...
qawolf.register(context);
```
2 changes: 2 additions & 0 deletions docs/docs/api/table_of_contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ In addition to the APIs below, you have full access to the [Playwright API](http

[launch](qawolf/launch)

[register](qawolf/register)

[repl](qawolf/repl)

## class: BrowserContext
Expand Down
7 changes: 6 additions & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ module.exports = {
{
type: 'category',
label: 'module: qawolf',
items: ['api/qawolf/create', 'api/qawolf/launch', 'api/qawolf/repl'],
items: [
'api/qawolf/create',
'api/qawolf/launch',
'api/qawolf/register',
'api/qawolf/repl',
],
},
{
type: 'category',
Expand Down

0 comments on commit c2e041b

Please sign in to comment.