This repository has been archived by the owner on Dec 20, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #1559 from locaweb/wraith
Wraith - Teste de Regressão
- Loading branch information
Showing
56 changed files
with
175 additions
and
4 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
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
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.
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.
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.
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.
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.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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,53 @@ | ||
#Headless browser option | ||
browser: | ||
phantomjs: "phantomjs" | ||
# slimerjs: "slimerjs" | ||
|
||
#If you want to have multiple snapping files, set the file name here | ||
snap_file: "spec/wraith/javascript/snap.js" | ||
|
||
# Type the name of the directory that shots will be stored in | ||
directory: 'spec/wraith/test_shots' | ||
history_dir: 'spec/wraith/baseline_shots' | ||
|
||
# Add only 2 domains, key will act as a label | ||
domains: | ||
local: "http://localhost:4567" | ||
|
||
#Type screen widths below, here are a couple of examples | ||
screen_widths: | ||
- 320 | ||
- 768 | ||
- 1024 | ||
- 1280 | ||
|
||
#Type page URL paths below, here are a couple of examples | ||
paths: | ||
revenda_prepanel: /documentacao/exemplos/painel1/pre-painel | ||
revenda_home: /documentacao/exemplos/painel1/home | ||
revenda_clients: /documentacao/exemplos/painel1/clients | ||
revenda_client: /documentacao/exemplos/painel1/client | ||
smtp_prepanel: /documentacao/exemplos/painel2/pre-painel | ||
smtp_home: /documentacao/exemplos/painel2/home | ||
smtp_report: /documentacao/exemplos/painel2/stats | ||
smtp_config: /documentacao/exemplos/painel2/config-server | ||
smtp_config_email: /documentacao/exemplos/painel2/config-email | ||
login: /documentacao/exemplos/login-screen | ||
error_404: /documentacao/exemplos/erro-404 | ||
# all_elements: /documentacao/cartilha-de-elementos/ | ||
boilerplate: /documentacao/exemplos/boilerplate | ||
|
||
#Amount of fuzz ImageMagick will use | ||
fuzz: '15%' | ||
|
||
#Set the number of days to keep the site spider file | ||
spider_days: | ||
- 10 | ||
|
||
#Choose how results are displayed, by default alphanumeric. Different screen widths are always grouped. | ||
#alphanumeric - all paths (with, and without, a difference) are shown, sorted by path | ||
#diffs_first - all paths (with, and without, a difference) are shown, sorted by difference size (largest first) | ||
#diffs_only - only paths with a difference are shown, sorted by difference size (largest first) | ||
mode: diffs_first | ||
|
||
threshold: 0.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,25 @@ | ||
var system = require('system'); | ||
var page = require('webpage').create(); | ||
var fs = require('fs'); | ||
var casper = require("casper").create(); | ||
|
||
var url = casper.cli.get(0); | ||
var view_port_width = casper.cli.get(1); | ||
var image_name = casper.cli.get(2); | ||
var selector = casper.cli.get(3); | ||
|
||
casper.start(url, function() { | ||
this.viewport(view_port_width, 1500).then(function(){ | ||
this.wait(2000, function() { | ||
if (selector == undefined) { | ||
this.capture(image_name); | ||
} | ||
else { | ||
this.captureSelector(image_name, selector); | ||
} | ||
console.log('Snapping ' + url + ' at width ' + view_port_width); | ||
}); | ||
}); | ||
}); | ||
|
||
casper.run(); |
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,85 @@ | ||
var system = require('system'); | ||
var page = require('webpage').create(); | ||
var fs = require('fs'); | ||
|
||
if (system.args.length === 3) { | ||
console.log('Usage: snap.js <some URL> <view port width> <target image name>'); | ||
phantom.exit(); | ||
} | ||
|
||
var url = system.args[1]; | ||
var image_name = system.args[3]; | ||
var view_port_width = system.args[2]; | ||
var current_requests = 0; | ||
var last_request_timeout; | ||
var final_timeout; | ||
|
||
|
||
page.viewportSize = { width: view_port_width, height: 1500}; | ||
page.settings = { loadImages: true, javascriptEnabled: true }; | ||
|
||
// If you want to use additional phantomjs commands, place them here | ||
page.settings.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.17'; | ||
|
||
// You can place custom headers here, example below. | ||
// page.customHeaders = { | ||
|
||
// 'X-Candy-OVERRIDE': 'https://api.live.bbc.co.uk/' | ||
|
||
// }; | ||
|
||
// If you want to set a cookie, just add your details below in the following way. | ||
|
||
// phantom.addCookie({ | ||
// 'name': 'ckns_policy', | ||
// 'value': '111', | ||
// 'domain': '.bbc.co.uk' | ||
// }); | ||
// phantom.addCookie({ | ||
// 'name': 'locserv', | ||
// 'value': '1#l1#i=6691484:n=Oxford+Circus:h=e@w1#i=8:p=London@d1#1=l:2=e:3=e:4=2@n1#r=40', | ||
// 'domain': '.bbc.co.uk' | ||
// }); | ||
|
||
page.onResourceRequested = function(req) { | ||
current_requests += 1; | ||
}; | ||
|
||
page.onResourceReceived = function(res) { | ||
if (res.stage === 'end') { | ||
current_requests -= 1; | ||
debounced_render(); | ||
} | ||
}; | ||
|
||
page.open(url, function(status) { | ||
if (status !== 'success') { | ||
console.log('Error with page ' + url); | ||
phantom.exit(); | ||
} | ||
}); | ||
|
||
|
||
function debounced_render() { | ||
clearTimeout(last_request_timeout); | ||
clearTimeout(final_timeout); | ||
|
||
// If there's no more ongoing resource requests, wait for 1 second before | ||
// rendering, just in case the page kicks off another request | ||
if (current_requests < 1) { | ||
clearTimeout(final_timeout); | ||
last_request_timeout = setTimeout(function() { | ||
console.log('Snapping ' + url + ' at width ' + view_port_width); | ||
page.render(image_name); | ||
phantom.exit(); | ||
}, 1000); | ||
} | ||
|
||
// Sometimes, straggling requests never make it back, in which | ||
// case, timeout after 5 seconds and render the page anyway | ||
final_timeout = setTimeout(function() { | ||
console.log('Snapping ' + url + ' at width ' + view_port_width); | ||
page.render(image_name); | ||
phantom.exit(); | ||
}, 5000); | ||
} |