Skip to content

Commit 4b93a45

Browse files
authored
Merge website code from nightwatch-www repo (#288)
* Added website files * fixed internal links
1 parent 31ba9d3 commit 4b93a45

File tree

613 files changed

+38345
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

613 files changed

+38345
-225
lines changed

.github/workflows/deploy-preview.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- 'preview'
7+
- 'versions/3.0-complete'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
env:
13+
BASE_URL: https://dev.nightwatchjs.org
14+
REMOTE_SERVER: ${{ secrets.REMOTE_SERVER }}
15+
REMOTE_USER: ${{ secrets.REMOTE_USER }}
16+
API_DOCS_FOLDER: ${{ github.workspace }}/nightwatch/lib/api
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Checkout Nightwatch source code
23+
uses: actions/checkout@v2
24+
with:
25+
repository: nightwatchjs/nightwatch
26+
path: nightwatch
27+
28+
- name: Use Node.js
29+
uses: actions/setup-node@v2
30+
with:
31+
node-version: '18'
32+
33+
- name: Install dependencies
34+
run: npm install
35+
36+
- name: Build the website
37+
run: npm run build
38+
39+
- name: Creating symlinks to old version
40+
run: |
41+
ln -s ../nightwatchjs.org out/v17
42+
ln -s ../v09.nightwatchjs.org out/v09
43+
ln -s ../nightwatch-v26 out/v26
44+
45+
- name: Deploy to server
46+
run: |
47+
mkdir -p ~/.ssh
48+
echo "${{ secrets.PROD_DEPLOY_SECRET }}" > ~/.ssh/id_rsa
49+
chmod 600 ~/.ssh/id_rsa
50+
ssh-keyscan ${{ env.REMOTE_SERVER }} >> ~/.ssh/known_hosts
51+
rsync -azP --delete ./out/ ${{ env.REMOTE_USER }}@${{ env.REMOTE_SERVER }}:${{ secrets.REMOTE_PREVIEW_DIRECTORY }}

.gitignore

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,23 @@
22
node_modules
33
.idea
44
*.plist
5+
.idea/
6+
.vscode/
57

6-
api/**/*.ejs
8+
# Dependency directories
9+
node_modules/
10+
logs
11+
12+
# Postdoc output directory
13+
out/
14+
output/
15+
16+
# dotenv environment variables file
17+
.env
18+
.env.local
19+
20+
# Nightwatch output directory
21+
tests_output
22+
/public/__examples/
23+
package-lock.json
24+
.pd*

README.md

Lines changed: 64 additions & 3 deletions

build/optimize.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import {generate} from 'critical';
2+
import {minify} from 'html-minifier';
3+
import {readFileSync, writeFileSync} from 'fs';
4+
import path from 'path';
5+
6+
// Inline critical CSS
7+
generate({
8+
inline: true,
9+
base: 'out/',
10+
src: 'index.html',
11+
target: {
12+
html: 'index.html',
13+
uncritical: 'css/landing/style.css'
14+
},
15+
dimensions: [
16+
{
17+
height: 200,
18+
width: 500
19+
},
20+
{
21+
height: 900,
22+
width: 1024
23+
},
24+
{
25+
height: 900,
26+
width: 1400
27+
}
28+
],
29+
// ignore CSS rules
30+
ignoreInlinedStyles: true
31+
}).then(({css, html, uncritical}) => {
32+
console.log('Critical CSS generated', css.length);
33+
console.log('Uncritical CSS generated', uncritical.length);
34+
}).catch(err => {
35+
console.error('Critical CSS generation failed', err);
36+
}).then(() => {
37+
// Minify HTML
38+
const htmlPath = path.resolve('out/index.html');
39+
const htmlContent = readFileSync(htmlPath, 'utf8');
40+
const minifiedHTMLContent = minify(htmlContent, {
41+
collapseWhitespace: true,
42+
collapseInlineTagWhitespace: true,
43+
conservativeCollapse: true,
44+
minifyCSS: true,
45+
minifyJS: true,
46+
removeComments: true,
47+
useShortDoctype: true,
48+
html5: true
49+
});
50+
51+
writeFileSync(htmlPath, minifiedHTMLContent, 'utf8');
52+
console.log('Wrote minified HTML to', htmlPath, minifiedHTMLContent.length);
53+
});
54+

guide/concepts/page-object-model.md renamed to docs/guide/concepts/page-object-model.md

Lines changed: 3 additions & 3 deletions

guide/concepts/parallel-testing-in-nightwatch.md renamed to docs/guide/concepts/parallel-testing-in-nightwatch.md

Lines changed: 2 additions & 2 deletions

guide/concepts/test-globals.md renamed to docs/guide/concepts/test-globals.md

Lines changed: 2 additions & 2 deletions

guide/configuration/advanced-test-source-filtering.md renamed to docs/guide/configuration/advanced-test-source-filtering.md

Lines changed: 2 additions & 2 deletions

guide/configuration/aws-devicefarm-settings.md renamed to docs/guide/configuration/aws-devicefarm-settings.md

Lines changed: 7 additions & 7 deletions

guide/configuration/browser-stack-settings.md renamed to docs/guide/configuration/browser-stack-settings.md

Lines changed: 2 additions & 2 deletions

guide/configuration/customising-test-output.md renamed to docs/guide/configuration/customising-test-output.md

Lines changed: 2 additions & 2 deletions

guide/configuration/define-test-environments.md renamed to docs/guide/configuration/define-test-environments.md

Lines changed: 3 additions & 3 deletions

guide/configuration/nightwatch-configuration-file.md renamed to docs/guide/configuration/nightwatch-configuration-file.md

Lines changed: 3 additions & 3 deletions

guide/configuration/overview.md renamed to docs/guide/configuration/overview.md

Lines changed: 4 additions & 4 deletions

guide/configuration/selenium-settings.md renamed to docs/guide/configuration/selenium-settings.md

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)