mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 16:26:08 +08:00
Summary: - Make sure user can log in using exchange - Adds some test helpers for the test - Updates eslint.json and cleans up lint errors Test Plan: - Integration Tests Reviewers: evan, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2346
21 lines
459 B
JavaScript
21 lines
459 B
JavaScript
|
|
export const wait = (ms)=> {
|
|
return new Promise((resolve)=> {
|
|
setTimeout(()=> resolve(), ms);
|
|
});
|
|
};
|
|
|
|
export const clickRepeat = (client, selector, {times = 1, interval = 0} = {})=> {
|
|
if (times === 1) return client.click(selector);
|
|
const fn = (remaining)=> {
|
|
if (remaining > 0) {
|
|
return (
|
|
client.click(selector)
|
|
.then(()=> wait(interval))
|
|
.then(()=> fn(remaining - 1))
|
|
);
|
|
}
|
|
};
|
|
return fn(times);
|
|
};
|