Skip to content

Commit

Permalink
fix: github action (#15)
Browse files Browse the repository at this point in the history
* fix: github action

* feat: load .env file in puppeteer demo
  • Loading branch information
yuyutaotao authored Nov 28, 2024
1 parent 1d9162b commit bb1094a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/yaml-scripts-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
output_folder:
description: 'Midscene report directory'
required: true
default: 'yaml-scripts/midscene_run/report/'
default: 'yaml-scripts-demo/midscene_run/report/'
push:
branches:
- main
Expand All @@ -29,7 +29,7 @@ jobs:
MIDSCENE_DEBUG_AI_PROFILE: 1
run: |
npm i -g @midscene/cli@${{ github.event.inputs.tag }}
cd yaml-scripts
cd yaml-scripts-demo
midscene ./midscene-scripts/
- name: List directory contents
Expand Down
2 changes: 1 addition & 1 deletion playwright-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ create `.env` file

```shell
# replace by your own
export OPENAI_API_KEY="YOUR_TOKEN"
OPENAI_API_KEY="YOUR_TOKEN"
```

> e2e command
Expand Down
1 change: 1 addition & 0 deletions puppeteer-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package-lock.json
.env

# Midscene.js dump files
midscene_run/midscene-report
Expand Down
6 changes: 5 additions & 1 deletion puppeteer-demo/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# puppeteer-demo

create `.env` file

```shell
# replace by your own
export OPENAI_API_KEY="sk-abcdefghijklmnopqrstuvwxyz"
OPENAI_API_KEY="YOUR_TOKEN"
```

run demo

```bash
npm install

Expand Down
1 change: 1 addition & 0 deletions puppeteer-demo/demo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import puppeteer from "puppeteer";
import os from "node:os";
import { PuppeteerAgent } from "@midscene/web/puppeteer";
import "dotenv/config";

const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
Promise.resolve(
Expand Down
3 changes: 2 additions & 1 deletion puppeteer-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"license": "MIT",
"devDependencies": {
"@midscene/web": "latest",
"dotenv": "^16.4.5",
"puppeteer": "^23.4.0",
"tsx": "^4.19.1"
}
}
}

0 comments on commit bb1094a

Please sign in to comment.