Last active
November 3, 2015 08:59
-
-
Save MattiSG/0cb11f94237a414c6872 to your computer and use it in GitHub Desktop.
Selenium issue reproduction case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| description: 'Invalid fields should be clearable', | |
| steps: [ | |
| InputComponent.setValidatedField('2'), | |
| { 'InputComponent.validatedField': '2' }, | |
| InputComponent.setValidatedField('e'), | |
| { 'InputComponent.validatedField': 'e' }, | |
| InputComponent.setValidatedField('3'), | |
| { 'InputComponent.validatedField': '3' }, // fails: `e` was invalid, the field is not cleared and contains `e3` | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| baseURL: 'file://' + __dirname + '/index.html', | |
| views: 'Verbose' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Selenium clear() won't work on an invalidated input</title> | |
| </head> | |
| <body> | |
| <h1>Selenium clear() won't work on an invalidated input</h1> | |
| <input type="number" name="number" step="1"></input> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| validatedField: 'input' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var webdriver = require('selenium-webdriver'), | |
| By = require('selenium-webdriver').By, | |
| until = require('selenium-webdriver').until; | |
| var driver = new webdriver.Builder() | |
| .forBrowser('firefox') | |
| .build(); | |
| driver.get('file://' + __dirname + '/index.html'); | |
| driver.findElement(By.name('number')).sendKeys('2'); | |
| driver.findElement(By.name('number')).clear(); | |
| driver.findElement(By.name('number')).sendKeys('e'); | |
| driver.findElement(By.name('number')).clear(); | |
| driver.findElement(By.name('number')).sendKeys('3'); // `e` was invalid, the field is not cleared and now contains `e3` | |
| driver.wait(() => {}, 5000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment