Skip to content

Commit

Permalink
fixed internal links
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Mar 22, 2024
1 parent 1ddecb5 commit 84073c5
Show file tree
Hide file tree
Showing 89 changed files with 329 additions and 217 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Deploy

on:
push:
branches:
- 'preview'
- 'versions/3.0-complete'

jobs:
build:
runs-on: ubuntu-latest
env:
BASE_URL: https://dev.nightwatchjs.org
REMOTE_SERVER: ${{ secrets.REMOTE_SERVER }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
API_DOCS_FOLDER: ${{ github.workspace }}/nightwatch/lib/api

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Checkout Nightwatch source code
uses: actions/checkout@v2
with:
repository: nightwatchjs/nightwatch
path: nightwatch

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Build the website
run: npm run build

- name: Creating symlinks to old version
run: |
ln -s ../nightwatchjs.org out/v17
ln -s ../v09.nightwatchjs.org out/v09
ln -s ../nightwatch-v26 out/v26
- name: Deploy to server
run: |
mkdir -p ~/.ssh
echo "${{ secrets.PROD_DEPLOY_SECRET }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan ${{ env.REMOTE_SERVER }} >> ~/.ssh/known_hosts
rsync -azP --delete ./out/ ${{ env.REMOTE_USER }}@${{ env.REMOTE_SERVER }}:${{ secrets.REMOTE_PREVIEW_DIRECTORY }}
67 changes: 64 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Nightwatch Documentation
# Nightwatch.js Documentation

Documentation sources for [nightwatchjs.org](http://nightwatchjs.org) website.

Expand All @@ -10,12 +10,73 @@ Documentation sources for [nightwatchjs.org](http://nightwatchjs.org) website.
[![Twitter Follow](https://img.shields.io/twitter/follow/nightwatchjs.svg?style=social)](https://twitter.com/nightwatchjs)

<p align="center">
<img alt="Nightwatch.js Schematic Logo" src="https://raw.githubusercontent.com/nightwatchjs/nightwatch/f214d79b3f7d0cf7602a6b57823420baaa3b5282/.github/assets/nightwatch-logo.svg" width=300 />
<img alt="Nightwatch.js Logo" src="https://raw.githubusercontent.com/nightwatchjs/nightwatch/main/.github/assets/nightwatch-logo.png" width=300 />
</p>

#### [Homepage](https://nightwatchjs.org) &bullet; [Getting Started](https://nightwatchjs.org/gettingstarted) &bullet; [Developer Guide](https://nightwatchjs.org/guide) &bullet; [API Reference](https://nightwatchjs.org/api) &bullet; [About](https://nightwatchjs.org/about)
#### [Homepage](https://nightwatchjs.org) &bullet; [Developer Guide](https://nightwatchjs.org/guide) &bullet; [API Reference](https://nightwatchjs.org/api) &bullet; [About](https://nightwatchjs.org/about) &bullet; [Blog](https://nightwatchjs.org/blog)

***

## Development

The docs content is written in Markdown and it is located in the `docs` folder. The individual API command pages are generated from the Nightwatch source code. based on the JSDoc comments.

### Run the website locally

The website is built with **PostDoc** (a static site generator built with Vite and EJS). It supports Markdown, EJS, and front matter.
It comes with a dev server with Hot module replacement (HMR).

### Configuration

The website configuration is located in the `postdoc.config.js` file. In order to run the website locally, you need to have the Nightwatch source code repo clones and then specify the path to it in the `postdoc.config.js` file.

You can also set the `API_DOCS_FOLDER` environment variable to specify the path. You can also disable the API docs generation by setting the `apidocs` property to `false` in the `postdoc.config.js` file, e.g.:

```js
export default {
apidocs: false
}
```

### Installation

```bash
npm install
npm start
```

### PostDoc CLI

To view the available options, run:

```bash
npx postdoc --help
```

#### Automatically open the website in the browser

```bash
npm start -- --open [chrome|firefox|edge|safari]
```

## Build

To build the website, run:

```bash
npm run build
```

The generated files will be in the `out` folder.

Quickly serve the generated files with:

```bash
npx postdoc preview
```

## License
MIT

[discord-badge]: https://img.shields.io/discord/618399631038218240.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square
[discord]: https://discord.gg/SN8Da2X
6 changes: 3 additions & 3 deletions docs/guide/concepts/page-object-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ Nightwatch will call the command on the context of the page or section. Client c
From Nightwatch 2 it is also possible to export the page commands as an ES6 class.

### Recommended content
- [Define page elements](https://nightwatchjs.org/guide/using-page-objects/defining-elements.html)
- [Define sections](https://nightwatchjs.org/guide/using-page-objects/defining-sections.html)
- [Add page-specific commands](https://nightwatchjs.org/guide/using-page-objects/writing-page-specific-commands.html)
- [Define page elements](/guide/using-page-objects/defining-elements.html)
- [Define sections](/guide/using-page-objects/defining-sections.html)
- [Add page-specific commands](/guide/using-page-objects/writing-page-specific-commands.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/concepts/parallel-testing-in-nightwatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ It is very useful to be able to run your tests against multiple browsers in para
From **v1.7** you are able to do just that.

### Recommended content
- [Define and use test environments](https://nightwatchjs.org/guide/configuration/define-test-environments.html)
- [How-to guide > Run tests in parallel](https://nightwatchjs.org/guide/running-tests/parallel-running.html)
- [Define and use test environments](/guide/configuration/define-test-environments.html)
- [How-to guide > Run tests in parallel](/guide/running-tests/parallel-running.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/concepts/test-globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ myGlobalVar is: "integrated global"
```

### Recommended content
- [Use external globals in tests](https://nightwatchjs.org/guide/writing-tests/using-test-globals.html)
- [Use global test hooks in tests](https://nightwatchjs.org/guide/writing-tests/global-test-hooks.html)
- [Use external globals in tests](/guide/writing-tests/using-test-globals.html)
- [Use global test hooks in tests](/guide/writing-tests/global-test-hooks.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/configuration/advanced-test-source-filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ The below settings can be used to define ways of filtering test files.
</table>

### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
14 changes: 7 additions & 7 deletions docs/guide/configuration/aws-devicefarm-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ module.exports = (async function() {
// if this is not specified, the test source must be passed as the second argument to the test runner.
src_folders: [],
<br>
// See https://nightwatchjs.org/guide/working-with-page-objects/using-page-objects.html
// See /guide/working-with-page-objects/using-page-objects.html
page_objects_path: ['node_modules/nightwatch/examples/pages/'],
<br>
// See https://nightwatchjs.org/guide/extending-nightwatch/custom-commands.html
// See /guide/extending-nightwatch/custom-commands.html
custom_commands_path: ['node_modules/nightwatch/examples/custom-commands/'],
<br>
// See https://nightwatchjs.org/guide/extending-nightwatch/custom-assertions.html
// See /guide/extending-nightwatch/custom-assertions.html
custom_assertions_path: '',
<br>
// See https://nightwatchjs.org/guide/extending-nightwatch/plugin-api.html
// See /guide/extending-nightwatch/plugin-api.html
plugins: [],
<br>
// See https://nightwatchjs.org/guide/#external-globals
// See /guide/#external-globals
globals_path : '',
<br>
webdriver: {},
Expand Down Expand Up @@ -102,8 +102,8 @@ module.exports = (async function() {
[1]: https://aws.amazon.com/device-farm/

### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/configuration/browser-stack-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ You can specify proxy settings in Nightwatch by adding the `proxy` key in your `

### Recommended content

- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/configuration/customising-test-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ The below settings can be used to control the output and logging when running te
</table>

### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/configuration/define-test-environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ OK. 1 assertions passed. (5.604s)
```

### Recommended content
- [Concepts > Test environments](https://nightwatchjs.org/guide/concepts/test-environments.html)
- [Concepts > Test environments](/guide/concepts/test-environments.html)
- [Reference > Browser Drivers > ChormeDriver](/guide/configuration/define-test-environments.html)
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/configuration/nightwatch-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Nightwatch test runner binary expects a configuration file located in the cu
- `nightwatch.conf.ts` (when using TypeScript)
- `nightwatch.json`

You can always specify a config file location via the `--config` CLI argument. Read more about CLI options on the [Reference > Nightwatch CLI](https://nightwatchjs.org/guide/nightwatch-cli/command-line-options.html) page.
You can always specify a config file location via the `--config` CLI argument. Read more about CLI options on the [Reference > Nightwatch CLI](/guide/nightwatch-cli/command-line-options.html) page.

<div class="alert alert-info">
From Nightwatch 2, you can also specify the config file to return a Promise and the result will be <code>await</code>-ed.
Expand Down Expand Up @@ -67,8 +67,8 @@ The following packages can be used from NPM and, if installed, Nightwatch will a


### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
8 changes: 4 additions & 4 deletions docs/guide/configuration/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Considering this setup, to run tests, for instance, against Safari, we would run

<pre><code class="language-bash">nightwatch --env safari</code></pre>

Refer to the [Defining Test Environments](https://nightwatchjs.org/guide/using-nightwatch/concepts.html#defining-test-environments) page to learn more about how to use test environments.
Refer to the [Defining Test Environments](/guide/using-nightwatch/concepts.html#defining-test-environments) page to learn more about how to use test environments.

### Working with Test Globals
Another useful concept that Nightwatch provides is test globals. In its most simple form, it is a dictionary of name-value pairs which is defined in your configuration file.
Expand Down Expand Up @@ -141,7 +141,7 @@ Like the `launch_url` property, the `globals` object is made available directly
};</code></pre>
</div>

Refer to the [Using Test Globals](https://nightwatchjs.org/guide/using-nightwatch/concepts.html#using-test-globals) page to learn more about how to use test globals.
Refer to the [Using Test Globals](/guide/using-nightwatch/concepts.html#using-test-globals) page to learn more about how to use test globals.

### Using Env variables
Any config value in either `nightwatch.conf.js` or `nightwatch.json` can be specified as the name of an environment variables. Nightwatch will automatically populate the value, if found, from `process.env`.
Expand Down Expand Up @@ -215,5 +215,5 @@ Assuming you have downloaded or installed the ChromeDriver service, the simplest
[4]: https://www.npmjs.com/package/selenium-server

### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)
4 changes: 2 additions & 2 deletions docs/guide/configuration/selenium-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ The following **NPM** packages are assumed to be installed in the current projec

### Recommended content

- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/configuration/taking-screenshots-on-fail.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ To enable screenshots for test failures/errors, set the `screenshots` property i


### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Here's an example from the generated `nightwatch.conf.js`:


### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/configuration/using-test-globals-in-your-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ Like the `launch_url` property, the `globals` object is made available directly


### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)
4 changes: 2 additions & 2 deletions docs/guide/configuration/web-driver-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ If you'd like to enable this, set `start_process` to `true` and specify the loca


### Recommended content
- [Reference > All configuration settings](https://nightwatchjs.org/guide/reference/settings.html)
- [Reference > Configuration defaults](https://nightwatchjs.org/guide/reference/defaults.html)
- [Reference > All configuration settings](/guide/reference/settings.html)
- [Reference > Configuration defaults](/guide/reference/defaults.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/contributing/codeofconduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ directly on top of `dev`.
For making changes to the documentation site, go to the `/guide` folder. Each section on the left
navigation pane is a separate folder. Use the following resources to learn about different on-page markdown elements and the style guide that we use.

* [Markdown elements](https://nightwatchjs.org/guide/contributing/overview.html)
* [Style guide](https://nightwatchjs.org/guide/contributing/styleguide.html)
* [Markdown elements](/guide/contributing/overview.html)
* [Style guide](/guide/contributing/styleguide.html)


### Step 4: Commit
Expand Down
8 changes: 4 additions & 4 deletions docs/guide/debugging-tests/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ Starting with v2.3.0, Nightwatch presents a more powerful test script debugging

#### Updated .pause() command

The [`.pause()`](https://nightwatchjs.org/api/pause.html) command now provides the ability to resume paused tests on-demand while debugging. In addition, users can also step over to the next test step (execute the next test step) and pause again.
The [`.pause()`](/api/pause.html) command now provides the ability to resume paused tests on-demand while debugging. In addition, users can also step over to the next test step (execute the next test step) and pause again.

#### New .debug() command

The new [`.debug()`](https://nightwatchjs.org/api/debug.html) command provides a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) interface where users can try out any of the available Nightwatch commands or assertions and see them get executed in the running browser, in real-time.
The new [`.debug()`](/api/debug.html) command provides a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) interface where users can try out any of the available Nightwatch commands or assertions and see them get executed in the running browser, in real-time.

<iframe src="https://player.vimeo.com/video/732086808?loop=1&byline=0&portrait=0&title=0" style="width:100%;height:560px" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>

### Recommended content
- [API docs > `.pause()`](https://nightwatchjs.org/api/pause.html)
- [API docs > `.debug()`](https://nightwatchjs.org/api/debug.html)
- [API docs > `.pause()`](/api/pause.html)
- [API docs > `.debug()`](/api/debug.html)

<div class="doc-pagination pt-40">
<div class="previous">
Expand Down
Loading

0 comments on commit 84073c5

Please sign in to comment.