【发布时间】:2021-11-30 21:01:38
【问题描述】:
我有在不同环境中运行的 cypress 脚本,规格文件看起来像这样
describe('Whitelabel Login', () => {
it('Whitelabel Login', () => {
const whitelabelBaseUrl = whitelabelUrl =>
whitelabelUrl.replace('://', '://motivaction.')
cy.visit(whitelabelBaseUrl(Cypress.config('whitelabelUrl')))
cy.screenshot('Whitelbel Login page', { capture: 'fullPage' })
cy.visit(`${whitelabelBaseUrl(Cypress.config('whitelabelUrl'))}/logout`)
cy.screenshot('Whitelbel Logout page', { capture: 'fullPage' })
})
})```
So when I am running the script npx cypress run --env name=qa wl=seedling
then I want `motivaction` to be replaces by seedling is there any way that I can achieve it
【问题讨论】:
-
你必须使用逗号来分隔环境变量,而不是空格:
npx cypress run --env name=qa,wl=seedling.
标签: cypress