我有一个问题,我需要在测试中重新运行配置,因为我们使用的角色只有一个小时的权限。您甚至无法扩展角色权限,因为我们在使用此角色时进行角色链接。有人遇到过这个问题吗?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)