admin 管理员组文章数量: 1086019
I'm writing integration tests for my Next.JS application, and it is persistently failing on this test case meant to check the button pressing with no inputs. I anticipated it may be down to the DOM not loading in, or the action not being assigned to the button, but manual testing, and the insertion of the wait()
call have no effect on the result.
describe('login', () => {
it('has clickable login button', () => {
cy.visit(domain + "/login")
cy.wait(10000)
cy.get("#loginsubmit").click()
})
})
Here's the output in the Cypress client of the test.
This is the page on which the error keeps happening.
"use client";
import ...
export default function Login() {
const [state, action, pending] = useActionState(login, undefined);
return (
<section className="...">
<div className="text-center">
<span className={title()}>Login</span>
</div>
<Form
action={action}
className="..."
>
...
<Button id="loginsubmit" disabled={pending} type="submit">
Log In
</Button>
{state?.errors?.password && <p>{state.errors.password}</p>}
</Form>
</section>
);
}
Any help would be appreciated.
本文标签: reactjsCypress fails on uncaught NotFoundError when clicking form submit buttonStack Overflow
版权声明:本文标题:reactjs - Cypress fails on uncaught NotFoundError when clicking form submit button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744036905a2522533.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论