1
0
mirror of https://github.com/amir20/dozzle.git synced 2026-01-03 19:45:01 +01:00

Adds more int tests for custom base

This commit is contained in:
Amir Raminfar
2020-07-02 11:01:11 -07:00
parent 045ff730bc
commit 3aa420a589
8 changed files with 37 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
FROM amir20/docker-alpine-puppeteer:edge
COPY --chown=pptruser:pptruser package*.json yarn.lock /app/
RUN yarn
RUN yarn
COPY --chown=pptruser:pptruser . /app/

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -0,0 +1,23 @@
const puppeteer = require("puppeteer");
const iPhoneX = puppeteer.devices["iPhone X"];
const iPadLandscape = puppeteer.devices["iPad landscape"];
const { CUSTOM_BASE: BASE } = process.env;
describe("Dozzle with custom base", () => {
beforeEach(async () => {
await page.goto(`${BASE}foobarbase`, { waitUntil: "networkidle2" });
});
it("renders full page on desktop", async () => {
const image = await page.screenshot({ fullPage: true });
expect(image).toMatchImageSnapshot();
});
it("and shows one container with correct title", async () => {
const menuTitle = await page.$eval("aside ul.menu-list li a", (e) => e.title);
expect(menuTitle).toEqual("custom_base");
});
});

View File

@@ -2,7 +2,7 @@ const puppeteer = require("puppeteer");
const iPhoneX = puppeteer.devices["iPhone X"];
const iPadLandscape = puppeteer.devices["iPad landscape"];
const { BASE } = process.env;
const { DEFAULT_BASE: BASE } = process.env;
describe("home page", () => {
beforeEach(async () => {

View File

@@ -1,5 +1,14 @@
version: "3.4"
services:
custom_base:
container_name: custom_base
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DOZZLE_FILTER=name=custom_base
- DOZZLE_BASE=/foobarbase
build:
context: ..
dozzle:
container_name: dozzle
volumes:
@@ -13,6 +22,8 @@ services:
context: .
command: yarn test
environment:
- BASE=http://dozzle:8080/
- DEFAULT_BASE=http://dozzle:8080/
- CUSTOM_BASE=http://custom_base:8080/
depends_on:
- dozzle
- custom_base