Следующий код позволяет использовать как простые, так и динамические c идентификаторы
const po = new WeakMap;
//Basic Page Object
po['email'] = `div#email`,
//Page Objects with 1 parameter
po['firstName'] = (personType) => `div#${personType}-first-name`,
po['lastName'] = (personType) => `div#${personType}-last-name`,
po['middleInitial'] = (personType) => `div#${personType}-middle-initial`;
//Page Objects with 2 parameters
po['street'] = (homeOrBilling, streetNumber) => `div#${homeOrBilling}-street-${streetNumber}`;
/* Usage */
const p = console.log;
p(po.email);
p(po.firstName('mother'));
p(po.lastName('mother'));
p(po.middleInitial('mother'));
p(po.street('home','1'));
p(po.street('home','2'));
module.exports = po;
/* Sample output */
/*
div#email
div#mother-first-name
div#mother-last-name
div#mother-middle-initial
div#home-street-1
div#home-street-2
*/