Browse Source

Cleanup for MR

merge-requests/128/head
Jonas Zohren 5 years ago
parent
commit
72637de9a9
  1. 10
      .gitlab-ci.yml
  2. 15
      tests/client-element-web/test-element-web-registration.js

10
.gitlab-ci.yml

@ -32,23 +32,25 @@ test:cargo: @@ -32,23 +32,25 @@ test:cargo:
- cargo test --workspace --verbose --locked
- cargo clippy
test:register:element-release:
test:register:element-web-stable:
stage: "test"
needs:
- "build:cargo:x86_64-unknown-linux-gnu"
image: "buildkite/puppeteer:latest"
tags: ["docker"]
interruptible: true
script:
- "CONDUIT_CONFIG=tests/test-config.toml ./conduit-x86_64-unknown-linux-gnu > conduit.log &"
- "cd tests/puppeteer/"
- "cd tests/client-element-web/"
- "npm install puppeteer"
- "node test-element-web.js"
- "node test-element-web-registration.js \"https://app.element.io/\" \"http://localhost:6167\""
- "killall --regexp \"conduit\""
- "cd ../.."
- "cat conduit.log"
artifacts:
paths:
- "tests/puppeteer/*.png"
- "tests/client-element-web/*.png"
- "*.log"
expire_in: 1 week
when: always

15
tests/puppeteer/test-element-web.js → tests/client-element-web/test-element-web-registration.js

@ -1,13 +1,20 @@ @@ -1,13 +1,20 @@
const puppeteer = require('puppeteer');
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);
process.exit(111);
});
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 password = "testpassword" + String(Math.floor(Math.random() * 100000));
console.debug("Testuser for this run:\n User: " + username + "\n Password: " + password);
@ -19,9 +26,9 @@ async function run() { @@ -19,9 +26,9 @@ async function run() {
});
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");
await page.waitForSelector('a.mx_ButtonCreateAccount');
@ -42,7 +49,7 @@ async function run() { @@ -42,7 +49,7 @@ async function run() {
await page.waitForSelector('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' });
Loading…
Cancel
Save