Skip to content

Commit

Permalink
feat: introduce v2 website (microsoft#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunattam authored Nov 15, 2020
1 parent 8dbbd86 commit 6c2d20e
Show file tree
Hide file tree
Showing 18 changed files with 1,208 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/deploy-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy v2 preview

on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v2
with:
repository: microsoft/playwright
path: v2/content-repo
fetch-depth: 0
# The same token is used by the commit action later on
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- uses: actions/setup-node@v1
with:
node-version: '12'
- run: npm install
working-directory: v2

- name: Fetch content (master)
run: node scripts/fetchContent.js
working-directory: v2
env:
SRC_DIR: content-repo/docs
- name: Fetch content (v1.6.1)
run: node scripts/fetchContent.js
working-directory: v2
env:
SRC_DIR: content-repo/docs
VERSION: '1.6.1'

- run: npm run build
working-directory: v2

# Replace gh-pages branch of content-repo
# with the new build
- run: git checkout gh-pages
working-directory: v2/content-repo
- name: Clean existing files
run: rm -rf *
working-directory: v2/content-repo
- run: cp -a build/. content-repo/
- run: git status
working-directory: content-repo

# Push to gh-pages branch of microsoft/playwright
- uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: gh-pages
repository: v2/content-repo
28 changes: 28 additions & 0 deletions v2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# dependencies
/node_modules

# production
/build

# generated files
.docusaurus
.cache-loader

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# contents (generated by scripts)
docs/*
!docs/.gitkeep
versioned_docs/*
versioned_sidebars/*
versions.json
sidebars.js
37 changes: 37 additions & 0 deletions v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# playwright.dev-v2

This website is built using [Docusaurus v2](https://v2.docusaurus.io/). Content is pulled from the microsoft/playwright repo.

## Development

```sh
npm install
npm start
```

### Fetch docs content

1. Clone the content repo (microsoft/playwright) on your disk
1. To setup content from master (`next` version)

```sh
SRC_DIR=path-to-playwright-repo/docs node scripts/fetchContent.js
```

1. To setup content for a particular version (say v1.6.0)

```sh
SRC_DIR=path-to-playwright-repo/docs VERSION=1.6.0 node scripts/fetchContent.js
```

The docs are versioned so multiple versions can co-exist.

## Build

```sh
npm run build
```

## Deployment

See [GitHub Action](../.github/workflows/deploy-v2.yml) for deployment to [preview link](https://microsoft.github.io/playwright).
3 changes: 3 additions & 0 deletions v2/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
21 changes: 21 additions & 0 deletions v2/blog/2019-05-29-hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
slug: hello-world
title: Playwright 1.6
# author: Endilie Yacop Sucipto
# author_title: Maintainer of Docusaurus
# author_url: https://github.com/endiliey
# author_image_url: https://avatars1.githubusercontent.com/u/17883920?s=460&v=4
tags: [releases]
---

Playwright 1.6 is available today, with improvements to network capabilities: inspect WebSocket connections, export network activity as HAR and access resource timing for network responses. This release also adds a new API for touchscreen taps. Like other input methods, touchscreen taps auto-wait for the underlying element to be ready, to improve the reliability of automation.

<!--truncate-->

Inspect WebSocket connections

Real-time

Network resource timing and HAR exports

Touchscreen tap
131 changes: 131 additions & 0 deletions v2/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
module.exports = {
title: 'Playwright',
tagline: 'Fast and reliable end-to-end testing for modern web apps',

// Repo config for GitHub Pages
url: 'https://microsoft.github.io',
baseUrl: '/playwright/',
organizationName: 'microsoft',
projectName: 'playwright',

onBrokenLinks: 'log',
scripts: ['js/redirection.js'],
favicon: 'img/playwright-logo.svg',
themeConfig: {
navbar: {
title: 'Playwright',
logo: {
alt: 'Playwright logo',
src: 'img/playwright-logo.svg',
},
items: [
{
type: 'doc',
docId: 'intro',
label: 'Docs',
position: 'left',
},
{
type: 'doc',
docId: 'api/playwright-module',
label: 'API',
position: 'left',
},
{
to: 'blog', label: 'Blog', position: 'right'
},
{
href: 'https://github.com/microsoft/playwright',
label: 'GitHub',
position: 'right',
},
{
type: 'docsVersionDropdown',
position: 'left',
// Add additional dropdown items at the beginning/end of the dropdown.
dropdownItemsBefore: [],
dropdownItemsAfter: [{to: '/versions', label: 'All versions'}],
// Do not add the link active class when browsing docs.
dropdownActiveClassDisabled: true,
}
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Getting started',
to: 'docs/intro',
},
{
label: 'API reference',
to: 'docs/api/playwright-module',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/playwright',
},
{
label: 'Slack',
href: 'https://aka.ms/playwright-slack',
},
{
label: 'Twitter',
href: 'https://twitter.com/playwrightweb',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: 'blog',
},
{
label: 'GitHub',
href: 'https://github.com/microsoft/playwright',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Microsoft`,
},
algolia: {
apiKey: 'c85f496c6eea71808027d42111ac550c',
indexName: 'playwright',
// contextualSearch: true,
// searchParameters: {},
},
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/'
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl:
'https://github.com/facebook/docusaurus/edit/master/website/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};
39 changes: 39 additions & 0 deletions v2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "playwright-dev-v-2",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"serve": "docusaurus serve"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
"@docusaurus/preset-classic": "2.0.0-alpha.66",
"@mdx-js/react": "^1.6.21",
"clsx": "^1.1.1",
"fs-extra": "^9.0.1",
"markdown-it": "^12.0.2",
"markdown-it-title": "^3.0.0",
"react": "^16.8.4",
"react-dom": "^16.8.4",
"semver": "^7.3.2",
"shelljs": "^0.8.4",
"slugify": "^1.4.6"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Loading

0 comments on commit 6c2d20e

Please sign in to comment.