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 "Expected to have result"error after completion of a step #20

Open
anooppc07 opened this issue Dec 4, 2023 · 4 comments
Open

Comments

@anooppc07
Copy link

Below is my test.But am getting the error ""Expected to have result"" just after typing in username.Can you help me here.

test.only("executes query", async ({ page }) => {
await page.goto("https://www.saucedemo.com/");

const headerText="Playwright";
await auto(`type "${headerText}" in the username`, { page, test },{model: 'gpt-3.5-turbo-1106', debug: true});
await auto(`type "Hello" in the password`, { page, test },{model: 'gpt-3.5-turbo-1106', debug: true});
await page.pause();

});

@SmartALB
Copy link

Here the same.

@azertyalex
Copy link

Same issues here

@AbhishekAutomationTest
Copy link

same here

@srsantmyer
Copy link

srsantmyer commented Mar 13, 2024

I bumped into this today while looking to try out auto-playwright on the cheap with GPT-3.5. I was able to get around the issue as follows:

in node_modules/auto-playwright/dist/completeTask.js at line 23 there's an if statement. The GPT-3.5 final role === "assistant" response message doesn't appear to contain a value that satisfies this predicate:
message.function_call?.name.startsWith("result") . It just doesn't contain a message.function_call value.

I updated the if as follows:

        if (message.role === "assistant" &&
            (message.function_call?.name.startsWith("result"))
            || message.content?.indexOf(" successfully ") > -1) {
            lastFunctionResult = JSON.parse(message.function_call?.arguments?? 'true');
        }

GPT-3.5 has been returning a message like "I have successfully ..." or "... as been completed successfully...". I'm not sure why it isn't the same every time, but I've seen a couple variations. In my cursory testing this worked, but YMMV. I'm not sure how it will hold up to more robust situations.

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

5 participants