string-ace-editor_test.js 666 B

1234567891011121314151617181920212223242526
  1. var assert = require('assert');
  2. var value = '';
  3. Feature('string-ace-editor');
  4. Scenario('should have correct initial value', async (I) => {
  5. I.amOnPage('string-ace-editor.html');
  6. I.click('.get-value');
  7. value = await I.grabValueFrom('.debug');
  8. assert.equal(value, '[]');
  9. });
  10. Scenario('should have coerent values', async (I) => {
  11. I.amOnPage('string-ace-editor.html');
  12. I.click('Add item');
  13. I.see('item 1');
  14. I.seeElement('.ace_editor');
  15. I.click('.ace_editor');
  16. I.pressKey('__YELLOW__');
  17. I.see('__YELLOW__');
  18. I.click('.get-value');
  19. value = await I.grabValueFrom('.debug');
  20. assert.equal(value, JSON.stringify([{"editor":"__YELLOW__"}]));
  21. });