Is there a way to select an element using protractor with selenium, pulling the element from an external JSON variable? I'm having trouble understanding how to do this correctly. The code snippet below seems to be incorrect as it references $data without specifying where $data points to.
I appreciate any advice you can provide!
programs.json
{ "programs":"One , Two"}
log.ts
const loginData = require('../../../../../e2e/src/data/programs.json');
var data = loginData['programs'][1];
element(by.xpath("//span[contains(text(),$data)]"));