mirror of https://github.com/vector-im/riot-web
test default server setup for signup
parent
c693d861f4
commit
1643b9552e
2
start.js
2
start.js
|
@ -35,7 +35,7 @@ async function runTests() {
|
||||||
const username = 'user-' + helpers.randomInt(10000);
|
const username = 'user-' + helpers.randomInt(10000);
|
||||||
const password = 'testtest';
|
const password = 'testtest';
|
||||||
process.stdout.write(`* signing up as ${username} ... `);
|
process.stdout.write(`* signing up as ${username} ... `);
|
||||||
await signup(page, username, password, homeserver);
|
await signup(page, username, password);
|
||||||
process.stdout.write('done\n');
|
process.stdout.write('done\n');
|
||||||
|
|
||||||
const noticesName = "Server Notices";
|
const noticesName = "Server Notices";
|
||||||
|
|
|
@ -18,16 +18,18 @@ const helpers = require('../helpers');
|
||||||
const acceptTerms = require('./consent');
|
const acceptTerms = require('./consent');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
module.exports = async function signup(page, username, password, homeserver, options) {
|
module.exports = async function signup(page, username, password, homeserver) {
|
||||||
const consoleLogs = helpers.logConsole(page);
|
const consoleLogs = helpers.logConsole(page);
|
||||||
const xhrLogs = helpers.logXHRRequests(page);
|
const xhrLogs = helpers.logXHRRequests(page);
|
||||||
await page.goto(helpers.riotUrl('/#/register'));
|
await page.goto(helpers.riotUrl('/#/register'));
|
||||||
//click 'Custom server' radio button
|
//click 'Custom server' radio button
|
||||||
|
if (homeserver) {
|
||||||
const advancedRadioButton = await helpers.waitAndQuerySelector(page, '#advanced');
|
const advancedRadioButton = await helpers.waitAndQuerySelector(page, '#advanced');
|
||||||
await advancedRadioButton.click();
|
await advancedRadioButton.click();
|
||||||
|
}
|
||||||
|
// wait until register button is visible
|
||||||
|
await page.waitForSelector('.mx_Login_submit[value=Register]');
|
||||||
//fill out form
|
//fill out form
|
||||||
await page.waitForSelector('.mx_ServerConfig', {visible: true, timeout: 500});
|
|
||||||
const loginFields = await page.$$('.mx_Login_field');
|
const loginFields = await page.$$('.mx_Login_field');
|
||||||
assert.strictEqual(loginFields.length, 7);
|
assert.strictEqual(loginFields.length, 7);
|
||||||
const usernameField = loginFields[2];
|
const usernameField = loginFields[2];
|
||||||
|
@ -37,7 +39,10 @@ module.exports = async function signup(page, username, password, homeserver, opt
|
||||||
await helpers.replaceInputText(usernameField, username);
|
await helpers.replaceInputText(usernameField, username);
|
||||||
await helpers.replaceInputText(passwordField, password);
|
await helpers.replaceInputText(passwordField, password);
|
||||||
await helpers.replaceInputText(passwordRepeatField, password);
|
await helpers.replaceInputText(passwordRepeatField, password);
|
||||||
|
if (homeserver) {
|
||||||
|
await page.waitForSelector('.mx_ServerConfig', {visible: true, timeout: 500});
|
||||||
await helpers.replaceInputText(hsurlField, homeserver);
|
await helpers.replaceInputText(hsurlField, homeserver);
|
||||||
|
}
|
||||||
//wait over a second because Registration/ServerConfig have a 1000ms
|
//wait over a second because Registration/ServerConfig have a 1000ms
|
||||||
//delay to internally set the homeserver url
|
//delay to internally set the homeserver url
|
||||||
//see Registration::render and ServerConfig::props::delayTimeMs
|
//see Registration::render and ServerConfig::props::delayTimeMs
|
||||||
|
|
Loading…
Reference in New Issue