Skip to content

Commit 784f0f1

Browse files
committed
e3e test infrastructure
1 parent ea64034 commit 784f0f1

File tree

7 files changed

+1879
-15
lines changed

7 files changed

+1879
-15
lines changed

conf.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
exports.config = {
2+
seleniumAddress: 'http://localhost:4444/wd/hub',
3+
specs: ['./e2e/basic-drag-drop.e2e.js']
4+
};

e2e/basic-drag-drop.e2e.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
describe('drag and drop', function() {
2+
it('should reorder items', function() {
3+
browser.get('http://localhost:2000/');
4+
element.all(by.css('li'))
5+
.getText()
6+
.then(function(listItems) {
7+
expect(listItems[0]).toEqual('burgers');
8+
expect(listItems[1]).toEqual('chips');
9+
expect(listItems[2]).toEqual('hotdog');
10+
expect(listItems[3]).toEqual('icecream');
11+
12+
});
13+
14+
// simulate drage and drop
15+
browser.executeScript("DndSimulator.simulate('#burgers', '#hotdog')")
16+
element.all(by.css('li'))
17+
.getText()
18+
.then(function(listItems) {
19+
console.log(listItems)
20+
expect(listItems[0]).toEqual('chips');
21+
expect(listItems[1]).toEqual('hotdog');
22+
expect(listItems[2]).toEqual('burgers');
23+
expect(listItems[3]).toEqual('icecream');
24+
});
25+
});
26+
});

0 commit comments

Comments
 (0)