Skip to content

Instantly share code, notes, and snippets.

@p0deje
Last active February 1, 2017 05:34
Show Gist options
  • Save p0deje/6e7e105c31da69419e5c to your computer and use it in GitHub Desktop.
Save p0deje/6e7e105c31da69419e5c to your computer and use it in GitHub Desktop.
Attempt to reproduce SeleniumHQ/selenium#1856
commit ca156e9e45362ce78a56f79bdf01ee7913d82ba6
Author: Alex Rodionov <[email protected]>
Date: Wed Mar 23 14:40:57 2016 +0600
Attempt to reproduce #1856
diff --git a/javascript/atoms/test/click_test.html b/javascript/atoms/test/click_test.html
index f570acb..1de449b 100644
--- a/javascript/atoms/test/click_test.html
+++ b/javascript/atoms/test/click_test.html
@@ -19,6 +19,8 @@
goog.require('goog.style');
goog.require('goog.testing.jsunit');
goog.require('goog.userAgent');
+ goog.require('goog.ui.MenuItem');
+ goog.require('goog.ui.Select');
</script>
<script type="text/javascript">
var clicker;
@@ -405,6 +407,14 @@
}
window.scrollTo(0, 0);
}
+
+ function testClickShouldSelectOptionFromGoogUiSelect() {
+ var select = findElement({css: '.goog-menu-button-caption'});
+ bot.action.click(select);
+ var option = findElement({xpath: './/div[@class="goog-menuitem-content"][contains(text(), "Citizen Kane")]'})
+ bot.action.click(option);
+ assertEquals('Citizen Kane', bot.dom.getVisibleText(findElement({css: '.goog-menu-button-caption'})))
+ }
</script>
</head>
<body>
@@ -449,11 +459,21 @@
setOpacity(1);
});
</script>
+ <script>
+ var select = new goog.ui.Select();
+ select.addItem(new goog.ui.MenuItem('Blade Runner'));
+ select.addItem(new goog.ui.MenuItem('Citizen Kane'));
+ select.setSelectedIndex(0);
+ select.render(goog.dom.getElement('goog-ui-select'));
+ </script>
</div>
<p id="pointerEvents" onclick="this.textContent='Error';" style="pointer-events: none;">Pass</p>
<iframe id="iframe" src="testdata/click_iframe.html">
</iframe>
<div id="targetInView" style="position: absolute; top: 10px; left: 10px">target in view</div>
<div id="targetNotInView" style="position: absolute; top: 10000px">target not in view</div>
+ <br>
+ <label id="goog-ui-select">The best movie of all time is </label>
+ <br>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment