Skip to content
Snippets Groups Projects
Commit ae17793b authored by Tom Robinson's avatar Tom Robinson
Browse files

Screenshots

parent b7b5813f
No related branches found
No related tags found
No related merge requests found
......@@ -40,3 +40,4 @@ bin/release/aws-eb/metabase-aws-eb.zip
/reset-password-artifacts
/.env
/npm-debug.log
/screenshots
......@@ -48,4 +48,5 @@ deployment:
- ./bin/deploy-webhook $DEPLOY_WEBHOOK
general:
artifacts:
- "target/uberjar/metabase.jar"
- target/uberjar/metabase.jar
- screenshots
import { startServer, isReady } from "../support/start-server";
import webdriver, { By, until } from "selenium-webdriver";
import fs from "fs-promise";
import path from "path";
jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;
......@@ -15,6 +17,16 @@ function waitForUrl(driver, url, timeout = 5000) {
return driver.wait(async () => await driver.getCurrentUrl() === url, timeout);
}
async function screenshot(driver, filename) {
let dir = path.dirname(filename);
if (dir && !(await fs.exists(dir))){
await fs.mkdir(dir);
}
let image = await driver.takeScreenshot();
await fs.writeFile(filename, image, 'base64');
}
describe("auth/login", () => {
let server, driver;
......@@ -39,6 +51,7 @@ describe("auth/login", () => {
await driver.get(`${server.host}/`);
await waitForUrl(driver, `${server.host}/auth/login?redirect=%2F`);
expect(await driver.isElementPresent(By.css("[name=email]"))).toEqual(true);
await screenshot(driver, "screenshots/auth-login.png");
});
it ("should log you in", async () => {
......@@ -65,6 +78,11 @@ describe("auth/login", () => {
await driver.get(`${server.host}/`);
await waitForUrl(driver, `${server.host}/`);
});
it ("loads the qb", async () => {
await driver.get(`${server.host}/q#eyJuYW1lIjpudWxsLCJkYXRhc2V0X3F1ZXJ5Ijp7ImRhdGFiYXNlIjoxLCJ0eXBlIjoibmF0aXZlIiwibmF0aXZlIjp7InF1ZXJ5Ijoic2VsZWN0ICdvaCBoYWkgZ3Vpc2Ug8J-QsScifSwicGFyYW1ldGVycyI6W119LCJkaXNwbGF5Ijoic2NhbGFyIiwidmlzdWFsaXphdGlvbl9zZXR0aW5ncyI6e319`);
await screenshot(driver, "screenshots/qb.png");
});
});
afterAll(async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment