From c4e73bb9cb1e3e216422be24beb622ec95c6064e Mon Sep 17 00:00:00 2001 From: Simon Bomm Date: Mon, 20 Oct 2014 11:32:56 +0200 Subject: [PATCH 1/3] Add check option to ensure that --scenario option is set --- apps/selenium/mode/scenario.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/selenium/mode/scenario.pm b/apps/selenium/mode/scenario.pm index d07901f77..1b749d21d 100644 --- a/apps/selenium/mode/scenario.pm +++ b/apps/selenium/mode/scenario.pm @@ -106,6 +106,11 @@ sub check_options { $self->{option_results}->{timeout} > 0) { alarm($self->{option_results}->{timeout}); } + if (!defined($self->{option_results}->{scenario})) + $self->{output}->add_option_msg(short_msg => "Please specify a scenario name" . $self->{option_results}->{scenario} . "'."); + $self->{output}->option_exit(); + } + } sub run { @@ -113,7 +118,7 @@ sub run { my $p = XML::Parser->new(NoLWP => 1); my $filename = $self->{option_results}->{directory} . '/' . $self->{option_results}->{scenario} . '.html'; - my $xp = XML::XPath->new(parser => $p, filename => $filename); + #my $xp = XML::XPath->new(parser => $p, filename => $filename); my $baseurlNode = $xp->find('/html/head/link[@rel="selenium.base"]'); my $baseurl = $baseurlNode->shift->getAttribute('href'); From 43a3b6ae03c519c5182fe3645b3f8b80a958c310 Mon Sep 17 00:00:00 2001 From: Simon Bomm Date: Mon, 20 Oct 2014 11:41:30 +0200 Subject: [PATCH 2/3] correct { error --- apps/selenium/mode/scenario.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/selenium/mode/scenario.pm b/apps/selenium/mode/scenario.pm index 1b749d21d..cc4566692 100644 --- a/apps/selenium/mode/scenario.pm +++ b/apps/selenium/mode/scenario.pm @@ -106,7 +106,7 @@ sub check_options { $self->{option_results}->{timeout} > 0) { alarm($self->{option_results}->{timeout}); } - if (!defined($self->{option_results}->{scenario})) + if (!defined($self->{option_results}->{scenario})) { $self->{output}->add_option_msg(short_msg => "Please specify a scenario name" . $self->{option_results}->{scenario} . "'."); $self->{output}->option_exit(); } From b87b369e011c1bdb983e002e1bbf5d98a714937c Mon Sep 17 00:00:00 2001 From: Simon Bomm Date: Mon, 20 Oct 2014 11:46:21 +0200 Subject: [PATCH 3/3] uncomment line, vim mystery :/ --- apps/selenium/mode/scenario.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/selenium/mode/scenario.pm b/apps/selenium/mode/scenario.pm index cc4566692..c5118097a 100644 --- a/apps/selenium/mode/scenario.pm +++ b/apps/selenium/mode/scenario.pm @@ -107,7 +107,7 @@ sub check_options { alarm($self->{option_results}->{timeout}); } if (!defined($self->{option_results}->{scenario})) { - $self->{output}->add_option_msg(short_msg => "Please specify a scenario name" . $self->{option_results}->{scenario} . "'."); + $self->{output}->add_option_msg(short_msg => "Please specify a scenario name" . $self->{option_results}->{scenario} . "."); $self->{output}->option_exit(); } @@ -118,7 +118,7 @@ sub run { my $p = XML::Parser->new(NoLWP => 1); my $filename = $self->{option_results}->{directory} . '/' . $self->{option_results}->{scenario} . '.html'; - #my $xp = XML::XPath->new(parser => $p, filename => $filename); + my $xp = XML::XPath->new(parser => $p, filename => $filename); my $baseurlNode = $xp->find('/html/head/link[@rel="selenium.base"]'); my $baseurl = $baseurlNode->shift->getAttribute('href');