codeceptjs
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -1,3 +0,8 @@ | ||
# 0.2.2 | ||
## 0.2.3 | ||
* [WebDriverIO] fixed `seeInField` to work with single value elements like: input[type=text], textareas, and multiple: select, input[type=radio], input[type=checkbox] | ||
* [WebDriverIO] fixed `pressKey`, key modifeiers (Control, Command, Alt, Shift) are released after the action | ||
## 0.2.2 | ||
Fixed generation of custom steps file and page objects. | ||
@@ -7,3 +12,3 @@ Please replace `require('codeceptjs/actor')` to `actor` in your `custom_steps.js`. | ||
# 0.2.0 | ||
## 0.2.0 | ||
@@ -10,0 +15,0 @@ * **within** context hook added |
@@ -809,2 +809,4 @@ 'use strict'; | ||
* will be replaced with corresponding unicode. | ||
* | ||
* If modiferier key is used (Control, Command, Alt, Shift) in array, it will be released afterwards. | ||
* | ||
@@ -815,5 +817,20 @@ * ```js | ||
* ``` | ||
* | ||
* To make combinations with modifier and mouse clicks (like Ctrl+Click) press a modifier, click, then release it. | ||
* | ||
* ```js | ||
* I.pressKey('Control'); | ||
* I.click('#someelement'); | ||
* I.pressKey('Control'); | ||
* ``` | ||
*/ | ||
pressKey(key) { | ||
return this.browser.keys(key); | ||
let modifier; | ||
if (Array.isArray(key) && ~['Control','Command','Shift','Alt'].indexOf(key[0])) { | ||
modifier = key[0]; | ||
} | ||
return this.browser.keys(key).then(function() { | ||
if (!modifier) return true; | ||
return this.keys(modifier); // release modifeier | ||
}); | ||
} | ||
@@ -975,3 +992,3 @@ | ||
function proceedSeeField(assertType, field, value) { | ||
function proceedSeeField(assertType, field, value) { | ||
return findFields(this.browser, field).then(function (res) { | ||
@@ -981,13 +998,38 @@ if (!res.value || res.value.length === 0) { | ||
} | ||
let commands = []; | ||
res.value.forEach((el) => commands.push(this.elementIdSelected(el.ELEMENT))); | ||
this.unify(commands).then((res) => { | ||
commands = []; | ||
res.value.forEach((el) => { | ||
if (el.value === false) return; | ||
commands.push(this.elementIdAttribute(el.ELEMENT, 'value')); | ||
}); | ||
this.unify(commands, { extractValue: true }).then((val) => { | ||
return stringIncludes('fields by ' + field)[assertType](value, val); | ||
}); | ||
var proceedMultiple = (fields) => { | ||
let commands = []; | ||
fields.forEach((el) => commands.push(this.elementIdSelected(el.ELEMENT))); | ||
this.unify(commands).then((res) => { | ||
commands = []; | ||
fields.forEach((el) => { | ||
if (el.value === false) return; | ||
commands.push(this.elementIdAttribute(el.ELEMENT, 'value')); | ||
}); | ||
this.unify(commands, { extractValue: true }).then((val) => { | ||
return stringIncludes('fields by ' + field)[assertType](value, val); | ||
}); | ||
}); | ||
} | ||
var proceedSingle = (el) => { | ||
return this.elementIdAttribute(el.ELEMENT, 'value').then((res) => { | ||
return stringIncludes('fields by ' + field)[assertType](value, res.value); | ||
}); | ||
} | ||
return this.elementIdName(res.value[0].ELEMENT).then((tag) => { | ||
if (tag.value == 'select') { | ||
return proceedMultiple(res.value); | ||
} | ||
if (tag.value == 'input') { | ||
return this.elementIdAttribute(res.value[0].ELEMENT, 'type').then((type) => { | ||
if (type.value == 'checkbox' || type.value == 'radio') { | ||
return proceedMultiple(res.value); | ||
} | ||
return proceedSingle(res.value[0]); | ||
}); | ||
} | ||
return proceedSingle(res.value[0]); | ||
}); | ||
@@ -994,0 +1036,0 @@ }); |
{ | ||
"name": "codeceptjs", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Modern Era Aceptance Testing Framework for NodeJS", | ||
@@ -34,3 +34,3 @@ "homepage": "http://codecept.io", | ||
"mocha": "^2.3.4", | ||
"webdriverio": "^3.2.5" | ||
"webdriverio": "~3.4.0" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
@@ -1,5 +0,3 @@ | ||
# CodeceptJs [![NPM version][npm-image]][npm-url] [![Build Status](https://travis-ci.org/Codeception/CodeceptJS.svg)](https://travis-ci.org/Codeception/CodeceptJS) | ||
# CodeceptJS [![NPM version][npm-image]][npm-url] [![Build Status](https://travis-ci.org/Codeception/CodeceptJS.svg)](https://travis-ci.org/Codeception/CodeceptJS) [![Join the chat at https://gitter.im/Codeception/CodeceptJS](https://badges.gitter.im/Codeception/CodeceptJS.svg)](https://gitter.im/Codeception/CodeceptJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Join the chat at https://gitter.im/Codeception/CodeceptJS](https://badges.gitter.im/Codeception/CodeceptJS.svg)](https://gitter.im/Codeception/CodeceptJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
Reference: [Helpers API](https://github.com/Codeception/CodeceptJS/blob/master/docs) | [Demo](https://github.com/Codeception/codeceptjs-demo) | ||
@@ -6,0 +4,0 @@ |
101219
2800
275
Updatedwebdriverio@~3.4.0