tests: Wait for commit instead of sleep in timeslider_revisions.js

This commit is contained in:
Richard Hansen 2021-04-01 04:32:05 -04:00 committed by webzwo0i
parent d15ff9ce8d
commit 7a154b1e1d

View file

@ -9,18 +9,10 @@ describe('timeslider', function () {
it('loads adds a hundred revisions', async function () { it('loads adds a hundred revisions', async function () {
this.timeout(100000); this.timeout(100000);
const inner$ = helper.padInner$;
const chrome$ = helper.padChrome$; const chrome$ = helper.padChrome$;
// make some changes to produce 100 revisions // Create a bunch of revisions.
const timePerRev = 900; for (let i = 0; i < 99; i++) await helper.edit('a');
const revs = 99;
this.timeout(revs * timePerRev + 10000);
for (let i = 0; i < revs; i++) {
await new Promise((resolve) => setTimeout(resolve, timePerRev));
// enter 'a' in the first text element
inner$('div').first().sendkeys('a');
}
chrome$('.buttonicon-savedRevision').click(); chrome$('.buttonicon-savedRevision').click();
// go to timeslider // go to timeslider
@ -65,17 +57,8 @@ describe('timeslider', function () {
// Disabled as jquery trigger no longer works properly // Disabled as jquery trigger no longer works properly
xit('changes the url when clicking on the timeslider', async function () { xit('changes the url when clicking on the timeslider', async function () {
const inner$ = helper.padInner$; // Create some revisions.
for (let i = 0; i < 20; i++) await helper.edit('a');
// make some changes to produce 7 revisions
const timePerRev = 1000;
const revs = 20;
this.timeout(revs * timePerRev + 10000);
for (let i = 0; i < revs; i++) {
await new Promise((resolve) => setTimeout(resolve, timePerRev));
// enter 'a' in the first text element
inner$('div').first().sendkeys('a');
}
// go to timeslider // go to timeslider
$('#iframe-container iframe') $('#iframe-container iframe')