From 427bac15a573a045a59b0663e811821492c37acd Mon Sep 17 00:00:00 2001 From: Phuong Tran Date: Sun, 17 May 2015 07:35:56 -0400 Subject: [PATCH] Screenshots for existing web pages --- Makefile | 7 ++++++- ss_test.js | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 ss_test.js diff --git a/Makefile b/Makefile index 0bf2fb8..0620ae2 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PDFS = built/DesignUseCases.pdf built/screen_sequence_diagram.pdf SCREEN_SEQUENCE_DOTS = $(wildcard screen_sequence_diagrams/*.dot) SCREEN_SEQUENCE_PNGS = $(patsubst screen_sequence_diagrams/%,built/%,$(patsubst %.dot,%.png,$(SCREEN_SEQUENCE_DOTS))) -all: built/ $(PNGS) $(PDFS) +all: built/ $(PNGS) $(PDFS) built/screenshots/ built/: mkdir -p built @@ -32,6 +32,11 @@ built/%.pdf: %.tex rm -f built/*.out rm -f built/*.toc +built/screenshots/: .PHONY + mkdir -p built/screenshots + cd built/screenshots; casperjs --ssl-protocol=tlsv1 ../../ss_test.js + +.PHONY: clean: rm -rf built/ diff --git a/ss_test.js b/ss_test.js new file mode 100644 index 0000000..1183a00 --- /dev/null +++ b/ss_test.js @@ -0,0 +1,39 @@ +//http://docs.casperjs.org/en/latest/modules/casper.html#captureselector +//Run with: casperjs --ssl-protocol=tlsv1 ss_test.js + +var casper = require('casper').create({ + viewportSize: {width: 800, height: 600} +}); + +casper.start().zoom(.9).thenOpen('https://flashy.cards/app/login', function() { + this.captureSelector('login.png','body' ); +}).thenOpen('https://flashy.cards/app/requestpasswordreset', function() { + this.captureSelector('requestpasswordreset.png', 'body'); +}).thenOpen('https://flashy.cards/app/resetpassword', function() { + this.captureSelector('resetpassword.png', 'body'); +}).thenOpen('https://flashy.cards/app/addclass', function() { + this.captureSelector('addclass.png', 'body'); +}).thenOpen('https://flashy.cards/app/deck', function() { + this.captureSelector('deck.png', 'body'); +}).thenOpen('https://flashy.cards/app/feed', function() { + this.captureSelector('feed.png', 'body'); +}).thenOpen('https://flashy.cards/app/study', function() { + this.captureSelector('study.png', 'body'); +}).thenOpen('https://flashy.cards/app/flashcard', function() { + this.captureSelector('flashcard.png', 'body'); +}).thenOpen('https://flashy.cards/app/logout', function() { + this.captureSelector('logout.png', 'body'); +}).thenOpen('https://flashy.cards/app/verifyemail', function() { + this.captureSelector('verifyemail.png', 'body'); +}); + +/*casper.start().zoom(.9).thenOpen('https://flashy.cards/app/requestpasswordreset', function() { + this.captureSelector('requestPasswordReset.png','body' ); +});*/ + +/*casper.start().zoom(.9).thenOpen('https://flashy.cards/app/feed', function() { + this.captureSelector('feed.png','body' ); +});*/ + + +casper.run(); -- 1.9.1