table-confirm-delete_test.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. var assert = require('assert');
  2. Feature('table');
  3. Scenario('should have correct initial value', async (I) => {
  4. I.amOnPage('table.html');
  5. I.click('.get-value');
  6. value = await I.grabValueFrom('.debug');
  7. assert.equal(value, '[]');
  8. });
  9. Scenario('should ask for confirmation on node delete', async (I) => {
  10. I.amOnPage('table.html');
  11. I.click('Add Node');
  12. I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  13. I.click('[data-schemapath="root.0"] .json-editor-btn-delete');
  14. I.seeInPopup('Are you sure you want to remove this node?');
  15. I.cancelPopup();
  16. I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  17. I.click('[data-schemapath="root.0"] .json-editor-btn-delete');
  18. I.seeInPopup('Are you sure you want to remove this node?');
  19. I.acceptPopup();
  20. I.dontSeeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  21. });
  22. Scenario('should ask for confirmation on node delete last', async (I) => {
  23. I.amOnPage('table.html');
  24. I.click('Add Node');
  25. I.click('Add Node');
  26. I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  27. I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete');
  28. I.click('Delete Last Node');
  29. I.seeInPopup('Are you sure you want to remove this node?');
  30. I.cancelPopup();
  31. I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  32. I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete');
  33. I.click('Delete Last Node');
  34. I.seeInPopup('Are you sure you want to remove this node?');
  35. I.acceptPopup();
  36. I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  37. I.dontSeeElement('[data-schemapath="root.1"] .json-editor-btn-delete');
  38. });
  39. Scenario('should ask for confirmation on node delete all', async (I) => {
  40. I.amOnPage('table.html');
  41. I.click('Add Node');
  42. I.click('Add Node');
  43. I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  44. I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete');
  45. I.click('Delete All');
  46. I.seeInPopup('Are you sure you want to remove this node?');
  47. I.cancelPopup();
  48. I.seeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  49. I.seeElement('[data-schemapath="root.1"] .json-editor-btn-delete');
  50. I.click('Delete All');
  51. I.seeInPopup('Are you sure you want to remove this node?');
  52. I.acceptPopup();
  53. I.dontSeeElement('[data-schemapath="root.0"] .json-editor-btn-delete');
  54. I.dontSeeElement('[data-schemapath="root.1"] .json-editor-btn-delete');
  55. });