
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
ptor-xunit-grep-builder
Advanced tools
Given XML reports from protractor, this library will construct the `grep` param to run the failing tests
Given XML reports from protractor, this library will construct the grep
param to run the failing tests
Supports sharded configuration
install this library
npm install -g ptor-xunit-grep-builder
configure your protractor to export reports to xml (in onPrepare()
phase )
// for sharded configuration
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: savePath + '/each',
filePrefix: 'failed-test-' + uuid()
}));
// for regular configuration
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: savePath
}));
// alternatively, to have support for specs as well
// tested on configuration for running in parallel.
return global.browser.getProcessedConfig().then((config) => {
const filename = () => {
try {
return config.specs[0].split('/').slice(-1)[0]; // return entire name (e.g. name.ptor.js) - this will be appended with .xml later on
} catch (e) {
return 'failed-test-' + uuid();
}
};
const filenameValue = filename();
global.jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
consolidateAll: true,
savePath: savePath + '/each/',
filePrefix: filenameValue
}));
logger.info('filename is', filenameValue);
});
add a retry code to you build script - her is an example
#!/usr/bin/env bash
print_attempt(){
echo "#########################################################################################"
echo " attempt ${i} "
echo "#########################################################################################"
}
clean_reports () {
rm -rf ./reports/protractor/**/failed-test-*.xml
}
run_tests () {
print_attempt
echo PTOR_SUITE=${PTOR_SUITE}
GREP_PARAMS=`ptor-xunit-grep-builder --tests --files=./reports/protractor/*/each/*.xml`
echo "count of all tests"
ptor-xunit-grep-builder --count --tests --files=./reports/protractor/*/each/*.xml
SPECS_PARAMS=`ptor-xunit-grep-builder --filenames --files=./reports/protractor/*/each/*.xml`
echo "GREP PARAMS=${GREP_PARAMS}"
echo "SPECS PARAMS=${SPECS_PARAMS}"
if [ "$GREP_PARAMS" = "" ]; then
echo "ERROR::: grep params is empty but retrying..."
exit 1
fi
if [ "$SPECS_PARAMS" = "" ]; then
echo "ERROR::: specs params is empty but retrying..."
exit 1
fi
clean_reports
./node_modules/.bin/protractor --specs=${SPECS_PARAMS} --grep="${GREP_PARAMS}" protractor.conf.js
}
first_run () {
print_attempt
clean_reports
./node_modules/.bin/protractor --suite=${PTOR_SUITE} protractor.conf.js
}
i=1
# run first time and then retry over and over again
first_run || ( for i in 2 3 4 5 6 7 8 9; do run_tests $i && break || sleep 5; done )
FAQs
Given XML reports from protractor, this library will construct the `grep` param to run the failing tests
The npm package ptor-xunit-grep-builder receives a total of 0 weekly downloads. As such, ptor-xunit-grep-builder popularity was classified as not popular.
We found that ptor-xunit-grep-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.