We should not wait for an arbitrary amount of time, which can easily cause intermittent failures, but wait for a value change instead. Note that this patch mirrors the approach we already use in other scripting integration tests that also check for a value change; see e.g. the "must check that a field has the correct formatted value" test.