Added waitUntilVisibleAfterRefresh and textsToWaitFor - both discussed with @witzig.
Page objects refactored to exploit textsToWaitFor if relevant. Login tests refactored for the newer API. Some additional tests in subscription. The rest at least included as "pending".
This commit is contained in:
parent
ccd37ac792
commit
bb2b3da9dd
14 changed files with 446 additions and 393 deletions
35
test/e2e/lib/semaphore.js
Normal file
35
test/e2e/lib/semaphore.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
const Promise = require('bluebird');
|
||||
|
||||
class Semaphore {
|
||||
constructor() {
|
||||
this.counter = 0;
|
||||
}
|
||||
|
||||
enter() {
|
||||
this.counter++;
|
||||
}
|
||||
|
||||
exit() {
|
||||
this.counter--;
|
||||
}
|
||||
|
||||
async waitForEmpty() {
|
||||
const self = this;
|
||||
|
||||
function wait(resolve) {
|
||||
if (self.counter == 0) {
|
||||
resolve();
|
||||
} else {
|
||||
setTimeout(wait, 500, resolve);
|
||||
}
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
setTimeout(wait, 500, resolve);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Semaphore;
|
Loading…
Add table
Add a link
Reference in a new issue