Skip to content

Commit 7d0ed62

Browse files
committed
Add sample CodeceptJS project
1 parent a631814 commit 7d0ed62

File tree

8 files changed

+8223
-0
lines changed

8 files changed

+8223
-0
lines changed

.github/workflows/codeceptjs.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CodeceptJS
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- "codeceptjs/**"
8+
- ".github/workflows/codeceptjs.yml"
9+
pull_request:
10+
paths:
11+
- "codeceptjs/**"
12+
- ".github/workflows/codeceptjs.yml"
13+
14+
env:
15+
LAUNCHABLE_TOKEN: ${{ secrets.LAUNCHABLE_TOKEN_CODECEPTJS }}
16+
LAUNCHABLE_DEBUG: 1
17+
LAUNCHABLE_REPORT_ERROR: 1
18+
19+
jobs:
20+
tests:
21+
runs-on: ubuntu-22.04
22+
defaults:
23+
run:
24+
working-directory: codeceptjs
25+
steps:
26+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
27+
with:
28+
fetch-depth: 0
29+
30+
# Set up Python for Launchable CLI
31+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #6.0.0
32+
with:
33+
python-version: "3.x"
34+
35+
# Set up Java for Launchable CLI
36+
- name: Set up JDK 1.8
37+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 #v5.0.0
38+
with:
39+
java-version: 8
40+
distribution: "temurin"
41+
42+
# Install Launchable CLI
43+
- name: Install launchable CLI
44+
run: |
45+
pip install launchable
46+
47+
# Set up Node.js
48+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 #v6.0.0
49+
with:
50+
node-version: 18
51+
cache: "npm"
52+
cache-dependency-path: codeceptjs/package-lock.json
53+
54+
# Install dependencies and Playwright browsers
55+
- name: Install dependencies
56+
run: |
57+
npm ci
58+
npx playwright install --with-deps chromium
59+
60+
# Record commits and build with Launchable
61+
# - name: Record commits and build
62+
# run: launchable record build --name "$GITHUB_RUN_ID"
63+
64+
# Run CodeceptJS tests
65+
- name: Run CodeceptJS tests
66+
run: npm test
67+
continue-on-error: true
68+
69+
# Record test results with Launchable
70+
# - name: Record test results
71+
# run: launchable record tests --build "$GITHUB_RUN_ID" junit ./output/result.xml
72+
# if: always()

codeceptjs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
output

codeceptjs/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# CodeceptJS Simple Example
2+
3+
A minimal CodeceptJS project for web test automation.
4+
5+
## Setup
6+
7+
1. Install dependencies:
8+
```bash
9+
cd codeceptjs
10+
npm install
11+
```
12+
13+
## Running Tests
14+
15+
```bash
16+
# Run all tests (generates JUnit XML report in output/result.xml)
17+
npm test
18+
19+
# Run with verbose output
20+
npm run test:verbose
21+
22+
# Run specific test
23+
npx codeceptjs run tests/website_test.js
24+
```

codeceptjs/codecept.conf.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/** @type {CodeceptJS.MainConfig} */
2+
exports.config = {
3+
tests: "./tests/*_test.js",
4+
output: "./output",
5+
helpers: {
6+
Playwright: {
7+
url: "https://example.com",
8+
show: false,
9+
browser: "chromium",
10+
},
11+
},
12+
include: {},
13+
name: "codeceptjs-simple-example",
14+
plugins: {
15+
allure: {
16+
enabled: false,
17+
},
18+
},
19+
multiple: {
20+
basic: {
21+
browsers: ["chromium"],
22+
},
23+
},
24+
};

0 commit comments

Comments
 (0)