Skip to content

Commit

Permalink
Add callback test
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrala committed Aug 31, 2016
1 parent e134b3e commit a1638dd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 87 deletions.
60 changes: 0 additions & 60 deletions test/integration/callback.js

This file was deleted.

27 changes: 0 additions & 27 deletions test/integration_test_helper.js

This file was deleted.

28 changes: 28 additions & 0 deletions test/specs/callback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var assert = require('assert');
var pwd = process.cwd();

describe('Test callback', function() {
function openCallbackMenu() {
browser.url('file://' + pwd + '/test/integration/html/callback.html');
browser.rightClick('.context-menu-one');
browser.waitForExist('#context-menu-layer');
assert.equal(true, browser.isVisible('.context-menu-root'), 'menu is visible');
}

it('Ensure edit menu item triggers callback', function () {
openCallbackMenu();

browser.leftClick('.context-menu-root li:nth-child(1)');
assert.equal('edit was clicked', browser.alertText());
browser.alertAccept();
assert.equal(false, browser.isVisible('£context-menu-layer'), 'menu is hidden');
});
it('Ensure cut menu item triggers global callback', function () {
openCallbackMenu();

browser.leftClick('.context-menu-root li:nth-child(2)');
assert.equal('global: cut', browser.alertText());
browser.alertAccept();
assert.equal(false, browser.isVisible('£context-menu-layer'), 'menu is hidden');
});
});

0 comments on commit a1638dd

Please sign in to comment.