jasmine-headless-webkit-firstbanco 0.9.0.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.rspec +1 -0
- data/CHANGELOG.md +89 -0
- data/Gemfile +30 -0
- data/Guardfile +41 -0
- data/README.md +44 -0
- data/Rakefile +65 -0
- data/bin/jasmine-headless-webkit +11 -0
- data/config/cucumber.yml +2 -0
- data/ext/jasmine-webkit-specrunner/Info.plist +22 -0
- data/ext/jasmine-webkit-specrunner/Makefile.dummy +5 -0
- data/ext/jasmine-webkit-specrunner/Page.cpp +15 -0
- data/ext/jasmine-webkit-specrunner/Page.h +20 -0
- data/ext/jasmine-webkit-specrunner/Runner.cpp +208 -0
- data/ext/jasmine-webkit-specrunner/Runner.h +73 -0
- data/ext/jasmine-webkit-specrunner/common.pri +8 -0
- data/ext/jasmine-webkit-specrunner/extconf.rb +10 -0
- data/ext/jasmine-webkit-specrunner/specrunner.cpp +79 -0
- data/ext/jasmine-webkit-specrunner/specrunner.pro +5 -0
- data/features/bin/failure.feature +7 -0
- data/features/bin/files.feature +7 -0
- data/features/bin/filtered_run/both_runs.feature +18 -0
- data/features/bin/filtered_run/no_full_run.feature +14 -0
- data/features/bin/help.feature +7 -0
- data/features/bin/quiet_messages.feature +8 -0
- data/features/bin/runner_out.feature +8 -0
- data/features/bin/spec_files_with_same_basename.feature +7 -0
- data/features/bin/success.feature +20 -0
- data/features/bin/success_with_js_error.feature +5 -0
- data/features/bin/tries_to_leave_page.feature +7 -0
- data/features/bin/try_to_click_a_button.feature +7 -0
- data/features/bin/two_files_from_src_files.feature +11 -0
- data/features/bin/with_coffeescript_error.feature +7 -0
- data/features/bin/with_console_log.feature +7 -0
- data/features/bin/with_server.feature +7 -0
- data/features/bin/with_window_prompt.feature +7 -0
- data/features/reporters.feature +24 -0
- data/features/runner.feature +34 -0
- data/features/steps/given/i_have_test_suite.rb +2 -0
- data/features/steps/given/no_existing_file.rb +4 -0
- data/features/steps/given/options/i_have_defaults.rb +4 -0
- data/features/steps/given/options/i_have_reporters.rb +10 -0
- data/features/steps/given/options/i_have_runner_options.rb +3 -0
- data/features/steps/then/bin/exit_status_should_be.rb +3 -0
- data/features/steps/then/bin/file_should_contain_runner.rb +4 -0
- data/features/steps/then/bin/following_files_loaded_in_order.rb +10 -0
- data/features/steps/then/bin/i_should_get_help_output.rb +4 -0
- data/features/steps/then/bin/output_should_include.rb +3 -0
- data/features/steps/then/bin/output_should_not_include.rb +4 -0
- data/features/steps/then/reporting/report_does_not_exist.rb +4 -0
- data/features/steps/then/reporting/report_should_exist.rb +3 -0
- data/features/steps/then/reporting/report_should_have.rb +7 -0
- data/features/steps/then/reporting/report_should_have_seed.rb +4 -0
- data/features/steps/then/runner/it_should_have_exit_status.rb +3 -0
- data/features/steps/then/runner/it_should_include_report_file.rb +4 -0
- data/features/steps/then/runner/it_should_not_include_report_file.rb +3 -0
- data/features/steps/then/templates/it_should_use_reporter.rb +6 -0
- data/features/steps/when/i_delete_file.rb +3 -0
- data/features/steps/when/i_get_runner.rb +4 -0
- data/features/steps/when/i_get_template_writer.rb +4 -0
- data/features/steps/when/i_run_executable.rb +4 -0
- data/features/steps/when/i_run_runner.rb +4 -0
- data/features/support/env.rb +7 -0
- data/jasmine-headless-webkit-firstbanco.gemspec +30 -0
- data/lib/autotest/discover.rb +1 -0
- data/lib/autotest/jasmine.rb +7 -0
- data/lib/autotest/jasmine_mixin.rb +111 -0
- data/lib/autotest/jasmine_rspec2.rb +7 -0
- data/lib/jasmine-headless-webkit.rb +3 -0
- data/lib/jasmine/headless.rb +61 -0
- data/lib/jasmine/headless/cacheable_action.rb +85 -0
- data/lib/jasmine/headless/coffee_script_cache.rb +20 -0
- data/lib/jasmine/headless/coffee_template.rb +36 -0
- data/lib/jasmine/headless/command_line.rb +31 -0
- data/lib/jasmine/headless/css_template.rb +19 -0
- data/lib/jasmine/headless/errors.rb +16 -0
- data/lib/jasmine/headless/file_checker.rb +25 -0
- data/lib/jasmine/headless/files_list.rb +332 -0
- data/lib/jasmine/headless/js_template.rb +23 -0
- data/lib/jasmine/headless/jst_template.rb +15 -0
- data/lib/jasmine/headless/nil_template.rb +14 -0
- data/lib/jasmine/headless/options.rb +206 -0
- data/lib/jasmine/headless/railtie.rb +12 -0
- data/lib/jasmine/headless/report.rb +81 -0
- data/lib/jasmine/headless/report_message.rb +12 -0
- data/lib/jasmine/headless/report_message/console.rb +18 -0
- data/lib/jasmine/headless/report_message/error.rb +20 -0
- data/lib/jasmine/headless/report_message/fail.rb +5 -0
- data/lib/jasmine/headless/report_message/pass.rb +5 -0
- data/lib/jasmine/headless/report_message/seed.rb +14 -0
- data/lib/jasmine/headless/report_message/spec.rb +28 -0
- data/lib/jasmine/headless/report_message/total.rb +31 -0
- data/lib/jasmine/headless/runner.rb +264 -0
- data/lib/jasmine/headless/spec_file_analyzer.rb +44 -0
- data/lib/jasmine/headless/task.rb +39 -0
- data/lib/jasmine/headless/template_writer.rb +65 -0
- data/lib/jasmine/headless/unique_asset_list.rb +16 -0
- data/lib/jasmine/headless/version.rb +5 -0
- data/lib/qt/qmake.rb +155 -0
- data/script/gemfile +11 -0
- data/script/hooks/post-commit +4 -0
- data/script/hooks/pre-commit +15 -0
- data/script/initialize-environment +35 -0
- data/script/install-git-hooks +6 -0
- data/skel/template.html.erb +77 -0
- data/spec/files/UTF-8-test.txt +0 -0
- data/spec/integration/randomization_spec.rb +13 -0
- data/spec/integration/specify_runner_file_spec.rb +22 -0
- data/spec/integration/sprockets_spec.rb +23 -0
- data/spec/jasmine/click_button/click_button.js +5 -0
- data/spec/jasmine/click_button/click_button.yml +12 -0
- data/spec/jasmine/click_button/click_button_spec.js +11 -0
- data/spec/jasmine/coffeescript_error/coffeescript_error.yml +10 -0
- data/spec/jasmine/coffeescript_error/spec.coffee +2 -0
- data/spec/jasmine/coffeescript_error/src.coffee +2 -0
- data/spec/jasmine/console_log/console_log.js +1 -0
- data/spec/jasmine/console_log/console_log.yml +10 -0
- data/spec/jasmine/console_log/console_log_spec.js +7 -0
- data/spec/jasmine/failure/failure.js +1 -0
- data/spec/jasmine/failure/failure.yml +9 -0
- data/spec/jasmine/failure/failure_spec.js +6 -0
- data/spec/jasmine/filtered_failure/failure_spec.js +6 -0
- data/spec/jasmine/filtered_failure/filtered_failure.yml +10 -0
- data/spec/jasmine/filtered_failure/src.js +0 -0
- data/spec/jasmine/filtered_failure/success_spec.js +6 -0
- data/spec/jasmine/filtered_success/filtered_success.yml +10 -0
- data/spec/jasmine/filtered_success/src.js +0 -0
- data/spec/jasmine/filtered_success/success_one_spec.js +6 -0
- data/spec/jasmine/filtered_success/success_other_file.js +7 -0
- data/spec/jasmine/filtered_success/success_two_spec.js +6 -0
- data/spec/jasmine/filtered_success_with_console/filtered_success.yml +10 -0
- data/spec/jasmine/filtered_success_with_console/src.js +0 -0
- data/spec/jasmine/filtered_success_with_console/success_one_spec.js +7 -0
- data/spec/jasmine/filtered_success_with_console/success_two_spec.js +6 -0
- data/spec/jasmine/leave_page/leave_page.js +4 -0
- data/spec/jasmine/leave_page/leave_page.yml +9 -0
- data/spec/jasmine/leave_page/leave_page_spec.js +11 -0
- data/spec/jasmine/noisy/file.js.erb +0 -0
- data/spec/jasmine/noisy/noisy.yml +8 -0
- data/spec/jasmine/noisy/other_file.js +2 -0
- data/spec/jasmine/runner_out_in_jasmine_yml/jasmine.yml +11 -0
- data/spec/jasmine/runner_out_in_jasmine_yml/test.js +2 -0
- data/spec/jasmine/runner_out_in_jasmine_yml/test_spec.coffee +4 -0
- data/spec/jasmine/success/success.js +1 -0
- data/spec/jasmine/success/success.yml +9 -0
- data/spec/jasmine/success/success_spec.js +6 -0
- data/spec/jasmine/success_with_error/success_with_error.js +3 -0
- data/spec/jasmine/success_with_error/success_with_error.yml +9 -0
- data/spec/jasmine/success_with_error/success_with_error_spec.js +6 -0
- data/spec/jasmine/two_files_from_src_files/app/app-file.js +0 -0
- data/spec/jasmine/two_files_from_src_files/app/app.js +2 -0
- data/spec/jasmine/two_files_from_src_files/jasmine.yml +7 -0
- data/spec/jasmine/two_files_from_src_files/vendor/vendor-file.js +0 -0
- data/spec/jasmine/two_files_from_src_files/vendor/vendor.js +2 -0
- data/spec/jasmine/two_spec_files_same_basename/jasmine.yml +6 -0
- data/spec/jasmine/two_spec_files_same_basename/spec.coffee +4 -0
- data/spec/jasmine/two_spec_files_same_basename/spec.js +6 -0
- data/spec/jasmine/window_prompt/source.js +2 -0
- data/spec/jasmine/window_prompt/window_prompt.yml +4 -0
- data/spec/jasmine/with_sprockets_includes/assets/application.js.erb +2 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/code.js +6 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/jquery.string.js +0 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/required.js +3 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/subcode/more_code.js +2 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/templates/that.jst.ejs +1 -0
- data/spec/jasmine/with_sprockets_includes/assets/things/templates/this.jst +2 -0
- data/spec/jasmine/with_sprockets_includes/spec/spec_helper.js +1 -0
- data/spec/jasmine/with_sprockets_includes/spec/things/code_spec.js +9 -0
- data/spec/jasmine/with_sprockets_includes/with_sprockets_includes.yml +12 -0
- data/spec/javascripts/console.log_spec.coffee +15 -0
- data/spec/javascripts/headless_reporter_result_spec.coffee +30 -0
- data/spec/javascripts/helpers/spec_helper.coffee +2 -0
- data/spec/javascripts/jasmine-extensions_spec.coffee +80 -0
- data/spec/javascripts/jasmine.HeadlessReporter.ConsoleBase_spec.coffee +35 -0
- data/spec/javascripts/jasmine.HeadlessReporter.Console_spec.coffee +3 -0
- data/spec/javascripts/jasmine.HeadlessReporter.Tap_spec.coffee +19 -0
- data/spec/javascripts/jasmine.HeadlessReporter_spec.coffee +27 -0
- data/spec/javascripts/support/jasmine.yml +9 -0
- data/spec/lib/jasmine/headless/cacheable_action_spec.rb +122 -0
- data/spec/lib/jasmine/headless/coffee_script_cache_spec.rb +21 -0
- data/spec/lib/jasmine/headless/coffee_template_spec.rb +55 -0
- data/spec/lib/jasmine/headless/css_template_spec.rb +25 -0
- data/spec/lib/jasmine/headless/file_checker_spec.rb +41 -0
- data/spec/lib/jasmine/headless/files_list_spec.rb +194 -0
- data/spec/lib/jasmine/headless/js_template_spec.rb +31 -0
- data/spec/lib/jasmine/headless/jst_template_spec.rb +21 -0
- data/spec/lib/jasmine/headless/nil_template_spec.rb +31 -0
- data/spec/lib/jasmine/headless/options_spec.rb +194 -0
- data/spec/lib/jasmine/headless/report_message/seed_spec.rb +18 -0
- data/spec/lib/jasmine/headless/report_message/spec_spec.rb +20 -0
- data/spec/lib/jasmine/headless/report_spec.rb +95 -0
- data/spec/lib/jasmine/headless/runner_spec.rb +247 -0
- data/spec/lib/jasmine/headless/spec_file_analyzer_spec.rb +68 -0
- data/spec/lib/jasmine/headless/task_spec.rb +92 -0
- data/spec/lib/jasmine/headless/template_writer_spec.rb +92 -0
- data/spec/lib/jasmine/headless/unique_asset_list_spec.rb +22 -0
- data/spec/lib/jasmine/headless_spec.rb +38 -0
- data/spec/lib/qt/qmake_spec.rb +142 -0
- data/spec/skel/template.html.erb_spec.rb +8 -0
- data/spec/spec_helper.rb +113 -0
- data/vendor/assets/coffeescripts/headless_reporter_result.coffee +49 -0
- data/vendor/assets/coffeescripts/prolog.coffee +100 -0
- data/vendor/assets/javascripts/beautify-html.js +463 -0
- data/vendor/assets/javascripts/headless_reporter_result.js +79 -0
- data/vendor/assets/javascripts/intense.coffee +28 -0
- data/vendor/assets/javascripts/jasmine-extensions.coffee +97 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.Console.coffee +8 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.ConsoleBase.coffee +92 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.File.coffee +24 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.Tap.coffee +28 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.Verbose.coffee +64 -0
- data/vendor/assets/javascripts/jasmine.HeadlessReporter.coffee +58 -0
- data/vendor/assets/javascripts/jsDump.js +209 -0
- data/vendor/assets/javascripts/prolog.js +108 -0
- metadata +347 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
#ifndef JHW_RUNNER
|
2
|
+
#define JHW_RUNNER
|
3
|
+
|
4
|
+
#include <QtGui>
|
5
|
+
#include <QtWebKit>
|
6
|
+
#include <QFile>
|
7
|
+
#include <QTextStream>
|
8
|
+
#include <iostream>
|
9
|
+
#include <fstream>
|
10
|
+
#include <sstream>
|
11
|
+
#include <QQueue>
|
12
|
+
#include <QApplication>
|
13
|
+
|
14
|
+
#include "Page.h"
|
15
|
+
|
16
|
+
using namespace std;
|
17
|
+
|
18
|
+
class Runner: public QObject {
|
19
|
+
Q_OBJECT
|
20
|
+
public:
|
21
|
+
enum { TIMER_TICK = 200, MAX_LOOPS = 50 };
|
22
|
+
|
23
|
+
Runner();
|
24
|
+
void setColors(bool colors);
|
25
|
+
void setReportFiles(QStack<QString> &files);
|
26
|
+
void setSeed(QString s);
|
27
|
+
void setQuiet(bool q);
|
28
|
+
|
29
|
+
void addFile(const QString &spec);
|
30
|
+
void go();
|
31
|
+
|
32
|
+
public slots:
|
33
|
+
void timerPause();
|
34
|
+
void timerDone();
|
35
|
+
void hasUsedConsole();
|
36
|
+
void hasError();
|
37
|
+
void hasSpecFailure();
|
38
|
+
|
39
|
+
bool isQuiet();
|
40
|
+
QString getSeed();
|
41
|
+
|
42
|
+
void print(const QString &fh, const QString &content);
|
43
|
+
void finishSuite();
|
44
|
+
void ping();
|
45
|
+
|
46
|
+
private slots:
|
47
|
+
void watch(bool ok);
|
48
|
+
void addJHW();
|
49
|
+
void timerEvent();
|
50
|
+
void handleError(const QString & message, int lineNumber, const QString & sourceID);
|
51
|
+
|
52
|
+
private:
|
53
|
+
Page page;
|
54
|
+
QTimer ticker;
|
55
|
+
int runs;
|
56
|
+
bool hasErrors;
|
57
|
+
bool _hasSpecFailure;
|
58
|
+
bool usedConsole;
|
59
|
+
bool isFinished;
|
60
|
+
bool useColors;
|
61
|
+
bool quiet;
|
62
|
+
|
63
|
+
QString seed;
|
64
|
+
|
65
|
+
QQueue<QString> runnerFiles;
|
66
|
+
QStack<QString> reportFiles;
|
67
|
+
|
68
|
+
void loadSpec();
|
69
|
+
|
70
|
+
QQueue<QFile *> outputFiles;
|
71
|
+
};
|
72
|
+
|
73
|
+
#endif
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
$: << File.expand_path("../../../lib", __FILE__)
|
4
|
+
|
5
|
+
require 'qt/qmake'
|
6
|
+
|
7
|
+
system %{make clean}
|
8
|
+
Qt::Qmake.make!('jasmine-headless-webkit', 'specrunner.pro')
|
9
|
+
|
10
|
+
FileUtils.cp File.expand_path('../Makefile.dummy', __FILE__), File.expand_path('../Makefile', __FILE__)
|
@@ -0,0 +1,79 @@
|
|
1
|
+
/*
|
2
|
+
Copyright (c) 2010 Sencha Inc.
|
3
|
+
Copyright (c) 2011 John Bintz
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
22
|
+
*/
|
23
|
+
|
24
|
+
#include "Runner.h"
|
25
|
+
|
26
|
+
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
27
|
+
#error Use Qt 4.7 or later version
|
28
|
+
#endif
|
29
|
+
|
30
|
+
int main(int argc, char** argv)
|
31
|
+
{
|
32
|
+
bool showColors = false;
|
33
|
+
bool isQuiet = false;
|
34
|
+
QString seed;
|
35
|
+
QStack<QString> reporterFiles;
|
36
|
+
|
37
|
+
int c, index;
|
38
|
+
|
39
|
+
while ((c = getopt(argc, argv, "cr:s:q")) != -1) {
|
40
|
+
switch(c) {
|
41
|
+
case 'c':
|
42
|
+
showColors = true;
|
43
|
+
break;
|
44
|
+
case 'q':
|
45
|
+
isQuiet = true;
|
46
|
+
break;
|
47
|
+
case 'r':
|
48
|
+
reporterFiles.push(QString(optarg));
|
49
|
+
break;
|
50
|
+
case 's':
|
51
|
+
seed = QString(optarg);
|
52
|
+
break;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
if (optind == argc) {
|
57
|
+
std::cerr << "Run Jasmine's SpecRunner headlessly" << std::endl << std::endl;
|
58
|
+
std::cerr << " specrunner [-c] [-s seed] [-r report file ...] specrunner.html ..." << std::endl;
|
59
|
+
return 1;
|
60
|
+
}
|
61
|
+
|
62
|
+
QApplication app(argc, argv);
|
63
|
+
app.setApplicationName("jasmine-headless-webkit");
|
64
|
+
Runner runner;
|
65
|
+
|
66
|
+
runner.setColors(showColors);
|
67
|
+
runner.setQuiet(isQuiet);
|
68
|
+
runner.setReportFiles(reporterFiles);
|
69
|
+
runner.setSeed(seed);
|
70
|
+
|
71
|
+
for (index = optind; index < argc; index++) {
|
72
|
+
runner.addFile(QString::fromLocal8Bit(argv[index]));
|
73
|
+
}
|
74
|
+
|
75
|
+
runner.go();
|
76
|
+
|
77
|
+
return app.exec();
|
78
|
+
}
|
79
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - Failure
|
2
|
+
Scenario: Run a failing test
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/failure/failure.yml -f File:spec/report.txt`
|
5
|
+
Then the exit status should be 1
|
6
|
+
And the report file "spec/report.txt" should have 1 total, 1 failure, no console usage
|
7
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - Files
|
2
|
+
Scenario: List the files a test suite will use
|
3
|
+
Given I have a test suite
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml -l`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the output should include "spec/jasmine/success/success.js"
|
7
|
+
And the output should include "spec/jasmine/success/success_spec.js"
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Feature: Bin - Filtered Run - Both Runs
|
2
|
+
Background:
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
|
5
|
+
Scenario: Run one and fail
|
6
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_failure/filtered_failure.yml -f File:spec/report.txt ./spec/jasmine/filtered_failure/failure_spec.js`
|
7
|
+
Then the exit status should be 1
|
8
|
+
And the report file "spec/report.txt" should have 1 total, 1 failure, no console usage
|
9
|
+
|
10
|
+
Scenario: Run both and succeed
|
11
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success/filtered_success.yml -f File:spec/report.txt ./spec/jasmine/filtered_success/success_one_spec.js`
|
12
|
+
Then the exit status should be 0
|
13
|
+
And the report file "spec/report.txt" should have 2 total, 0 failures, no console usage
|
14
|
+
|
15
|
+
Scenario: Run both with console.log
|
16
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success_with_console/filtered_success.yml -f File:spec/report.txt ./spec/jasmine/filtered_success_with_console/success_one_spec.js`
|
17
|
+
Then the exit status should be 2
|
18
|
+
And the report file "spec/report.txt" should have 2 total, 0 failures, yes console usage
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: Bin - No Full Run
|
2
|
+
Background:
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
|
5
|
+
Scenario: Only run the filtered run
|
6
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success/filtered_success.yml -f File:spec/report.txt --no-full-run ./spec/jasmine/filtered_success/success_one_spec.js`
|
7
|
+
Then the exit status should be 0
|
8
|
+
And the report file "spec/report.txt" should have 1 total, 0 failure, no console usage
|
9
|
+
|
10
|
+
Scenario: Use a file outside of the normal test run
|
11
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/filtered_success/filtered_success.yml -f File:spec/report.txt ./spec/jasmine/filtered_success/success_other_file.js`
|
12
|
+
Then the exit status should be 0
|
13
|
+
And the report file "spec/report.txt" should have 1 total, 0 failure, no console usage
|
14
|
+
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Feature: Bin - Quiet Messages
|
2
|
+
Scenario: Run a test that would cause a lot of messages to be displayed and silence them all
|
3
|
+
Given I have a test suite
|
4
|
+
When I run `bin/jasmine-headless-webkit -q -j spec/jasmine/noisy/noisy.yml`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the output should not include "[Skipping File]"
|
7
|
+
And the output should not include "You should mock"
|
8
|
+
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Feature: Bin - Runner Out
|
2
|
+
Scenario: Write out the runner to a specified file
|
3
|
+
Given I have a test suite
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml --runner-out spec/runner.html`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the file "spec/runner.html" should contain a JHW runner
|
7
|
+
When I delete the file "spec/runner.html"
|
8
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - Two spec files with same basename
|
2
|
+
Scenario: Run both files
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/two_spec_files_same_basename/jasmine.yml -f File:spec/report.txt`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the report file "spec/report.txt" should have 2 total, 0 failures, no console usage
|
7
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: Bin - Success
|
2
|
+
Scenario: Run a successful test with long format definition
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit --seed 1234 -j spec/jasmine/success/success.yml --format File --out spec/report.txt`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage
|
7
|
+
And the report file "spec/report.txt" should have seed 1234
|
8
|
+
|
9
|
+
Scenario: Run a successful test with legacy file reporting
|
10
|
+
Given there is no existing "spec/report.txt" file
|
11
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml --report spec/report.txt`
|
12
|
+
Then the exit status should be 0
|
13
|
+
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage
|
14
|
+
|
15
|
+
Scenario: Run a successful test with shortened format definition
|
16
|
+
Given there is no existing "spec/report.txt" file
|
17
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml -f File:spec/report.txt`
|
18
|
+
Then the exit status should be 0
|
19
|
+
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage
|
20
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - Try to Leave Page
|
2
|
+
Scenario: Fail on trying to leave the page
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/leave_page/leave_page.yml -f File:spec/report.txt`
|
5
|
+
Then the exit status should be 1
|
6
|
+
And the report file "spec/report.txt" should exist
|
7
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - Try to Click A Button
|
2
|
+
Scenario: Don't leave page when clicking a button
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/click_button/click_button.yml -f File:spec/report.txt`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the report file "spec/report.txt" should have 0 total, 0 failures, no console usage
|
7
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Feature: Two files from source files
|
2
|
+
Scenario: Files are ordered directly
|
3
|
+
Given I have a test suite
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/two_files_from_src_files/jasmine.yml -l`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the following files should be loaded in order:
|
7
|
+
| vendor/vendor-file.js |
|
8
|
+
| vendor/vendor.js |
|
9
|
+
| app/app-file.js |
|
10
|
+
| app/app.js |
|
11
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - With CoffeeScript error
|
2
|
+
Scenario: Fail on CoffeeScript error
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/coffeescript_error/coffeescript_error.yml -f File:spec/report.txt`
|
5
|
+
Then the exit status should be 1
|
6
|
+
And the report file "spec/report.txt" should not exist
|
7
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Use console.log
|
2
|
+
Scenario: Run a successful test that uses console.log
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/console_log/console_log.yml -f File:spec/report.txt`
|
5
|
+
Then the exit status should be 2
|
6
|
+
And the report file "spec/report.txt" should have 1 total, 0 failures, yes console usage
|
7
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - With Server
|
2
|
+
Scenario: Run using an HTTP server
|
3
|
+
Given there is no existing "spec/report.txt" file
|
4
|
+
When I run `bin/jasmine-headless-webkit --use-server -j spec/jasmine/success/success.yml -f File:spec/report.txt`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage
|
7
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Feature: Bin - With window.prompt()
|
2
|
+
Scenario: Alert the user that window.prompt() needs to be stubbed
|
3
|
+
Given I have a test suite
|
4
|
+
When I run `bin/jasmine-headless-webkit -j spec/jasmine/window_prompt/window_prompt.yml`
|
5
|
+
Then the exit status should be 0
|
6
|
+
And the output should include "You should mock window.prompt"
|
7
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: Reporters
|
2
|
+
In order to allow for multiple types of output
|
3
|
+
I should be able to
|
4
|
+
Manage reporters and decide which ones to use
|
5
|
+
|
6
|
+
Scenario: Use default reporters
|
7
|
+
Given I have the default runner options
|
8
|
+
When I get a runner
|
9
|
+
And I get a template writer
|
10
|
+
Then the template should use the "Console" reporter to "stdout"
|
11
|
+
And the command to run the runner should not include a report file
|
12
|
+
|
13
|
+
Scenario: Use a file reporter
|
14
|
+
Given I have the default runner options
|
15
|
+
And I have the following reporters:
|
16
|
+
| Name | File |
|
17
|
+
| Console | |
|
18
|
+
| File | file |
|
19
|
+
When I get a runner
|
20
|
+
And I get a template writer
|
21
|
+
Then the template should use the "Console" reporter to "stdout"
|
22
|
+
And the template should use the "File" reporter to "report:0"
|
23
|
+
And the command to run the runner should include the report file "file"
|
24
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Feature: Using the Runner directly
|
2
|
+
Scenario: Succeed
|
3
|
+
Given I have the following runner options:
|
4
|
+
"""
|
5
|
+
:jasmine_config: spec/jasmine/success/success.yml
|
6
|
+
:reporters:
|
7
|
+
- [ 'File', 'spec/report.txt' ]
|
8
|
+
"""
|
9
|
+
When I get a runner
|
10
|
+
And I run the runner
|
11
|
+
Then the runner should have an exit status of 0
|
12
|
+
And the report file "spec/report.txt" should have 1 total, 0 failures, no console usage
|
13
|
+
|
14
|
+
Scenario: JavaScript Error
|
15
|
+
Given I have the following runner options:
|
16
|
+
"""
|
17
|
+
:jasmine_config: spec/jasmine/success_with_error/success_with_error.yml
|
18
|
+
"""
|
19
|
+
When I get a runner
|
20
|
+
And I run the runner
|
21
|
+
Then the runner should have an exit status of 1
|
22
|
+
|
23
|
+
Scenario: Failure
|
24
|
+
Given I have the following runner options:
|
25
|
+
"""
|
26
|
+
:jasmine_config: spec/jasmine/failure/failure.yml
|
27
|
+
:reporters:
|
28
|
+
- [ 'File', 'spec/report.txt' ]
|
29
|
+
"""
|
30
|
+
When I get a runner
|
31
|
+
And I run the runner
|
32
|
+
Then the runner should have an exit status of 1
|
33
|
+
And the report file "spec/report.txt" should have 1 total, 1 failure, no console usage
|
34
|
+
|