senny / corner_stones Goto Github PK
View Code? Open in Web Editor NEWcapybara building blocks for acceptance tests.
capybara building blocks for acceptance tests.
when you use the module WithInlineErrors to validate the form, every html-element with a css-class "error" is treated as an error. Even if the element is not related to the form.
the problem can be found in the file "with_inline_errors.rb":
all('.error').map do |container|
the solution is that the check for error-elements has to be within the form scope.
wouldn't it be better to use the existing functionality of rails than using a new css-class to find the link which is used to delete a record?
so you could use:
def attributes_for_row(row)
super.merge('Delete-Link' => row.first('td *[data-method=delete]'))
end
instead of:
def attributes_for_row(row)
super.merge('Delete-Link' => row.first('td .delete-action'))
end
so the user wouldn't have to add a css-class which is only used as identifier.
Hidden fields has no labels, they must be handled by a method called for example: attributes_hidden
It should be possible to assert that the form contains a set of attributes. A possible interface could look like:
form.attribtues
# should return a hash of label, values from the formform.assert_attributes(attribute_hash)
# attribute_hash has labels texts as keys and the text as values.In our forms we have a bunch of special autocompletion fields which do not conform with the implementation for the standard autocompletion field. So corner_stones doesn't work with them.
It would be nice to have a mechanism to provide custom field handlers like:
CornerStones::Form::FieldSelector.add_field_handler(custom_autocompleter)
Or with a config like mechanism:
CornerStones::Form.config do |c|
c.add_field_handler(custom_autocompleter)
end
corner_stones should check the custom field handlers before the general handlers provided by itself because the custom fields are always subsets of the general handlers.
Instead of waiting one second until the autocompletion list appear, it would be much nicer to have a behavior like wait_until.
If I have a table row like this:
<thead>
<tr>
<th>
Person
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Jack
</td>
</tr>
</tbody>
then the row detection fails. CornerStones::Table gives me the following results:
table.rows # => [{"Person"=>"\nJack\n"}]
table.row('Person' => 'Jack') # => nil
This is due to the fact that the row detection checks for string equality.
the current implementations returns the value of the selected option tags. This isn't that useful when writing tests, since you want to check on the text you've selected. I think we should change form#attributes to return the text from the selected option tag.
i've got a little question about the handling of colspans in corner_stones:
at the moment a cell with colspan is handled like a normal cell without colspan e.g.:
<table>
<tr>
<th>Date</th>
<th>State</th>
<th>Sum</th>
</tr>
<tr>
<td colspan="2">Total</td>
<td>1000</td>
</tr>
</table>
with this table you get the following row-hash:
{ 'Date' => 'Total', 'State' => 1000, 'Sum' => nil }
i would expect the following:
{ 'Date' => 'Total', 'State' => nil, 'Sum' => 1000 }
or even that:
{ 'Date' => 'Total', 'Sum' => 1000 }
what do you think about that?
we need an object to represent a page navigation. It should support the following protocol:
open
navigate to the pageitems
list of all the possible navigation linksWhats the proper usefull handling of Radio Buttons?
we need an extension for a table to allow pagination. The interface could look something like:
next_page
navigate to the next pageprevious_page
navigate to the previous pageopen_page(number)
jump to the page numberThe methods should raise an error when navigating in the desired direction is not possible.
Currently the UnknownFieldError
is raised under different circumstances. The name suggests, that the field was found but corner_stones does not know how to handle it:
don't know how to fill the field veranstaltung_sektion (CornerStones::Form::UnknownFieldError)
This could happen with custom inputs, or html5 fields we haven't implemented at the moment.
On the other hand this error also occurs, when there is no such field on the page, or when there is a label with the right name but the for
attribute does not point to a valid field.
I think we should either change the error-message to explain the cause better or raise a different error when the field is not on the page.
Currently form#attributes
returns the full label text, which includes the "*" for required fields. This makes writing tests much harder since the field-names change when validations change.
Our required text is contained within the following html: <abbr title="required">*</abbr>
I think we should filter the abbr
from the text used in the attributes.
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.