forked from bcole/protractor-angular-screenshot-reporter
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from Evilweed/mergecssandtime
Merge changes for time coloring and screenshots exception handling
- Loading branch information
Showing
10 changed files
with
1,869 additions
and
1,361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ npm-debug.log | |
.idea/ | ||
tmp/ | ||
.npmrc | ||
package-lock.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,80 @@ | ||
module.exports = function(grunt) { | ||
|
||
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | ||
|
||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
|
||
shell: { | ||
"options": { | ||
stdout: true | ||
}, | ||
"selenium": { | ||
command: './selenium/start', | ||
options: { | ||
stdout: false, | ||
async: true | ||
} | ||
}, | ||
"protractor_install": { | ||
command: 'node ./node_modules/protractor/bin/webdriver-manager update' | ||
}, | ||
"webdriver_start": { | ||
command: 'node ./node_modules/protractor/bin/webdriver-manager start' | ||
}, | ||
"npm_install": { | ||
command: 'npm install' | ||
} | ||
}, | ||
|
||
protractor: { | ||
options: { | ||
keepAlive: true, | ||
configFile: "protractor.jasmine2.conf.js" | ||
}, | ||
singlerun: {}, | ||
auto: { | ||
keepAlive: true, | ||
options: { | ||
args: { | ||
seleniumPort: 4444 | ||
} | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const reportsTmpPath = ('./reports-tmp'); | ||
module.exports = function (grunt) { | ||
|
||
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | ||
|
||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
|
||
shell: { | ||
"options": { | ||
stdout: true | ||
}, | ||
"selenium": { | ||
command: './selenium/start', | ||
options: { | ||
stdout: false, | ||
async: true | ||
} | ||
}, | ||
"protractor_install": { | ||
command: 'node ./node_modules/protractor/bin/webdriver-manager update' | ||
}, | ||
"webdriver_start": { | ||
command: 'node ./node_modules/protractor/bin/webdriver-manager start' | ||
}, | ||
"npm_install": { | ||
command: 'npm install' | ||
} | ||
}, | ||
|
||
protractor: { | ||
options: { | ||
keepAlive: true, | ||
configFile: "protractor.jasmine2.conf.js" | ||
}, | ||
singlerun: {}, | ||
auto: { | ||
keepAlive: true, | ||
options: { | ||
args: { | ||
seleniumPort: 4444 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
}); | ||
}); | ||
|
||
|
||
grunt.registerTask('test:e2e', ['protractor:singlerun']); | ||
grunt.registerTask('install', ['update','shell:protractor_install']); | ||
grunt.registerTask('update', ['shell:npm_install']); | ||
grunt.registerTask('test:e2e', ['protractor:singlerun']); | ||
grunt.registerTask('install', ['update', 'shell:protractor_install']); | ||
grunt.registerTask('update', ['shell:npm_install']); | ||
grunt.registerTask('unescape-combined-json', () => { | ||
const CircularJSON = require('circular-json'); | ||
|
||
const dirContents = fs.readdirSync(reportsTmpPath); | ||
for (let entry of dirContents) { | ||
let fpath = path.resolve(reportsTmpPath, entry); | ||
if (fs.statSync(fpath).isDirectory()) { | ||
const jsonFile=path.join(fpath, 'combined.json'); | ||
const text = fs.readFileSync(jsonFile).toString(); | ||
|
||
if (text && text[0] === `"`) { | ||
console.log(`unescaped combined.json in '${entry}'`); | ||
const cs = CircularJSON.parse(text); | ||
const obj = JSON.parse(cs); | ||
const str = JSON.stringify(obj, null, 4); | ||
fs.writeFileSync(jsonFile,str); | ||
} else {//else do nothing as the file is already unescaped | ||
console.log(`doing nothing combined json in '${entry}' is already unescaped`); | ||
} | ||
|
||
} | ||
} | ||
|
||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.