~holger-seelig/cobweb.js/trunk

« back to all changes in this revision

Viewing changes to cobweb.js/lib/jquery-contextMenu/test/integration/keeping-contextmenu-open.js

  • Committer: Holger Seelig
  • Date: 2017-08-22 04:53:24 UTC
  • Revision ID: holger.seelig@yahoo.de-20170822045324-4of4xxgt79669gbt
Switched to npm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
var pwd = process.cwd();
2
 
var helper = require('../integration_test_helper.js');
3
 
 
4
 
module.exports = {
5
 
  'Ensure context menu is shown': function (test) {
6
 
    test
7
 
      .open('file://' + pwd + '/demo/keeping-contextmenu-open.html')
8
 
      .execute(helper.rightClick, '.context-menu-one')
9
 
      .waitForElement('#context-menu-layer')
10
 
      .wait(100)
11
 
      .assert.exists('.context-menu-root', 'It opens context menu')
12
 
      .assert.numberOfElements('.context-menu-root li')
13
 
        .is(2, '2 context menu items are shown')
14
 
      .done();
15
 
  },
16
 
 
17
 
  'Close context menu after first menu item is clicked': function (test) {
18
 
    test
19
 
      .open('file://' + pwd + '/demo/keeping-contextmenu-open.html')
20
 
      .execute(helper.rightClick, '.context-menu-one')
21
 
      .waitForElement('#context-menu-layer')
22
 
      .wait(100)
23
 
      .assert.visible('.context-menu-root li:first-child', 'Menu item is present')
24
 
      .click('.context-menu-root li:first-child')
25
 
      .assert.doesntExist('#context-menu-layer', 'It closes context menu')
26
 
      .done();
27
 
  },
28
 
 
29
 
  'Keep context menu open after second menu item is clicked': function (test) {
30
 
    test
31
 
      .open('file://' + pwd + '/demo/keeping-contextmenu-open.html')
32
 
      .execute(helper.rightClick, '.context-menu-one')
33
 
      .waitForElement('#context-menu-layer')
34
 
      .wait(100)
35
 
      .assert.visible('.context-menu-root', 'Menu is present')
36
 
      .click('.context-menu-root li:last-child')
37
 
      .assert.exists('#context-menu-layer', 'It closes context menu')
38
 
      .done();
39
 
  }
40
 
};