casper: Use data-stream-id to find checkboxes.

This commit is contained in:
Steve Howell 2020-01-28 20:43:44 +00:00 committed by Tim Abbott
parent d40f18c4f0
commit f1cfcd2f55
2 changed files with 10 additions and 1 deletions

View File

@ -310,6 +310,14 @@ exports.get_user_id = function (email) {
});
};
exports.get_stream_id = function (stream_name) {
return casper.evaluate(function (stream_name) {
return stream_data.get_stream_id(stream_name);
}, {
stream_name: stream_name,
});
};
// Inject key presses by running some jQuery code in page context.
// PhantomJS and CasperJS don't provide a clean way to insert key
// presses by code, only strings of printable characters.

View File

@ -1,7 +1,8 @@
var common = require('../casper_lib/common.js');
function stream_checkbox(stream_name) {
return '#stream-checkboxes [data-stream-name="' + stream_name + '"]';
const stream_id = common.get_stream_id(stream_name);
return '#stream-checkboxes [data-stream-id="' + stream_id + '"]';
}
function user_checkbox(email) {