xowiki-test-procs.tcl

  • last updated 35 mins ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Test behavior of HTML5 date and time formfields when invalid values are submitted

Improve visualization of test info

Relax test condition:

make sure potential injections are not rendered on the page response.

Extend test suite

when testing FormPage validation, make sure two distinct behaviors are respected:

1) Rejected values that were part of the request are kept into their original form fields so the user can rework them and resubmit

2) Other parts of the page, such as the page title, are NOT influenced by data that faild to validate

Rationale: displaying unvalidated information as part of the response can be interpreted as a page injection.

In current codebase, that the title was changed indicates, that rejected information made its way into the :title object member of the FormPage.

The potential consequences of the FormPage setting unvalidated information into its members depends on a number of factors such as formfield logics, callbacks and proper page quoting (to name a few).

Extend test: edit a different component of repeated compound 3 to also test that old and new values are stored as expected

Extend and fix xowiki.create_form_with_form_instance automated test with respect to checkbox behavior

- simple checkboxes (normal and repeated): as we do not specify a value for those, the default should be expected, not the last option

- checkboxes in repeated compound fields: upon triavial re-editing, the values should stay the same

This change exposes a bug in acs::test::xpath::get_form_values

improve field validation

  1. … 3 more files in changeset.
Test behavior of the omit formfield spec

Extend test: show that even when a field is defined as disabled, a request crafted to carry these fields will get through and the values will be stored

A fix will come shortly, similar to what was done for compound fields

Document and enforce expected behavior when Forms are deleted: this is forbidden and returns an error as long as they have instances

prefer variable ::acs::rootdir over proc [acs_root_dir]

  1. … 1 more file in changeset.
fix bug: tcl clock format %e returns in current versions single digit values with leading whitespace, which are invalid values for the options field.

Since non of the date-component fields is supposed to contain leading (or trailing) white-space,

this is now trimmed.

  1. … 1 more file in changeset.
add test case for disabled checkbox (should be the same as for non-disabled case)

provide test for p.configure parameter

Don't enforce options validation on disabled fields, demonstrate that this won't allow to insert invalid values in the field

Fix the test, which was not actually reproducing the issue

in order to do so, I had to fix the behavior of acs::test::xpath::get_form_values: we should in fact NOT extract the value of disabled formfield, as a real browser will not send them in the POST request.

  1. … 1 more file in changeset.
Expose behavior:

extend date formfield test to include also a date in a specific format from downstream, set to disabled. Set the day of the month as a number < 10. Show that in this case the validation will complain about an invalid value. This because the field is represented as " 1" rather than the expected "1"

Modernize api

Improve test robustness:

the folder in the test is required, so it might be the case that its state was already tampered with. Change the test to first make sure the state from db and object are consistent, whatever they are, then perform some set/fetch/check tests on 3 arbitrary states

extended regression test

  1. … 1 more file in changeset.
Test reproducing an upstream use case: a compound field made of both regular, and compound field, with the compound field also repeated

This test exposes a bug in the acs::test::xpath::get_form_values proc

list covered test cases

  1. … 2 more files in changeset.
Added convenience function ::xowiki::test::get_content

This function eases testing by just retrieving the content part of a

page, leaving out header and footers of the theme.

  1. … 1 more file in changeset.
cleanup test

use more compact idioms, remove useless code, etc.

  1. … 1 more file in changeset.
fixed test case

returned violation on plain instance

New automated test for a page, including another page, which includes a picture, checking that everything works as expected

generalize locales with a decimal point as comma, extend test with repeated form fields

Bring back de_DE as language in the test

Use double quotes consistently in comment

Extend automated test with usage of a numeric formfield in the context of a compound field, use it_IT as the locale to check against, as upstream de_DE has also the dot separator like en_US