mirror of https://github.com/zulip/zulip.git
casper: Use data-stream-id to find checkboxes.
This commit is contained in:
parent
d40f18c4f0
commit
f1cfcd2f55
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue