This project demonstrates how to use Playwright with TypeScript to connect to an AgentStation Workstation and perform an automated web browsing sequence.
You can set up this project using the following steps:
- Node.js (v16 or later)
- npm
- An AgentStation API key
-
Navigate to the Playwright TypeScript Directory
- Open a terminal and navigate to the
playwright/typescript
directory.
- Open a terminal and navigate to the
-
Install Dependencies
- Run
npm install
to install the required dependencies.
- Run
-
Set Up Environment Variables
-
Set your AgentStation API key as an environment variable:
export AGENTSTATION_API_KEY=your_api_key
-
-
Run the project using the following command:
npm start
-
The script will:
- Request a new workstation from the AgentStation API
- Wait for the workstation to initialize (10 seconds)
- Connect to the browser using Playwright
- Perform the following automated sequence:
- Navigate to Google
- Search for "agentstation.ai"
- Click the first search result
- Navigate to the AgentStation launch page
- Ask if you want to run another demo
- Clean up resources when finished
- Interactive demo that can be run multiple times
- Graceful error handling and resource cleanup
- Configurable timeouts and viewport settings
- Detailed console logging of each step
- Ability to monitor workstation status at app.agentstation.ai/workstations
Required environment variables:
AGENTSTATION_API_KEY
: Your AgentStation API key
This project is licensed under the MIT License.