TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Are there any LLM projects for creating integration tests?

3 点作者 gitgud超过 1 年前
I’m curious if anyone has seen a project involving LLM’s that takes a series of user actions and creates integration test code for them, something like:<p><pre><code> I goto to example.com I click the search bar I type in “fruit” Expect to see a list of fruit </code></pre> Then the LLM would execute something like playwright to achieve each of these steps and report back if any steps failed…

3 条评论

leandot超过 1 年前
Are you looking for a web service that does the whole thing? Otherwise asking ChatGPT gives you<p>convert this free text<p><pre><code> I goto to example.com I click the search bar I type in “fruit” Expect to see a list of fruit </code></pre> to playwright script<p>const { chromium } = require(&#x27;playwright&#x27;);<p>(async () =&gt; { const browser = await chromium.launch(); const context = await browser.newContext(); const page = await context.newPage();<p><pre><code> &#x2F;&#x2F; Navigate to example.com await page.goto(&#x27;https:&#x2F;&#x2F;example.com&#x27;); &#x2F;&#x2F; Click the search bar await page.click(&#x27;input[type=&quot;search&quot;]&#x27;); &#x2F;&#x2F; Type in &quot;fruit&quot; await page.type(&#x27;input[type=&quot;search&quot;]&#x27;, &#x27;fruit&#x27;); &#x2F;&#x2F; Press Enter to submit the search await page.press(&#x27;input[type=&quot;search&quot;]&#x27;, &#x27;Enter&#x27;); &#x2F;&#x2F; Wait for the page to load await page.waitForLoadState(&#x27;networkidle&#x27;); &#x2F;&#x2F; Expect to see a list of fruit const fruitList = await page.$$(&#x27;ul li&#x27;); if (fruitList.length &gt; 0) { console.log(&#x27;List of fruit found!&#x27;); } else { console.error(&#x27;Failed to find the list of fruit.&#x27;); } &#x2F;&#x2F; Close the browser await browser.close();</code></pre> })();
hitchstory超过 1 年前
I have created a project for easily writing this type of test with YAML:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;hitchdev&#x2F;hitchstory">https:&#x2F;&#x2F;github.com&#x2F;hitchdev&#x2F;hitchstory</a><p>I dont think that this type of task is really appropriate for an LLM though. It is better to use hard, prewritten abstractions for the truly deterministic stuff (e.g. click).<p>For other situations where you may need to do subtle trade offs (e.g. choosing an HTML selector for the search bar) an LLM will generally do a bad job.
octo-andrero超过 1 年前
I have never heard about the LLM-based solution, but the tests written with help of Cucumber (<a href="https:&#x2F;&#x2F;cucumber.io&#x2F;tools&#x2F;cucumber-open&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cucumber.io&#x2F;tools&#x2F;cucumber-open&#x2F;</a>) framework looks very similar to what you&#x27;re asking about.