Merge branch 'master' of github.com:Mailtrain-org/mailtrain
Conflicts: test/e2e/index.js test/e2e/lib/mail.js test/e2e/lib/mocha-e2e.js test/e2e/lib/page.js test/e2e/lib/worker-counter.js test/e2e/page-objects/subscription.js
This commit is contained in:
commit
731226dfeb
20 changed files with 580 additions and 105 deletions
|
@ -13,15 +13,46 @@ module.exports = {
|
|||
}
|
||||
},
|
||||
lists: {
|
||||
one: {
|
||||
l1: {
|
||||
id: 1,
|
||||
cid: 'Hkj1vCoJb',
|
||||
publicSubscribe: 1,
|
||||
unsubscriptionMode: 0
|
||||
unsubscriptionMode: 0, // (one-step, no form)
|
||||
},
|
||||
l2: {
|
||||
id: 2,
|
||||
cid: 'SktV4HDZ-',
|
||||
publicSubscribe: 1,
|
||||
unsubscriptionMode: 1, // (one-step, with form)
|
||||
},
|
||||
l3: {
|
||||
id: 3,
|
||||
cid: 'BkdvNBw-W',
|
||||
publicSubscribe: 1,
|
||||
unsubscriptionMode: 2, // (two-step, no form)
|
||||
},
|
||||
l4: {
|
||||
id: 4,
|
||||
cid: 'rJMKVrDZ-',
|
||||
publicSubscribe: 1,
|
||||
unsubscriptionMode: 3, // (two-step, with form)
|
||||
},
|
||||
l5: {
|
||||
id: 5,
|
||||
cid: 'SJgoNSw-W',
|
||||
publicSubscribe: 1,
|
||||
unsubscriptionMode: 4, // (manual unsubscribe)
|
||||
},
|
||||
l6: {
|
||||
id: 6,
|
||||
cid: 'HyveEPvWW',
|
||||
publicSubscribe: 0,
|
||||
unsubscriptionMode: 0, // (one-step, no form)
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
'service-url' : 'http://localhost:' + config.www.port + '/',
|
||||
'service-url': 'http://localhost:' + config.www.port + '/',
|
||||
'admin-email': 'admin@example.com',
|
||||
'default-homepage': 'https://mailtrain.org',
|
||||
'smtp-hostname': config.testserver.host,
|
||||
'smtp-port': config.testserver.port,
|
||||
|
|
|
@ -13,10 +13,8 @@ const driver = new webdriver.Builder()
|
|||
.forBrowser(config.app.seleniumwebdriver.browser || 'phantomjs')
|
||||
.build();
|
||||
|
||||
|
||||
const failHandlerRunning = new WorkerCounter();
|
||||
|
||||
|
||||
function UseCaseReporter(runner) {
|
||||
Mocha.reporters.Base.call(this, runner);
|
||||
|
||||
|
@ -212,4 +210,4 @@ module.exports = {
|
|||
steps,
|
||||
precondition,
|
||||
driver
|
||||
};
|
||||
};
|
||||
|
|
|
@ -32,9 +32,13 @@ module.exports = (...extras) => Object.assign({
|
|||
return params;
|
||||
},
|
||||
|
||||
async waitUntilVisible() {
|
||||
async waitUntilVisible(selector) {
|
||||
await driver.wait(until.elementLocated(By.css('body')), waitTimeout);
|
||||
|
||||
if (selector) {
|
||||
await driver.wait(until.elementLocated(By.css(selector)), waitTimeout);
|
||||
}
|
||||
|
||||
for (const elem of (this.elementsToWaitFor || [])) {
|
||||
const sel = this.elements[elem];
|
||||
if (!sel) {
|
||||
|
@ -54,13 +58,13 @@ module.exports = (...extras) => Object.assign({
|
|||
await driver.executeScript('document.mailTrainRefreshAcknowledged = true;');
|
||||
},
|
||||
|
||||
async waitUntilVisibleAfterRefresh() {
|
||||
async waitUntilVisibleAfterRefresh(selector) {
|
||||
await driver.wait(new webdriver.Condition('for refresh', async driver => {
|
||||
const val = await driver.executeScript('return document.mailTrainRefreshAcknowledged;');
|
||||
return !val;
|
||||
}), waitTimeout);
|
||||
|
||||
await this.waitUntilVisible();
|
||||
await this.waitUntilVisible(selector);
|
||||
},
|
||||
|
||||
async click(key) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue