Fix "Form with a readonly input and non-readonly inputs" test case in test_autofillFormFields.js
Categories
(Toolkit :: Form Autofill, task, P3)
Tracking
()
People
(Reporter: tgiles, Unassigned, Mentored)
References
Details
As part of working on Bug 1436793, I noticed that the "Form with a readonly input and non-readonly inputs" case doesn't test the readonly situation that we want to cover. For example, if you run test_autofillFormFields.js
, you'll see in the logs for the faulty test case the following:
INFO "Starting testcase: Form with a readonly input and non-readonly inputs"
INFO (xpcshell/head.js) | test run_next_test 10 finished (2)
PASS - Checking given-name field fires input event - true == true
PASS - Checking given-name field fires change event - true == true
PASS - Check the given-name field was filled with correct data - "John" == "John"
PASS - Checking family-name field fires input event - true == true
PASS - Checking family-name field fires change event - true == true
PASS - Check the family-name field was filled with correct data - "Doe" == "Doe"
PASS - Checking street-addr field fires input event - true == true
PASS - Checking street-addr field fires change event - true == true
PASS - Check the street-addr field was filled with correct data - "100 Main Street" == "100 Main Street"
PASS - Check if filledRecordGUID is set correctly - "123" == "123"
INFO (xpcshell/head.js) | test run_next_test 11 pending (2)
INFO (xpcshell/head.js) | test finished (2)
However the test case has an entry for "city" and expected result for "city", which is also the readonly field, but the case doesn't check this element. This is because the profileData needs to have "address-level2" instead of "city", but switching this out will cause the test to hang since there will never be an input or change event fired for this readonly input. To get around this issue, I created a new type of test called TESTCASES_BOTH_CHANGED_AND_UNCHANGED
that handles this situation.
So the invalid readonly test case will need its profile data updated and it will need to be moved to this new testcase collection. This will be a good first bug, but I'm going to wait until Bug 1436793 to land to simplify the development process.
Description
•