Skip to content
Advertisement

Protractor + Jasmine: Run same test in parallel with different data inputs

Wondering if there is a possibility to have a data driven tests with protractor + jasmine to execute it in parallel.

I have the following: storeList.json – an array with input params to test individual store. We have around 40 stores – records.

JavaScript

ordering.js – code (protractor) which takes each element from json above and executes it as separate test.

JavaScript

all.js – a snippet to make ordering.js a bit data driven

JavaScript

config.js

JavaScript

Using this setup I get 3 instances of chrome running each executing ordering.js test with all available data inputs from storeList. So I get 6 tests executed, but in fact I’m willing 2 tests to be executed in parallel.

Another option I have tried is having multiple json for data input, and copies of ordering js, but that seems to be a bad practice.

Could someone point me to right direction having protractor data driven tests executed in parallel.

Advertisement

Answer

You need to know protractor running in parallel against spec files, rather than it blocks cross all spec files. So a solution is to create many spec files for data rows (per row per spec file).

// protractor conf.js

JavaScript

// specs/template_01.js

JavaScript

// data/all.js

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement