Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Execute two (or more) protractor scripts with different features & specs in paralell #4778

@edgarechm

Description

@edgarechm

I have several tests that make a regression test set. The tests are not dependent from each other, but they take a long time to execute sequentially. I thought I could execute them in parallel, probably in 2 or 3 threads or instances.

Spec files are protractor-cucumber-jscript and features are gherkin.

Is this possible to set up using the protractor configuration file?

I tried the following, unsuccessfully:

var featsLocation = 'features/';
var stepsLocation = 'steps/';

exports.config = {
		rootElement: 'html',
		chromeDriver: './srv/build/applications/chromedriver/chromedriver_win32/chromedriver.exe',
		seleniumServerJar: './node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone.jar',
		params:{
			authURL:'',	
			login:{
				email:'',
				passw:''
			}
		},
		resultJsonOutputFile:'',
		getPageTimeout: 60000,
		allScriptsTimeout: 60000,
		maxSessions: 2,
		framework: 'custom',
		frameworkPath: require.resolve('protractor-cucumber-framework'),
		multiCapabilities:[
		     {	
		    	 browserName: 'chrome',
		    	 chromeOptions:{
		    		 args:["--headless"]
		    	 },
		    	 name: 'CAPABILITY_1',
		    	 logName: 'LOGNAME1_USERNAME1_A',
		    	 shardTestFiles: false,
		    	 maxInstances: 1,
		    	 count: 1,
		    	 specs: [   featsLocation+'authenticateCSM.feature'
		    	            , featsLocation+'locationSearch.feature'
		    	        ]
		     },{                  
		    	 browserName: 'chrome',
		    	 chromeOptions:{
		    		 args:["--headless"]
		    	 },
		    	 name: 'CAPABILITY_2',
		    	 logName: 'LOGNAME1_USERNAME2_B',
		    	 shardTestFiles: false,
		    	 maxInstances: 1,
		    	 count: 1,
		    	 specs: [   featsLocation+'authenticateCSM.feature'
		    	            , featsLocation+'shipmentErrors.feature'
		    	        ]
		     }],

		onPrepare: function(){
			global.EC = protractor.ExpectedConditions;
		},		
		baseUrl: '',
		cucumberOpts: {
			tags: '',
			require: [
			            './support/*.js'
			          , stepsLocation+'shipmentErrors/shipmentErrors.spec.js'
			          , stepsLocation+'locationSearch/locationSearch.spec.js'
			         ],
			monochrome: true,
			strict: true,
			plugin: "json"
		},
};

URL and other parameters are passed using package.json.

When executed, I do get tow instances of the selenium driver each one executing a cucumber feature, but then I get a warning message telling me that the *.spec.js files are not defined, but they are placed as it's defined in the cucumberOptions section of the config file.
Right HERE ----> steps/shipmentErrors/shipmentErrors.spec.js
and HERE ------> steps/locationSearch/locationSearch.spec.js.

This is the warning message:

[LOGNAME1_USERNAME1_A] Warnings:
[LOGNAME1_USERNAME1_A]
[LOGNAME1_USERNAME1_A] 1) Scenario: CSM FinalMile: Get authenticated to test Werner CSM Finalmile (SMOKE) - features\authenticateCSM.feature:11
[LOGNAME1_USERNAME1_A] Step: Given CSM FinalMile: Navigate to the Werner SSO initial page - features\authenticateCSM.feature:12
[LOGNAME1_USERNAME1_A] Message:
[LOGNAME1_USERNAME1_A] Undefined. Implement with the following snippet:
[LOGNAME1_USERNAME1_A]
[LOGNAME1_USERNAME1_A] Given('CSM FinalMile: Navigate to the Werner SSO initial page', function (callback) {
[LOGNAME1_USERNAME1_A] // Write code here that turns the phrase above into concrete actions
[LOGNAME1_USERNAME1_A] callback(null, 'pending');
[LOGNAME1_USERNAME1_A] });

Is there something I'm doing wrong with the config file syntax... any clues how I should build it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions