【问题标题】:cypress origin use : cypress.config.json赛普拉斯来源使用:cypress.config.json
【发布时间】:2022-11-02 03:05:10
【问题描述】:

我尝试使用“来源”来使用多域访问,我已经配置了 cypress.config.js 但仍然有:

cy.origin() 需要启用 ExperimentSessionAndOrigin 标志

我的 cypress.config.js :

const { defineConfig } = require('cypress')

module.exports = defineConfig({
  
      chromeWebSecurity: false,
      e2e: {
        setupNodeEvents(on, config) {
         // implement node event listeners here,
              experimentalSessionAndOrigin: true
        },
      },
    });

谢谢帮助! 问候

【问题讨论】:

    标签: cypress cross-domain


    【解决方案1】:

    experimentalSessionAndOrigin: true 移到setupNodeEvents(on, config) 上方,这是一个配置选项,而不是节点事件。

    const { defineConfig } = require('cypress')
    
    module.exports = defineConfig({
      chromeWebSecurity: false,
      e2e: {
        experimentalSessionAndOrigin: true
        setupNodeEvents(on, config) {
         // implement node event listeners here,
        },
      },
    });
    

    【讨论】:

      【解决方案2】:

      大家好,我有一个问题,我的 cypress.config 文件如下,但仍然出现错误(cy.origin() 需要启用experimentalsessionAndOrigin 标志)。有人可以帮帮我吗 常量 { 定义配置 } = 要求('柏树')

      module.exports = defineConfig({

        chromeWebSecurity: false,
        e2e: {
          setupNodeEvents(on, config) {
           // implement node event listeners here,
                experimentalSessionAndOrigin: true
          },
        },
      });
      

      【讨论】:

        猜你喜欢
        • 2020-12-23
        • 1970-01-01
        • 1970-01-01
        • 2018-04-28
        • 2023-01-12
        • 2020-09-15
        • 1970-01-01
        • 1970-01-01
        • 2023-02-14
        相关资源
        最近更新 更多