select_test.js 877 B

12345678910111213141516171819202122232425262728
  1. var assert = require('assert');
  2. var value = '';
  3. Feature('select');
  4. Scenario('should return correct booleans values when selected', async (I) => {
  5. I.amOnPage('select.html');
  6. I.click('.get-value');
  7. value = await I.grabValueFrom('.value');
  8. assert.equal(value, '{"boolean":true}');
  9. I.selectOption('[name="root[boolean]"]', 'false');
  10. I.click('.get-value');
  11. value = await I.grabValueFrom('.value');
  12. assert.equal(value, '{"boolean":false}');
  13. I.selectOption('[name="root[boolean]"]', 'true');
  14. I.click('.get-value');
  15. value = await I.grabValueFrom('.value');
  16. assert.equal(value, '{"boolean":true}');
  17. });
  18. Scenario('should be disabled if "readonly" is specified', async (I) => {
  19. I.amOnPage('read-only.html');
  20. I.seeElement('[name="root[select]"]');
  21. value = await I.grabAttributeFrom('[name="root[select]"]', 'disabled');
  22. assert.equal(value, 'true');
  23. });