|
|
|
@ -1,13 +1,20 @@ |
|
|
|
const puppeteer = require('puppeteer'); |
|
|
|
const puppeteer = require('puppeteer'); |
|
|
|
|
|
|
|
|
|
|
|
run().then(() => console.log('Done')).catch(error => { |
|
|
|
run().then(() => console.log('Done')).catch(error => { |
|
|
|
console.error("Registration test failed"); |
|
|
|
console.error("Registration test failed."); |
|
|
|
|
|
|
|
console.error("There might be a screenshot of the failure in the artifacts.\n"); |
|
|
|
console.error(error); |
|
|
|
console.error(error); |
|
|
|
process.exit(111); |
|
|
|
process.exit(111); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
async function run() { |
|
|
|
async function run() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const elementUrl = process.argv[process.argv.length - 2]; |
|
|
|
|
|
|
|
console.debug("Testing registration with ElementWeb hosted at "+ elementUrl); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const homeserverUrl = process.argv[process.argv.length - 1]; |
|
|
|
|
|
|
|
console.debug("Homeserver url: "+ homeserverUrl); |
|
|
|
|
|
|
|
|
|
|
|
const username = "testuser" + String(Math.floor(Math.random() * 100000)); |
|
|
|
const username = "testuser" + String(Math.floor(Math.random() * 100000)); |
|
|
|
const password = "testpassword" + String(Math.floor(Math.random() * 100000)); |
|
|
|
const password = "testpassword" + String(Math.floor(Math.random() * 100000)); |
|
|
|
console.debug("Testuser for this run:\n User: " + username + "\n Password: " + password); |
|
|
|
console.debug("Testuser for this run:\n User: " + username + "\n Password: " + password); |
|
|
|
@ -19,9 +26,9 @@ async function run() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const page = await browser.newPage(); |
|
|
|
const page = await browser.newPage(); |
|
|
|
await page.goto('https://app.element.io/'); |
|
|
|
await page.goto(elementUrl); |
|
|
|
|
|
|
|
|
|
|
|
await page.screenshot({ path: '01-element-web-started.png' }); |
|
|
|
await page.screenshot({ path: '01-element-web-opened.png' }); |
|
|
|
|
|
|
|
|
|
|
|
console.debug("Click [Create Account] button"); |
|
|
|
console.debug("Click [Create Account] button"); |
|
|
|
await page.waitForSelector('a.mx_ButtonCreateAccount'); |
|
|
|
await page.waitForSelector('a.mx_ButtonCreateAccount'); |
|
|
|
@ -42,7 +49,7 @@ async function run() { |
|
|
|
await page.waitForSelector('input#mx_homeserverInput'); |
|
|
|
await page.waitForSelector('input#mx_homeserverInput'); |
|
|
|
await page.click('input#mx_homeserverInput'); |
|
|
|
await page.click('input#mx_homeserverInput'); |
|
|
|
await page.click('input#mx_homeserverInput'); |
|
|
|
await page.click('input#mx_homeserverInput'); |
|
|
|
await page.keyboard.type('http://localhost:6167'); |
|
|
|
await page.keyboard.type(homeserverUrl); |
|
|
|
|
|
|
|
|
|
|
|
await page.screenshot({ path: '04-typed-in-homeserver.png' }); |
|
|
|
await page.screenshot({ path: '04-typed-in-homeserver.png' }); |
|
|
|
|
|
|
|
|