小编Him*_*lia的帖子

Cypress - 从测试中间的插件文件重新运行配置

我有一个问题,我需要在测试中重新运行配置,因为我们使用的角色只有一个小时的权限。您甚至无法扩展角色权限,因为我们在使用此角色时进行角色链接。有人遇到过这个问题吗?cypress/plugins/index.js我的问题是,当测试失败或测试在凭据过期后运行时,如何重新运行代码以获取新的凭据?

插件/index.ts

import * as secretsManager from '@amzn/cypress-midway-plugin/secret_manager';
import PluginEvents = Cypress.PluginEvents;
import PluginConfigOptions = Cypress.PluginConfigOptions;
import * as AWS from 'aws-sdk'

import { CYPRESS_PRINCIPAL, CYPRESS_SECRET_ID, REGION, STAGE } from '../resources/constants';
import fetchSigv4Session from "./sigv4";
import getEnvVariables from "./env-variables";

/**
 * @type {Cypress.PluginConfig}
 */

export default async (on: PluginEvents, config: PluginConfigOptions): Promise<PluginConfigOptions> => {  // `on` is used to hook into various events Cypress emits
  // `on` is used to hook into various events Cypress emits
  // `config` …
Run Code Online (Sandbox Code Playgroud)

node.js cypress

2
推荐指数
2
解决办法
149
查看次数

标签 统计

cypress ×1

node.js ×1