赛普拉斯拦截没有找到固定文件

发布于 2025-02-13 18:47:45 字数 1303 浏览 1 评论 0原文

  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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心碎的声音 2025-02-20 18:47:45

我遇到了同样的问题,这是由我的cypress.config.ts中的这条线引起的:

    fixturesFolder: 'fixtures',

删除了这条线并重新启动了柏树,我的固定装置得到了:)

I had the same issue and it was caused by this line in my cypress.config.ts:

    fixturesFolder: 'fixtures',

After removing this line and restarting cypress, my fixtures got found :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文