spec/watirspec/elements/text_field_spec.rb in watir-6.12.0 vs spec/watirspec/elements/text_field_spec.rb in watir-6.13.0
- old
+ new
@@ -205,167 +205,6 @@
it "raises UnknownReadOnlyException if sending keys to readonly element" do
expect { browser.text_field(id: 'new_user_code').set 'foo' }.to raise_object_read_only_exception
end
end
-
- # Manipulation methods
- not_compliant_on :safari do
- describe "#append" do
- it "appends the text to the text field" do
- browser.text_field(name: "new_user_occupation").append(" Append This")
- expect(browser.text_field(name: "new_user_occupation").value).to eq "Developer Append This"
- end
-
- it "appends multi-byte characters" do
- browser.text_field(name: "new_user_occupation").append(" ijij")
- expect(browser.text_field(name: "new_user_occupation").value).to eq "Developer ijij"
- end
-
- it "raises ObjectReadOnlyException if the object is read only" do
- expect { browser.text_field(id: "new_user_code").append("Append This") }.to raise_object_read_only_exception
- end
-
- it "raises ObjectDisabledException if the object is disabled" do
- expect { browser.text_field(name: "new_user_species").append("Append This") }.to raise_object_disabled_exception
- end
-
- it "raises UnknownObjectException if the object doesn't exist" do
- expect { browser.text_field(name: "no_such_name").append("Append This") }.to raise_unknown_object_exception
- end
- end
- end
-
- describe "#clear" do
- it "removes all text from the text field" do
- browser.text_field(name: "new_user_occupation").clear
- expect(browser.text_field(name: "new_user_occupation").value).to be_empty
- browser.textarea(id: "delete_user_comment").clear
- expect(browser.textarea(id: "delete_user_comment").value).to be_empty
- end
-
- it "raises UnknownObjectException if the text field doesn't exist" do
- expect { browser.text_field(id: "no_such_id").clear }.to raise_unknown_object_exception
- end
-
- it "raises ObjectReadOnlyException if the object is read only" do
- expect { browser.text_field(id: "new_user_code").clear }.to raise_object_read_only_exception
- end
- end
-
- describe "#value=" do
- it "sets the value of the element" do
- browser.text_field(id: 'new_user_email').value = 'Hello Cruel World'
- expect(browser.text_field(id: "new_user_email").value).to eq 'Hello Cruel World'
- end
-
- it "is able to set multi-byte characters" do
- browser.text_field(name: "new_user_occupation").value = "ijij"
- expect(browser.text_field(name: "new_user_occupation").value).to eq "ijij"
- end
-
- it "sets the value of a textarea element" do
- browser.textarea(id: 'delete_user_comment').value = 'Hello Cruel World'
- expect(browser.textarea(id: "delete_user_comment").value).to eq 'Hello Cruel World'
- end
-
- it "raises UnknownObjectException if the text field doesn't exist" do
- expect { browser.text_field(name: "no_such_name").value = 'yo' }.to raise_unknown_object_exception
- end
- end
-
- describe "#set" do
- it "sets the value of the element" do
- browser.text_field(id: 'new_user_email').set('Bye Cruel World')
- expect(browser.text_field(id: "new_user_email").value).to eq 'Bye Cruel World'
- end
-
- it "sets the value of a textarea element" do
- browser.textarea(id: 'delete_user_comment').set('Hello Cruel World')
- expect(browser.textarea(id: "delete_user_comment").value).to eq 'Hello Cruel World'
- end
-
- it "fires events" do
- browser.text_field(id: "new_user_username").set("Hello World")
- expect(browser.span(id: "current_length").text).to eq "11"
- end
-
- it "sets the value of a password field" do
- browser.text_field(name: 'new_user_password').set('secret')
- expect(browser.text_field(name: 'new_user_password').value).to eq 'secret'
- end
-
- it "sets the value when accessed through the enclosing Form" do
- browser.form(id: 'new_user').text_field(name: 'new_user_password').set('secret')
- expect(browser.form(id: 'new_user').text_field(name: 'new_user_password').value).to eq 'secret'
- end
-
- it "is able to set multi-byte characters" do
- browser.text_field(name: "new_user_occupation").set("ijij")
- expect(browser.text_field(name: "new_user_occupation").value).to eq "ijij"
- end
-
- it "sets the value to a concatenation of multiple arguments" do
- browser.text_field(id: 'new_user_email').set('Bye', 'Cruel', 'World')
- expect(browser.text_field(id: "new_user_email").value).to eq 'ByeCruelWorld'
- end
-
- it "sets the value to blank when no arguments are provided" do
- browser.text_field(id: 'new_user_email').set
- expect(browser.text_field(id: "new_user_email").value).to eq ''
- end
-
- it "raises UnknownObjectException if the text field doesn't exist" do
- expect { browser.text_field(id: "no_such_id").set('secret') }.to raise_unknown_object_exception
- end
- end
-
- describe "#set!" do
- it "sets the value of the element" do
- browser.text_field(id: 'new_user_email').set!('Bye Cruel World')
- expect(browser.text_field(id: "new_user_email").value).to eq 'Bye Cruel World'
- end
-
- it "sets the value of a textarea element" do
- browser.textarea(id: 'delete_user_comment').set!('Hello Cruel World')
- expect(browser.textarea(id: "delete_user_comment").value).to eq 'Hello Cruel World'
- end
-
- it "fires events" do
- browser.text_field(id: "new_user_username").set!("Hello World")
- expect(browser.span(id: "current_length").text).to eq "11"
- end
-
- it "sets the value of a password field" do
- browser.text_field(name: 'new_user_password').set!('secret')
- expect(browser.text_field(name: 'new_user_password').value).to eq 'secret'
- end
-
- it "sets the value when accessed through the enclosing Form" do
- browser.form(id: 'new_user').text_field(name: 'new_user_password').set!('secret')
- expect(browser.form(id: 'new_user').text_field(name: 'new_user_password').value).to eq 'secret'
- end
-
- it "is able to set multi-byte characters" do
- browser.text_field(name: "new_user_occupation").set!("ijij")
- expect(browser.text_field(name: "new_user_occupation").value).to eq "ijij"
- end
-
- it "sets the value to a concatenation of multiple arguments" do
- browser.text_field(id: 'new_user_email').set!('Bye', 'Cruel', 'World')
- expect(browser.text_field(id: "new_user_email").value).to eq 'ByeCruelWorld'
- end
-
- it "sets the value to blank when no arguments are provided" do
- browser.text_field(id: 'new_user_email').set!
- expect(browser.text_field(id: "new_user_email").value).to eq ''
- end
-
- it "raises ArgumentError for special keys" do
- expect { browser.text_field(id: 'new_user_email').set!('a', :tab) }.to raise_error(ArgumentError)
- end
-
- it "raises UnknownObjectException if the text field doesn't exist" do
- expect { browser.text_field(id: "no_such_id").set!('secret') }.to raise_unknown_object_exception
- end
- end
end