Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a test using the HTML5 form types

Closes #527
  • Loading branch information...
commit ed9aa5c5757f6485b2f6ff15ffec2477480d5965 1 parent e0a4d93
@stof stof authored
View
26 driver-testsuite/tests/Form/Html5Test.php
@@ -105,6 +105,32 @@ public function testHtml5FormOutside()
$this->assertContains($out, $page->getContent());
$this->assertNotContains('first_name', $page->getContent());
}
+ }
+
+ public function testHtml5Types()
+ {
+ $this->getSession()->visit($this->pathTo('html5_types.html'));
+ $page = $this->getSession()->getPage();
+
+ $page->fillField('url', 'http://mink.behat.org/');
+ $page->fillField('email', 'mink@example.org');
+ $page->fillField('number', '6');
+ $page->fillField('search', 'mink');
+ $page->fillField('date', '2014-05-19');
+ $page->fillField('color', '#ff00aa');
+ $page->pressButton('Submit');
+
+ $out = <<<OUT
+ 'color' = '#ff00aa',
+ 'date' = '2014-05-19',
+ 'email' = 'mink@example.org',
+ 'number' = '6',
+ 'search' = 'mink',
+ 'submit_button' = 'Submit',
+ 'url' = 'http://mink.behat.org/',
+OUT;
+
+ $this->assertContains($out, $page->getContent());
}
}
View
18 driver-testsuite/web-fixtures/html5_types.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>HTML5 form attribute test</title>
+</head>
+<body>
+ <form action="advanced_form_post.php" method="POST">
+ <input name="url" type="url">
+ <input name="email" type="email">
+ <input name="number" type="number">
+ <input name="search" type="search">
+ <input name="color" type="color">
+ <input name="date" type="date">
+ <input type="submit" name="submit_button" value="Submit">
+ </form>
+</body>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.