Comments (14)
I will change the step so that it clears the input field before entering text. That means that if you enter an empty string it will only clear the field.
from calabash-android.
I just released calabash-android-0.0.16.
It clears the input field before entering text. That means you can write the following steps.
Given /^I clear the first input field$/ do
set_text "webView, css:input[type=text]", ''
end
Given /^I enter "([^"]*)" into the first input field$/ do |text|
set_text "webView, css:input[type=text]", text
end
from calabash-android.
Please help me understand, I am also new to cucumber.
Looking at the above step, shouldn't I provide css locator as an input.
Given /^I enter "([^"])" into the input field "([^"])" $/ do |text, locator|
set_text "webView, css:locator", text
end
For example:- Given I enter "[email protected]" into the input field "input#email"
from calabash-android.
This should work if you want to give the css selector as an argument.
Given /^I enter "([^"])" into the input field "([^"])" $/ do |text, locator|
set_text "webView, css:#{locator}", text
end
However, it is more readable to do something like:
Given /^I enter "([^"])" as email" $/ do |email|
set_text "webView, css:input#email", email
end
That way you keep your test in a business language without exposing technical details.
from calabash-android.
Thank you . This works as desired
Given /^I enter "([^\"]*)" as email$/ do |email|
set_text "webView, css:input#email", email
end
But the below step doesn't clear the input field. I still see the old text exists in email field.
Given /^I clear the first input field$/ do
set_text "webView, css:input#email", ''
end
I did install the latest gem and I unpacked the gem and noticed the set_text(uiquery, txt) method is defined operations.rb.
from calabash-android.
Continuation...
Jonas, it will be great if the logic to clear the text field in web view works. Currently I am not able to test any end-to-end webview flows as the signin itself fails.
Thanks in advance.
from calabash-android.
Did you update calabash-android to 0.0.17? It should clear the text field.
Run gem update calabash-android
to update.
from calabash-android.
Yes, I do have 0.0.17.
The non-empty string works-
Given I enter "[email protected]" as email
The below empty string doesn't work-
Given I clear the first input field
Given I enter "" as email
The step definition are defined as you described:-
Given /^I clear the first input field$/ do
set_text "webView, css:input#email", ''
end
Given /^I enter "([^\"]*)" as email$/ do |email|
set_text "webView, css:input#email", email
end
from calabash-android.
Does this work as expected?
Given I enter "foo" as email
Given I enter "bar" as email
from calabash-android.
Yes, it worked.
The only time it doesn't work is when I give ""
from calabash-android.
Just to be sure. After you you run the to steps above the input field has the value "bar", right?
What about entering a single space into the field?
It might have something to do with a listener on the field in your app. Do you know if there is such a listener?
from calabash-android.
There is email-id already populated in the username field. When I enter the value "bar" then the "bar" is appended to the already existing text.
For example:- The username field is pre-populated with value "[email protected]", and when I invoked the step 'Given I enter "bar" as email', the value in username field is changed to "[email protected]"
When I entered a single space into the field via the step 'Given I enter " " as email' then I noticed the username field is appended with single space "[email protected] "
My original request for filing this issue is to clear the content in the username field before entering a new username.
I will get back to you regarding the listener.
from calabash-android.
There seem to have been a bug in 0.0.16 so that the text is not cleared. Could you try to update to 0.0.18?
from calabash-android.
Thanks a lot. It works after upgrading to 0.0.18.
from calabash-android.
Related Issues (20)
- Gem::ConflictError HOT 13
- Canβt support Flutter HOT 2
- NullObjectReference in Xamarin.UITest 3.0 HOT 2
- Calabash Instrumentation fail due to UnsatisfiedLinkError HOT 1
- How to run scenario again if it fails? HOT 2
- Android Q Support HOT 11
- Touches on list item in AlertDialog works intermittently
- This path split not support windows
- INJECT_EVENTS permission issue HOT 2
- Unable resign the apk file- Showing the alert as "No such file or directory - "C:/android-sdks/platform-tools/aapt" HOT 2
- Undefined method `feature' for #<Cucumber HOT 2
- META-INF CERT.RSA not detected HOT 9
- Errors attempting to use UiAutomator2 features HOT 1
- Calabash roadmap
- set_selection(-1, -1) unsuccessful on android 10 on some pop up view
- Facing issue in command reinstall_apps, ruby
- Calabash-android resign with signature scheme v2 HOT 1
- GitHub Security Lab (GHSL) Vulnerability Report: GHSL-2022-095
- HTTPClient::KeepAlive Disconnected - Cucumber 8.0.0 & 7.1.0
- Private vulnerability reporting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calabash-android.