Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: try lost pixel #67

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
28 changes: 28 additions & 0 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Regression

on:
pull_request:
branches: ["*"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run preview -- --filter=pink-design
run: (npm run preview -- --filter=pink-design&)
- name: Sleep for 10 seconds
run: sleep 10
shell: bash
- name: Lost Pixel
uses: lost-pixel/[email protected]
env:
LOST_PIXEL_API_KEY: ${{ secrets.LOST_PIXEL_API_KEY }}
36 changes: 17 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Run Linter
run: npm run lint
continue-on-error: true
- name: Build packages
run: npm run build
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Run Linter
run: npm run lint
continue-on-error: true
- name: Build packages
run: npm run build
2 changes: 2 additions & 0 deletions .lostpixel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
current
difference
Binary file added .lostpixel/baseline/buttons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .lostpixel/baseline/card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .lostpixel/baseline/input-field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion apps/pink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "astro dev",
"start": "astro dev",
"build": "astro build && node ./search.mjs",
"preview": "astro preview",
"preview": "astro preview --host",
"astro": "astro",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/pink/public/search.json

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions lostpixel.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { CustomProjectConfig, PageScreenshotParameter } from "lost-pixel";

const defaultPageOptions: Partial<PageScreenshotParameter> = {
waitBeforeScreenshot: 2500

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be set on top level in lost pixel config! Page config params can help you override the top level ones 😀

}

export const config: CustomProjectConfig = {
pageShots: {
pages: [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be really cool if we found a way to generate the page list for your DS, recently we added support for programmatic page runs meaning you could generate the array, put it into json and host it statically on your ran website e.g. localhost:3000/pagesToTestWithLP.json and we just pick the info from there ✌🏼

{
path: "/elements/button",
name: "buttons",
...defaultPageOptions
},
{
path: "/elements/card",
name: "card",
...defaultPageOptions
},
{
path: "/elements/input-field",
name: "input-field",
...defaultPageOptions
},
],
baseUrl: "http://172.17.0.1:3333",
},
lostPixelProjectId: "clf6rcb5205pmmg0ehjcxzv68",
apiKey: process.env.LOST_PIXEL_API_KEY,
};
Loading