Add tests for manual selection
This commit is contained in:
parent
d1aac9e9e9
commit
02f79c2990
@ -16,7 +16,7 @@
|
|||||||
BAZ<br/>
|
BAZ<br/>
|
||||||
space travel<br/>
|
space travel<br/>
|
||||||
/slash<br/>
|
/slash<br/>
|
||||||
<a href="hello.txt">follow me!</a><br/>
|
<a class="toselect" href="hello.txt">follow me!</a><br/>
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
13
tests/end2end/data/search_select.js
Normal file
13
tests/end2end/data/search_select.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/* Select all elements marked with toselect */
|
||||||
|
|
||||||
|
|
||||||
|
var toSelect = document.getElementsByClassName("toselect");
|
||||||
|
var s = window.getSelection();
|
||||||
|
|
||||||
|
if(s.rangeCount > 0) s.removeAllRanges();
|
||||||
|
|
||||||
|
for(var i = 0; i < toSelect.length; i++) {
|
||||||
|
var range = document.createRange();
|
||||||
|
range.selectNode(toSelect[i]);
|
||||||
|
s.addRange(range);
|
||||||
|
}
|
@ -224,3 +224,17 @@ Feature: Searching on a page
|
|||||||
And I run :follow-selected -t
|
And I run :follow-selected -t
|
||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
- data/search.html (active)
|
- data/search.html (active)
|
||||||
|
|
||||||
|
Scenario: Follow a manually selected link
|
||||||
|
When I run :jseval --file (testdata)/search_select.js
|
||||||
|
And I run :follow-selected
|
||||||
|
Then data/hello.txt should be loaded
|
||||||
|
|
||||||
|
Scenario: Follow a manually selected link in a new tab
|
||||||
|
When I run :window-only
|
||||||
|
And I run :jseval --file (testdata)/search_select.js
|
||||||
|
And I run :follow-selected -t
|
||||||
|
And I wait until data/hello.txt is loaded
|
||||||
|
Then the following tabs should be open:
|
||||||
|
- data/search.html
|
||||||
|
- data/hello.txt (active)
|
||||||
|
Loading…
Reference in New Issue
Block a user