v1
2/16/2021 by jamiec -00
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const data = [
  {
    Domain: 'google.com',
    '# Reocurring Domains': 0
  },
  {
    Domain: 'apple.com',
    '# Reocurring Domains': 0
  },
  {
    Domain: 'facebook.com',
    '# Reocurring Domains': 0
  }
]

const domains = [
  {
    'google.com': true,
    'microsoft.com': true,
    'google.com': true
  },
  {
    'apple.com': true,
    'microsoft.com': true,
    'twitter.com': true
  },
  {
    'facebook.com': true,
    'apple.com': true,
    'facebook.com': true
  }
]
const domainIndex = {};
for (const entry of domains) {
	for(const domain of Object.keys(entry))
		domainIndex[domain] = (domainIndex[domain] || 0) +1	
}
delete caserun single casemove downdrag and drop case


ready



for (const obj of data) {
  let count = 1
  for (const entry of domains) {
    if (entry[obj.Domain]) {
      obj['# Reocurring Domains'] = count++
    }
  }
}
delete caserun single casemove updrag and drop case


ready




 
for (const obj of data) {
	obj['# Reocurring Domains'] = domainIndex[obj.Domain] 
}
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN