Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See https://www.w3schools.com/tags/att_input_type_number.asp Contributes to geb/issues#548
- Loading branch information
Michael Kutz
committed
Dec 4, 2018
1 parent
3e0ada5
commit 58e3e51
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
module/geb-core/src/main/groovy/geb/module/NumberInput.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
module/geb-core/src/test/groovy/geb/module/NumberInputBaseSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
30
module/geb-core/src/test/groovy/geb/module/NumberInputSpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
|
||
} |