赛普拉斯拦截没有找到固定文件
cy.intercept('POST', '/api/create_payment_intent', {
fixture: 'payment_intent.json', // fixture file with mocked response
}).as('createPaymentIntent');
payment_intent.json
文件存在于cypress/fixtures/
填充有效JSON的目录。
错误:
[1] [1] Error: An error was thrown while processing a network event: A fixture file could not be found at any of the following paths:
[1] [1]
[1] [1] > cypress/fixtures/payment_intent.json
[1] [1] > cypress/fixtures/payment_intent.json{{extension}}
[1] [1]
[1] [1] Cypress looked for these file extensions at the provided path:
[1] [1]
[1] [1] > .json, .js, .coffee, .html, .txt, .csv, .png, .jpg, .jpeg, .gif, .tif, .tiff, .zip
[1] [1]
[1] [1] Provide a path to an existing fixture file.
[1] [1]
[1] [1] Because this error occurred during a `before each` hook we are skipping the remaining tests in the current suite: `Neo4j Aura Console - Common`
[1] [1] Error: A fixture file could not be found at any of the following paths:
[1] [1]
[1] [1] > cypress/fixtures/payment_intent.json
[1] [1] > cypress/fixtures/payment_intent.json{{extension}}
[1] [1]
[1] [1] Cypress looked for these file extensions at the provided path:
当我完成文档所说的话时,HOE是否会进行调试?
cy.intercept('POST', '/api/create_payment_intent', {
fixture: 'payment_intent.json', // fixture file with mocked response
}).as('createPaymentIntent');
payment_intent.json
file exists at cypress/fixtures/
directory filled with valid json.
Error:
[1] [1] Error: An error was thrown while processing a network event: A fixture file could not be found at any of the following paths:
[1] [1]
[1] [1] > cypress/fixtures/payment_intent.json
[1] [1] > cypress/fixtures/payment_intent.json{{extension}}
[1] [1]
[1] [1] Cypress looked for these file extensions at the provided path:
[1] [1]
[1] [1] > .json, .js, .coffee, .html, .txt, .csv, .png, .jpg, .jpeg, .gif, .tif, .tiff, .zip
[1] [1]
[1] [1] Provide a path to an existing fixture file.
[1] [1]
[1] [1] Because this error occurred during a `before each` hook we are skipping the remaining tests in the current suite: `Neo4j Aura Console - Common`
[1] [1] Error: A fixture file could not be found at any of the following paths:
[1] [1]
[1] [1] > cypress/fixtures/payment_intent.json
[1] [1] > cypress/fixtures/payment_intent.json{{extension}}
[1] [1]
[1] [1] Cypress looked for these file extensions at the provided path:
Hoe does one debug this when I have done exactly what the documentation has stated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,这是由我的cypress.config.ts中的这条线引起的:
删除了这条线并重新启动了柏树,我的固定装置得到了:)
I had the same issue and it was caused by this line in my cypress.config.ts:
After removing this line and restarting cypress, my fixtures got found :)