object_test.js 1.3 KB

1234567891011121314151617181920212223242526272829
  1. var assert = require('assert');
  2. var value = '';
  3. Feature('object');
  4. Scenario('should respect property orders', async (I) => {
  5. I.amOnPage('object.html');
  6. value = await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(1) [data-schemapath^="root."]', 'data-schemapath');
  7. assert.equal(value, 'root.age');
  8. value = await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(2) [data-schemapath^="root."]', 'data-schemapath');
  9. assert.equal(value, 'root.name');
  10. value = await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(3) [data-schemapath^="root."]', 'data-schemapath');
  11. assert.equal(value, 'root.single');
  12. value = await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(4) [data-schemapath^="root."]', 'data-schemapath');
  13. assert.equal(value, 'root.values');
  14. value = await I.grabAttributeFrom('[data-schemapath^="root"] .row:nth-of-type(5) [data-schemapath^="root."]', 'data-schemapath');
  15. assert.equal(value, 'root.zodiac');
  16. });
  17. Scenario('should validate required properties', async (I) => {
  18. I.amOnPage('object.html');
  19. I.see('Value must be at least 18.');
  20. });
  21. Scenario('should validate also not required properties', async (I) => {
  22. I.amOnPage('object.html');
  23. I.see('Value must be at least 3 characters long.');
  24. });