Skip to content

Commit

Permalink
Add NumberInput
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kutz committed Dec 4, 2018
1 parent 3e0ada5 commit 58e3e51
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
22 changes: 22 additions & 0 deletions module/geb-core/src/main/groovy/geb/module/NumberInput.groovy
@@ -0,0 +1,22 @@
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package geb.module

class NumberInput extends TextLikeInput {

final String inputType = 'number'

}
@@ -0,0 +1,21 @@
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package geb.module

class NumberInputBaseSpec extends InputBasedModuleSpec<NumberInput> {
final String inputType = "number"
final String otherInputType = "checkbox"
}
30 changes: 30 additions & 0 deletions module/geb-core/src/test/groovy/geb/module/NumberInputSpec.groovy
@@ -0,0 +1,30 @@
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package geb.module

class NumberInputSpec extends TextLikeInputSpec {

def setup() {
html {
input(type: "number")
}
}

NumberInput getInput() {
$("input").module(NumberInput)
}

}

0 comments on commit 58e3e51

Please sign in to comment.