Skip to content

Commit

Permalink
Added handling for event records
Browse files Browse the repository at this point in the history
An event record in the wiki will generate corresponding
JSON in the test now.  References #13
  • Loading branch information
halindrome authored and sideshowbarker committed Jun 10, 2017
1 parent 9a18bbb commit 0d99da8
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions wai-aria/tools/make_tests.pl
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,22 @@
value => $3
};
$theStep = undef;
push(@steps, $obj);
} else {
print STDERR "Malformed attribute instruction at line $lineCounter: " . $_ . "\n";
}
push(@steps, $obj);
} elsif ($type eq "event") {
print STDERR "Event support from wikis is not yet implemnted at line #lineCounter\n";
if ($params =~ m/([^:]+):([^ ]+).*$/) {
$obj = {
type => $type,
element => $1,
value => $2
};
$theStep = undef;
push(@steps, $obj);
} else {
print STDERR "Malformed event instruction at line $lineCounter: " . $_ . "\n";
}
} elsif ($type eq "element") {
$obj = {
type => "test",
Expand Down Expand Up @@ -488,6 +498,10 @@ ()
$step->{element} = $asserts->{"element"};
$step->{attribute} = $asserts->{"attribute"};
$step->{value} = $asserts->{value};
} elsif ($asserts->{type} eq "event") {
$step->{type} = "event";
$step->{element} = $asserts->{"element"};
$step->{event} = $asserts->{value};
} else {
print STDERR "Invalid step type: " . $asserts->{type} . "\n";
next;
Expand Down

0 comments on commit 0d99da8

Please sign in to comment.