Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting connection error - may be openai api key is not set property - need help #21

Open
suraj007118 opened this issue Jan 5, 2024 · 0 comments

Comments

@suraj007118
Copy link

Hello,
I have set my api key within options variable as below:

import { test, expect } from '@playwright/test'
import { auto } from 'auto-playwright'

test.describe('todo tests', () => {

const options = {
openaiApiKey: '12eretretrtydsfgfdgxcxdv',
}

test('sample AI test @auto', async ({ page }) => {
const email = ''
const password = '
'
await page.goto('https://
***********')
await page.waitForTimeout(3000)

await auto('Verify that **** Logo is displayed', { page, test }, options)
await auto('Click on "Sign In" button', { page, test }, options)
await page.waitForTimeout(5000)
await auto('Verify that a pop up modal is displayed', { page, test }, options)
await auto('Click on link "**********"', { page, test })
await auto('Verify a login screen is displayed', { page, test }, options)

but I get error:

Error: Connection error.

    at OpenAI.makeRequest (/Users/suraj.kelkar/Downloads/playwright-typeScript/node_modules/.pnpm/[email protected]/node_modules/openai/src/core.ts:400:13)
    at ChatCompletionRunner._createChatCompletion (/Users/suraj.kelkar/Downloads/playwright-typeScript/node_modules/.pnpm/[email protected]/node_modules/openai/src/lib/AbstractChatCompletionRunner.ts:432:28)
    at ChatCompletionRunner._runFunctions (/Users/suraj.kelkar/Downloads/playwright-typeScript/node_modules/.pnpm/[email protected]/node_modules/openai/src/lib/AbstractChatCompletionRunner.ts:481:46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant