Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 8 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@ on:
jobs:
publish-npm:
runs-on: ubuntu-latest
env:
PUBLIC_MEILISEARCH_KEY: ${{ secrets.PUBLIC_MEILISEARCH_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
registry-url: https://registry.npmjs.org/
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "github-cd-bot@example.com"
- name: Install deps
run: npm i
run: npm ci
- name: Sync changelog from CodeceptJS 4.x
run: npm run sync:changelog
- name: Generate unified API docs
run: npm run generate:unified-api
- name: Build docs
run: npm run build
env:
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
name: Publish website

on:
push:
branches:
- main
- master
workflow_dispatch:

jobs:
publish-npm:
runs-on: ubuntu-latest
env:
PUBLIC_MEILISEARCH_KEY: ${{ secrets.PUBLIC_MEILISEARCH_KEY }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Install deps
run: npm i
run: npm ci
- name: Sync changelog from CodeceptJS 4.x
run: npm run sync:changelog
- name: Generate unified API docs
run: npm run generate:unified-api
- name: deployment
run: ./runok.js publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

run-search-scraper:
name: Run Search Scraper
runs-on: ubuntu-latest
needs: publish-npm
steps:
- uses: actions/checkout@v4
- name: Index docs in Meilisearch
env:
MEILISEARCH_HOST_URL: ${{ secrets.MEILISEARCH_HOST_URL }}
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
run: |
docker run -t --rm \
-e MEILISEARCH_HOST_URL=$MEILISEARCH_HOST_URL \
-e MEILISEARCH_API_KEY=$MEILISEARCH_API_KEY \
-v $PWD/docsearch.json:/docs-scraper/docsearch.json \
getmeili/docs-scraper:latest pipenv run ./docs_scraper docsearch.json
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# CodeceptJS Website (Astro)

This repository hosts the CodeceptJS documentation website built with Astro/Starlight.

## Local development

```bash
npm i
npm run dev
```

## Content sync (4.x flow)

The docs sync flow is now:

1. Sync changelog from CodeceptJS `4.x`:

```bash
npm run sync:changelog
```

2. Regenerate unified API pages:

```bash
npm run generate:unified-api
```

3. Build:

```bash
npm run build
```

You can also run the compatibility helper:

```bash
./runok.js update
```

This command now runs `sync:changelog` + `generate:unified-api` (legacy 3.x VuePress sync was removed).
88 changes: 63 additions & 25 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ import starlightSidebarTopics from 'starlight-sidebar-topics';
import starlightImageZoom from 'starlight-image-zoom';
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
import starlightScrollToTop from 'starlight-scroll-to-top';
import starlightBlog from 'starlight-blog';

const options = {
collectionBase: false,
};

export default defineConfig({
site: 'https://codecept.io',
integrations: [
starlight({
expressiveCode: {
themes: ['github-dark', 'dracula'],
},
disable404Route: true,
title: '',
favicon: '/favicon.svg',
social: [
Expand All @@ -26,6 +27,7 @@ export default defineConfig({
Head: "./src/components/Head.astro",
PageFrame: "./src/components/PageFrame.astro",
PageTitle: './src/components/PageTitle.astro',
PageSidebar: './src/components/PageSidebar.astro',
Footer: './src/components/Footer.astro',
SiteTitle: './src/components/SiteTitle.astro',
Search: './src/components/Search.astro',
Expand All @@ -37,22 +39,21 @@ export default defineConfig({
],
plugins: [
starlightImageZoom(),
starlightBlog(),
starlightSidebarTopics([
{
id: 'documentation',
label: 'Documentation',
link: 'quickstart',
items: [
{
label: 'Web Testing',
items: [
{label: 'Getting Started', link: 'basics'},
{label: 'CodeceptUI', link: 'ui'},
{label: 'Web Basics', link: 'basics'},
{label: 'Testing with Playwright', link: 'playwright'},
{label: 'Testing with WebDriver', link: 'webdriver'},
{label: 'Testing with Puppeteer', link: 'puppeteer'},
{label: 'API Testing', link: 'api'},
{label: 'Testing with TestCafe', link: 'testcafe'},
{label: 'Testing React Applications', link: 'react'},
{label: 'Testing Vue Apps', link: 'vue'},
],
},
{
Expand All @@ -66,48 +67,75 @@ export default defineConfig({
label: 'Organizing Tests',
items: [
{label: 'Page Objects', link: 'pageobjects'},
{label: 'TypeScript', link: 'typescript'},
{label: 'Data Management', link: 'data'},
{label: 'Behavior Driven Development', link: 'bdd'},
{label: 'Locators', link: 'locators'},
{label: 'Shadow DOM', link: 'shadow'},
{label: 'Translation', link: 'translation'},
{label: 'Custom Helpers', link: 'custom-helpers'},
{label: 'Best Practices', link: 'best'},
],
},
{
label: 'API Reference',
items: [
{label: 'Web API (Unified)', link: 'web-api'},
{label: 'Mobile API (Unified)', link: 'mobile-api'},
{label: 'API Testing', link: 'api'},
{label: 'Commands', link: 'commands'},
{label: 'Configuration', link: 'configuration'},
{label: 'Plugins', link: 'plugins'},
{label: 'Effects', link: 'effects'},
{label: 'Element Access (els)', link: 'els'},
{label: 'WebElement API', link: 'web-element'},
],
},
{
label: 'Advanced Usage',
items: [
{label: 'Advanced Usage', link: 'advanced'},
{label: 'TypeScript', link: 'typescript'},
{label: 'ESM Migration', link: 'esm-migration'},
{label: 'CodeceptUI', link: 'ui'},
{label: 'Bootstrap', link: 'bootstrap'},
{label: 'Reporters', link: 'reports'},
{label: 'Continuous Integration', link: 'continuous-integration'},
{label: 'Docker', link: 'docker'},
{label: 'Parallel Execution', link: 'parallel'},
{label: 'Retry Mechanisms', link: 'retry'},
{label: 'Visual Testing', link: 'visual'},
{label: 'Email Testing', link: 'email'},
{label: 'Secrets', link: 'secrets'},
{label: 'Extending', link: 'hooks'},
{label: 'Concepts', link: 'internal-api'},
{label: 'Testing React Applications', link: 'react'},
{label: 'Testing with AI', link: 'ai'},
{label: 'MCP Server', link: 'mcp'},
{label: 'Self-Healing Tests', link: 'heal'},
{label: 'Testing with Protractor', link: 'angular'},
{label: 'Testing Vue Apps', link: 'vue'},
],
},
{
label: 'Resources',
items: [
{label: 'Tutorial', link: 'tutorial'},
{label: 'Examples', link: 'examples'},
{label: 'Videos', link: 'videos'},
{label: 'Books & Posts', link: 'books'},
{label: 'Community Helpers', link: 'helpers/community-helpers'},
{label: 'Changelog', link: 'changelog'},
],
},
],
},

{
id: 'helpers',
label: 'Helpers',
link: '/helpers/playwright/',
items: [
{
label: 'Web Testing',
items: [
{label: 'Playwright', link: 'helpers/playwright'},
{label: 'WebDriver', link: 'helpers/web-driver'},
{label: 'Puppeteer', link: 'helpers/puppeteer'},
{label: 'TestCafe', link: 'helpers/test-cafe'},
],
},
{
Expand All @@ -125,37 +153,40 @@ export default defineConfig({
{label: 'GraphQL', link: 'helpers/graph-ql'},
{label: 'GraphQLDataFactory', link: 'helpers/graph-ql-data-factory'},
{label: 'JSONResponse', link: 'helpers/json-response'},
{label: 'MockRequest', link: 'helpers/mock-request'},
],
},
{
label: 'Other Helpers',
items: [
{label: 'OpenAI', link: 'helpers/open-ai'},
{label: 'AI', link: 'helpers/ai'},
{label: 'FileSystem', link: 'helpers/file-system'},
{label: 'Expect', link: 'helpers/expect'},
{label: 'SoftExpectHelper', link: 'helpers/soft-expect-helper'},
{label: 'MockRequest', link: 'helpers/mock-request'},
{label: 'MockServer', link: 'helpers/mock-server'},
{label: 'Community Helpers', link: 'community-helpers'},
{label: 'Polly', link: 'helpers/polly'},
{label: 'Mochawesome', link: 'helpers/mochawesome'},
{label: 'Custom Helpers', link: 'custom-helpers'},
],
},
]
},
{
label: 'Wiki',
link: '/wiki/home/',
id: 'blog',
label: 'Blog',
link: '/blog/my-first-blog-post/',
items: [
{label: 'Wiki', autogenerate: {directory: 'wiki/'}},
{label: 'Blog', autogenerate: {directory: 'blog/'}},
],
},
{
label: 'blog',
link: '/blog',
items: [
{label: 'blog', autogenerate: {directory: 'blog/'}},
],
], {
exclude: ['/404'],
topics: {
documentation: ['/mobile-react-native-locators', '/installation', '/continuous-integration', '/internal-test-server'],
helpers: ['/helpers/puppeteer-firefox', '/helpers/protractor'],
},
]),
}),
starlightScrollToTop({
position: 'right',
tooltipText: 'Back to top',
Expand All @@ -172,6 +203,11 @@ export default defineConfig({
}),
],
vite: {
resolve: {
alias: {
zod: 'zod/v3',
},
},
plugins: [tailwindcss()],
build: {
assetsInlineLimit: 0,
Expand All @@ -183,3 +219,5 @@ export default defineConfig({
],
},
});


4 changes: 2 additions & 2 deletions docsearch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"start_urls": [
"https://codecept.io/"
],
"index_uid": "docs",
"index_uid": "codeceptjs",
"selectors": {
"default": {
"lvl0": "main h1",
Expand All @@ -13,4 +13,4 @@
"text": "main p"
}
}
}
}
Loading
Loading