This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #558 from stof/html5_radio_group

Added a test covering the selection of radio groups with HTML5 form attr
  • Loading branch information...
2 parents a1b7d49 + cb89294 commit 7ac4d79d7695dd346fdba3fe7cf48b5f29e89da3 @stof stof committed May 17, 2014
Showing with 40 additions and 0 deletions.
  1. +24 −0 driver-testsuite/tests/Form/Html5Test.php
  2. +16 −0 driver-testsuite/web-fixtures/html5_radio.html
@@ -35,6 +35,30 @@ public function testHtml5FormInputAttribute()
}
}
+ public function testHtml5FormRadioAttribute()
+ {
+ $this->getSession()->visit($this->pathTo('html5_radio.html'));
+ $page = $this->getSession()->getPage();
+
+ $radio = $page->findById('sex_f');
+ $otherRadio = $page->findById('sex_invalid');
+
+ $this->assertEquals('f', $radio->getValue());
+ $this->assertEquals('invalid', $otherRadio->getValue());
+
+ $radio->selectOption('m');
+
+ $this->assertEquals('m', $radio->getValue());
+ $this->assertEquals('invalid', $otherRadio->getValue());
+
+ $page->pressButton('Submit in form');
+
+ $out = <<<OUT
+ 'sex' = 'm',
+OUT;
+ $this->assertContains($out, $page->getContent());
+ }
+
public function testHtml5FormButtonAttribute()
{
$this->getSession()->visit($this->pathTo('/html5_form.html'));
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>HTML5 form attribute test</title>
+</head>
+<body>
+ <form action="advanced_form_post.php" method="POST" id="test-form">
+ <input name="sex" type="radio" value="m" id="sex_m">
+ <input name="sex" type="radio" value="invalid" form="another" id="sex_invalid" checked="checked">
+ <input type="submit" value="Submit in form">
+ </form>
+ <input name="sex" type="radio" form="test-form" value="f" id="sex_f" checked="checked">
+ <form id="another" method="post" action="advanced_form_post.php"></form>
+</body>
+</html>

0 comments on commit 7ac4d79

Please sign in to comment.