Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
17,342 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,2 +1,51 @@ | ||
# selenium-page-object-generator | ||
<a target="_blank" href="https://chrome.google.com/webstore/detail/epgmnmcjdhapiojbohkkemlfkegmbebb">![Try it now in Chrome Web Store](/images/chrome-web-store.png "Click here to install this extension from the Chrome Web Store")</a> | ||
|
||
|
||
Selenium Page Object Generator | ||
============================== | ||
|
||
A nimble and flexible Selenium Page Object Model generator to improve agile testing process velocity. | ||
|
||
(You need to use Chrome 40+ to try this out) | ||
|
||
Installation | ||
- | ||
To install the newest released version go to: https://chrome.google.com/webstore/detail/epgmnmcjdhapiojbohkkemlfkegmbebb . | ||
|
||
Development | ||
- | ||
To build the sources into corresponding packages, run: | ||
|
||
```bash | ||
$ gulp | ||
``` | ||
|
||
The `/dist` folder is created. | ||
|
||
Distribution | ||
- | ||
Once the changes are in-place and ready for distribution, update `package.json` with new version, and run: | ||
|
||
```bash | ||
$ gulp | ||
``` | ||
|
||
The `/dist` folder will contain ready to distribute packages. | ||
|
||
Dependencies | ||
- | ||
You’ll need to install [Node.js](https://nodejs.org/) as a local development dependency. The `npm` package manager comes bundled with all recent releases of `Node.js`. | ||
|
||
`npm install` will attempt to resolve any `npm` module dependencies that have been declared in the project’s `package.json` file, installing them into the `node_modules` folder. | ||
|
||
```bash | ||
$ npm install | ||
``` | ||
|
||
License | ||
- | ||
|
||
This browser extension is free software, licensed under: GNU Affero General Public License (AGPL-3.0). http://www.gnu.org/licenses/agpl-3.0.en.html | ||
|
||
Screenshot | ||
![screenshot](/images/popup.png) |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"operations": { | ||
"extras": { | ||
"fill": 1, | ||
"fill.submit": 1, | ||
"submit": 1, | ||
"verify.loaded": 1, | ||
"verify.url": 1 | ||
}, | ||
"letter": 5 | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"operations": { | ||
"extras": { | ||
"fill": 1, | ||
"fill.submit": 1, | ||
"submit": 1, | ||
"verify.loaded": 1, | ||
"verify.url": 1 | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"attributes": { | ||
"letter": 2, | ||
"indent": 1, | ||
"separator": "" | ||
}, | ||
"operations": { | ||
"extras": { | ||
"fill": 1, | ||
"fill.submit": 1, | ||
"submit": 1, | ||
"verify.loaded": 1, | ||
"verify.url": 1 | ||
}, | ||
"letter": 4 | ||
} | ||
} |
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,176 @@ | ||
const ASSETS = 'assets/'; | ||
const CHROME = 'chrome/'; | ||
const CHROME_CONFIGS = CHROME + ASSETS + 'configs/'; | ||
const CHROME_CSS = CHROME + ASSETS + 'css/'; | ||
const CHROME_FONTS = CHROME + ASSETS + 'fonts/'; | ||
const CHROME_ICONS = CHROME + ASSETS + 'icons/'; | ||
const CHROME_JS = CHROME + ASSETS + 'js/'; | ||
const CHROME_MANIFEST = CHROME + 'manifest.json'; | ||
const CHROME_TEMPLATES = CHROME + ASSETS + 'templates/'; | ||
const CONFIGS = 'configs/'; | ||
const FONTS = 'fonts/'; | ||
const DIST = 'dist/'; | ||
const LIBS = 'libs/'; | ||
const SRC = 'src/'; | ||
const TEMPLATES = 'templates/'; | ||
|
||
var banner = ['/*', | ||
' Selenium Page Object Generator - to improve agile testing process velocity.', | ||
' Copyright (C) 2015 Richard Huang <rickypc@users.noreply.github.com>', | ||
'', | ||
' This program is free software: you can redistribute it and/or modify', | ||
' it under the terms of the GNU Affero General Public License as', | ||
' published by the Free Software Foundation, either version 3 of the', | ||
' License, or (at your option) any later version.', | ||
'', | ||
' This program is distributed in the hope that it will be useful,', | ||
' but WITHOUT ANY WARRANTY; without even the implied warranty of', | ||
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the', | ||
' GNU Affero General Public License for more details.', | ||
'', | ||
' You should have received a copy of the GNU Affero General Public License', | ||
' along with this program. If not, see <http://www.gnu.org/licenses/>.', | ||
'*/', | ||
''].join('\n'); | ||
|
||
var concat = require('gulp-concat'); | ||
var concatcss = require('gulp-concat-css'); | ||
var del = require('del'); | ||
var es = require('event-stream'); | ||
var gulp = require('gulp'); | ||
var header = require('gulp-header'); | ||
var jshint = require('gulp-jshint'); | ||
var jsonminify = require('gulp-jsonminify'); | ||
var minifycss = require('gulp-minify-css'); | ||
var minifyhtml = require('gulp-minify-html'); | ||
var packagejson = require('./package.json'); | ||
var replace = require('gulp-replace'); | ||
var uglify = require('gulp-uglify'); | ||
var zip = require('gulp-zip'); | ||
|
||
function css(base, inputs, output) { | ||
return gulp.src(inputs, { base: base }). | ||
pipe(concatcss(output)). | ||
pipe(minifycss({ keepSpecialComments: 1 })). | ||
pipe(header(banner)). | ||
pipe(gulp.dest(DIST)); | ||
} | ||
|
||
function html(input) { | ||
return gulp.src(SRC + CHROME + input). | ||
pipe(minifyhtml()). | ||
pipe(gulp.dest(DIST + CHROME)); | ||
} | ||
|
||
function js(base, inputs, output) { | ||
return gulp.src(inputs, { base: base }). | ||
//pipe(jshint('.jshintrc')). | ||
//pipe(jshint.reporter('default')). | ||
pipe(concat(output)). | ||
pipe(uglify()). | ||
pipe(header(banner)). | ||
pipe(gulp.dest(DIST)); | ||
} | ||
|
||
gulp.task('clean', function(cb) { | ||
del(DIST, cb); | ||
}); | ||
|
||
gulp.task('chrome:copy:configs', function() { | ||
return gulp.src(CONFIGS + '**/*'). | ||
pipe(jsonminify()). | ||
pipe(gulp.dest(DIST + CHROME_CONFIGS)); | ||
}); | ||
|
||
gulp.task('chrome:copy:folders', function() { | ||
return es.merge( | ||
gulp.src(FONTS + '**/*').pipe(gulp.dest(DIST + CHROME_FONTS)), | ||
gulp.src(SRC + CHROME_ICONS + '**/*').pipe(gulp.dest(DIST + CHROME_ICONS)), | ||
gulp.src(TEMPLATES + '**/*').pipe(gulp.dest(DIST + CHROME_TEMPLATES)) | ||
); | ||
}); | ||
|
||
gulp.task('chrome:copy:manifest', function() { | ||
var name = packagejson.name.replace(/-/g, ' ').replace(/\w\S*/g, function(word) { | ||
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase(); | ||
}); | ||
|
||
return gulp.src(SRC + CHROME_MANIFEST). | ||
pipe(replace(/"author": "[^"]*",/g, '"author": "' + packagejson.author + '",')). | ||
pipe(replace(/"description": "[^"]*",/g, '"description": "' + packagejson.description + '",')). | ||
pipe(replace(/"name": "[^"]*",/g, '"name": "' + name + '",')). | ||
pipe(replace(/"version": "[^"]*"/g, '"version": "' + packagejson.version + '"')). | ||
pipe(jsonminify()). | ||
pipe(gulp.dest(DIST + CHROME)); | ||
}); | ||
|
||
gulp.task('chrome:css:options', function() { | ||
return css(SRC, [ | ||
SRC + CHROME_CSS + 'options.css', | ||
SRC + CHROME_CSS + 'preloader.css' | ||
], CHROME_CSS + 'options.css'); | ||
}); | ||
|
||
gulp.task('chrome:css:popup', function() { | ||
return css(SRC, [ | ||
SRC + CHROME_CSS + 'popup.css', | ||
SRC + CHROME_CSS + 'preloader.css', | ||
SRC + CHROME_CSS + 'notify.css' | ||
], CHROME_CSS + 'popup.css'); | ||
}); | ||
|
||
gulp.task('chrome:dist', function() { | ||
return gulp.src(DIST + CHROME + '**/*'). | ||
pipe(zip(packagejson.name + '-' + packagejson.version + '.zip')). | ||
pipe(gulp.dest(DIST)); | ||
}); | ||
|
||
gulp.task('chrome:html:options', function() { | ||
return html('options.html'); | ||
}); | ||
|
||
gulp.task('chrome:html:popup', function() { | ||
return html('popup.html'); | ||
}); | ||
|
||
gulp.task('chrome:js:generator', function() { | ||
return js(SRC, [ | ||
SRC + CHROME_JS + 'common.js', | ||
SRC + CHROME_JS + 'generator.js' | ||
], CHROME_JS + 'generator.js'); | ||
}); | ||
|
||
gulp.task('chrome:js:options', function() { | ||
return js(SRC, [ | ||
LIBS + 'jquery-2.1.4.js', | ||
SRC + CHROME_JS + 'preloader.js', | ||
SRC + CHROME_JS + 'common.js', | ||
SRC + CHROME_JS + 'options.js' | ||
], CHROME_JS + 'options.js'); | ||
}); | ||
|
||
gulp.task('chrome:js:popup', function() { | ||
return js(SRC, [ | ||
LIBS + 'jquery-2.1.4.js', | ||
LIBS + 'handlebars-v3.0.3.js', | ||
SRC + CHROME_JS + 'preloader.js', | ||
SRC + CHROME_JS + 'notify.js', | ||
SRC + CHROME_JS + 'social.js', | ||
SRC + CHROME_JS + 'common.js', | ||
SRC + CHROME_JS + 'helpers.js', | ||
SRC + CHROME_JS + 'popup.js' | ||
], CHROME_JS + 'popup.js'); | ||
}); | ||
|
||
gulp.task('chrome', [ | ||
'chrome:copy:configs', 'chrome:copy:folders', 'chrome:copy:manifest', | ||
'chrome:css:options', 'chrome:css:popup', | ||
'chrome:html:options', 'chrome:html:popup', | ||
'chrome:js:generator', 'chrome:js:options', 'chrome:js:popup' | ||
], function() { | ||
gulp.start('chrome:dist'); | ||
}); | ||
|
||
gulp.task('default', [ 'clean' ], function() { | ||
gulp.start('chrome'); | ||
}); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.