【发布时间】:2021-09-20 21:46:22
【问题描述】:
我希望所有场景都在多个浏览器实例中运行,我尝试提供最大实例功能,但它总是打开 1 个 chrome 实例并一一运行测试。我希望测试在多个 chrome 实例中运行。我在这里做错了什么?
当前配置文件:
exports.config = {
allScriptsTimeout: 800000,
getPageTimeout: 400000,
specs: [
'./src/cucumber/features/**/memberSearch.feature',
],
params: {
pageObjects: require['./src/cucumber/pages/**/*.po.ts'],
customTimeout: 5000,
url:{
dev: "https://dev.com/login",
test: "https://test.com/login",
stage: "https://stage.com/login",
local: "http://localhost:4200",
}
},
capabilities: {
browserName: 'chrome',
//acceptInsecureCerts: true,
shardTestFiles: true,
maxInstances: 4,
chromeOptions: {
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu', '--window-size=800x600'],
},
},
directConnect: true,
baseUrl: 'https://dev.com/',
useAllAngular2AppRoots: true,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
cucumberOpts: {
compiler: 'ts:ts-node/register',
require: ['./src/cucumber/steps/**/*.steps.ts', './src/cucumber/utils/**/*.util.ts'],
format: 'json:./reports/cucumber_report.json',
monochrome: true,
strict: true,
tags: '@MemberSearch',
}
功能文件:
@MemberSearch
Feature: Search a member
@CompletedTodo
Scenario: See all the assessments associated with the member
Given Enter the URL
When click on the MemberID radio Button
And Type the memberID "ABCD" first time
And Click the Search Button first time
@FilterTitle
Scenario: Validate the Filters With Title field
Given Enter the URL
When click on the MemberID radio Button
And Type the memberID "ABCD"
Then Click the Search Button
@FilterTimeFrame30
Scenario: Validate the Filters with time FilterTimeFrame 30
Given Enter the URL
When click on the MemberID radio Button
And Type the memberID "ABCD"
Then Click the Search Button
Then Show the message "No records to display"
@FilterTimeFrame60
Scenario: Validate the Filters with time FilterTimeFrame 60
Given Enter the URL
When click on the MemberID radio Button
And Type the memberID "ABCD"
Then Click the Search Button
@FilterTimeFrame90
Scenario: Validate the Filters with time FilterTimeFrame 90
Given Enter the URL
When click on the MemberID radio Button
And Type the memberID "ABCD"
Then Click the Search Button
Then Show the message "No records to display"
And Click the Clear Button
@FilterTimeFrame365
Scenario: Validate the Filters with time FilterTimeFrame 365
Given Enter the URL
When click on the MemberID radio Button
And Type the memberID "ABCD"
Then Click the Search Button
Then Show the message "No records to display"
And Click the Clear Button
When Type the memberID "40988"
我希望所有场景都在多个浏览器实例中运行,我尝试提供最大实例功能,但它总是打开 1 个实例并一一运行测试。我想测试在多个实例中运行。我在这里做错了什么?
【问题讨论】:
-
你这里用的是 cucumber-js 吗?
-
是的,我正在使用黄瓜
-
更新:如果我使用多个功能文件,那么我可以启动多个浏览器实例(1 个功能文件 = 1 个浏览器实例是我目前所理解的)但是当我给出只有 1 个功能的路径时文件中的规范它只启动 1 个浏览器实例。这是正常行为吗?
标签: typescript selenium selenium-webdriver protractor cucumberjs