Added more webdriver tests testing against a real browser.

This commit is contained in:
orangemug
2018-01-05 17:45:55 +00:00
parent 6e86c60f89
commit 942b2240a7
47 changed files with 2244 additions and 637 deletions

View File

@@ -94,8 +94,14 @@ class AutocompleteInput extends React.Component {
value={this.props.value}
items={this.props.options}
getItemValue={(item) => item[0]}
onSelect={v => this.props.onChange(v)}
onChange={(e, v) => this.props.onChange(v)}
onSelect={v => {
console.log("@@ onSelect", v)
this.props.onChange(v)
}}
onChange={(e, v) => {
console.log("@@ onChange", v)
this.props.onChange(v)
}}
renderItem={(item, isHighlighted) => (
<div
key={item[0]}

View File

@@ -6,6 +6,7 @@ import DocLabel from '../fields/DocLabel'
/** Wrap a component with a label */
class InputBlock extends React.Component {
static propTypes = {
"data-wd-key": PropTypes.string,
label: PropTypes.oneOfType([
PropTypes.string,
PropTypes.element,
@@ -24,6 +25,7 @@ class InputBlock extends React.Component {
render() {
return <div style={this.props.style}
data-wd-key={this.props["data-wd-key"]}
className={classnames({
"maputnik-input-block": true,
"maputnik-action-block": this.props.action

View File

@@ -4,6 +4,7 @@ import PropTypes from 'prop-types'
class SelectInput extends React.Component {
static propTypes = {
value: PropTypes.string.isRequired,
"data-wd-key": PropTypes.string.isRequired,
options: PropTypes.array.isRequired,
style: PropTypes.object,
onChange: PropTypes.func.isRequired,
@@ -18,6 +19,7 @@ class SelectInput extends React.Component {
return <select
className="maputnik-select"
data-wd-key={this.props["data-wd-key"]}
style={this.props.style}
value={this.props.value}
onChange={e => this.props.onChange(e.target.value)}

View File

@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
class StringInput extends React.Component {
static propTypes = {
"data-wd-key": PropTypes.string,
value: PropTypes.string,
style: PropTypes.object,
default: PropTypes.string,
@@ -18,6 +19,7 @@ class StringInput extends React.Component {
}
componentWillReceiveProps(nextProps) {
console.log("@@ STRING componentWillReceiveProps", JSON.stringify(nextProps))
this.setState({ value: nextProps.value || '' })
}
@@ -40,12 +42,19 @@ class StringInput extends React.Component {
}
return React.createElement(tag, {
"data-wd-key": this.props["data-wd-key"],
className: classes.join(" "),
style: this.props.style,
value: this.state.value,
placeholder: this.props.default,
onChange: e => this.setState({ value: e.target.value }),
onChange: e => {
console.log("@@ STRING CHANGE", JSON.stringify(e.target.value));
this.setState({
value: e.target.value
})
},
onBlur: () => {
console.log("@@ STRING BLUR", JSON.stringify(this.state.value), "props:", JSON.stringify(this.props.value));
if(this.state.value!==this.props.value) this.props.onChange(this.state.value)
}
});