do accepting terms as part of signup since we try to create a room with riot-bot after login, which fails with consent warning

This commit is contained in:
Bruno Windels 2018-07-17 12:38:20 +02:00
parent 83eebfdecc
commit fc4c425a22
2 changed files with 13 additions and 18 deletions

View file

@ -57,7 +57,6 @@ module.exports = async function signup(page, username, password, homeserver) {
await continueButton.click();
//wait for registration to finish so the hash gets set
//onhashchange better?
await helpers.delay(1000);
/*
await page.screenshot({path: "afterlogin.png", fullPage: true});
console.log('browser console logs:');
@ -66,11 +65,23 @@ module.exports = async function signup(page, username, password, homeserver) {
console.log(xhrLogs.logs());
*/
await acceptTerms(page);
await helpers.delay(10000);
//printElements('page', await page.$('#matrixchat'));
// await navigation_promise;
//await page.waitForSelector('.mx_MatrixChat', {visible: true, timeout: 3000});
const url = page.url();
assert.strictEqual(url, helpers.riotUrl('/#/home'));
}
async function acceptTerms(page) {
const reviewTermsButton = await helpers.waitAndQuerySelector(page, '.mx_QuestionDialog button.mx_Dialog_primary');
const termsPagePromise = helpers.waitForNewPage();
await reviewTermsButton.click();
const termsPage = await termsPagePromise;
const acceptButton = await termsPage.$('input[type=submit]');
await acceptButton.click();
await helpers.delay(500); //TODO yuck, timers
}