serialbandicoot / metallize Goto Github PK
View Code? Open in Web Editor NEWTesting library to Integrate Mechanize and Selenium-Webdriver
License: Apache License 2.0
Testing library to Integrate Mechanize and Selenium-Webdriver
License: Apache License 2.0
Currently text fields are cleared down as default, however there might be occasions when you do not want to clear.
def fill_in_field_data
@fields.each do |field|
unless field.kind_of?(Metallize::Form::Hidden)
element = @driver.find_element(name: field.name)
if element.displayed? and !field.value.empty?
element.clear
element.send_keys field.value
end
end
end
end
On Metz initialise an attr should be set so we don't clear down the fields first.
e.g. timeout uses the same procedure.
@serialbandicoot Will this handle conditional Fields?
Will it also handle Sub-forms
And will it also handle User based specific actions?
This issue may be incorrect as iโm reading it from a slack comment.
It would be good if we could get Travis configured to send slack notifications to Slack instead of Sam's personal e-mail
https:.//docs.travis-ci.com/user/notifications/#configureing-slack-notifications
Investigate the cause of pages with multiple forms with lots of hidden fields are slow to load.
Is there an alternative way of build a form profile.
There is currently no way to upload a file.
https://github.com/sparklemotion/mechanize/blob/master/examples/flickr_upload.rb
class Mechanize::Form::FileUpload < Mechanize::Form::Field
attr_accessor :file_name # File name
attr_accessor :mime_type # Mime Type (Optional)
alias :file_data :value
alias :file_data= :value=
def initialize node, file_name
@file_name = Mechanize::Util.html_unescape(file_name)
@file_data = nil
@node = node
super(node, @file_data)
end
end
Currently RSpec cannot be run from spec terminal because of the way the Metz library is being initiated.
Currently to insert data into the page, send_key is being used.
def fill_in_field_data
@fields.each do |field|
unless field.kind_of?(Metallize::Form::Hidden)
element = @driver.find_element(name: field.name)
if element.displayed? and !field.value.empty?
element.clear
element.send_keys field.value
end
end
end
end
Instead of using send_keys
, it would be more efficient to inject the data straight in, for example using javascript.
RSpec is current being used as the test framework and although its running quite quickly it would be good to see it using the parallel option.
Currently when setting a field with JS via the WebDriver Injector the code is executing in two statements.
js_size = "return document.getElementsByName(\"#{field.name}\").length"
js_update = "document.getElementsByName(\"#{field.name}\")[0].value = '#{field.value}'"
if execute(driver, js_size) > 0
execute(driver, js_update)
else
raise "Unable to locate web element with javascript element #{field.name}"
end
A fix will be to execute this in 1 statement.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.