Skip to content

Commit

Permalink
Merge branch 'tests/e2e' into feature/tests-end-to-end
Browse files Browse the repository at this point in the history
  • Loading branch information
verlok committed Apr 1, 2024
2 parents 5d0f425 + d0f70ca commit 217ce21
Show file tree
Hide file tree
Showing 18 changed files with 1,610 additions and 426 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:

- run: npm run build --if-present

- run: npm run test
- run: npm run test:unit
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,8 @@ node_modules

# Jekyll!
_site
.sass-cache
.sass-cache
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
79 changes: 79 additions & 0 deletions demos/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<title>Vanilla LazyLoad - Demo Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
ul,
li {
list-style-type: none;
margin: 0;
padding: 0;
}

li {
min-height: 280px;
}

a,
img {
display: block;
}

img {
border: 0;
width: 220px;
height: 280px;
}

img:not([src]):not([srcset]) {
visibility: hidden;
}
</style>
</head>
<body>
<h1>Demo list</h1>
<a href="async.html">async</a>
<a href="async_multiple.html">async_multiple</a>
<a href="background_images.html">background_images</a>
<a href="background_images_image-set.html">background_images_image</a>
<a href="background_images_multi.html">background_images_multi</a>
<a href="container_multiple.html">container_multiple</a>
<a href="container_single.html">container_single</a>
<a href="dynamic_content.html">dynamic_content</a>
<a href="dynamic_content_nodeset.html">dynamic_content_nodeset</a>
<a href="embedded.html">embedded</a>
<a href="error_no_restore.html">error_no_restore</a>
<a href="error_restore.html">error_restore</a>
<a href="esm.html">esm</a>
<a href="fade_in.html">fade_in</a>
<a href="hundreds.html">hundreds</a>
<a href="iframes.html">iframes</a>
<a href="image_basic.html">image_basic</a>
<a href="image_hidden.html">image_hidden</a>
<a href="image_no_classes.html">image_no_classes</a>
<a href="image_ph_external.html">image_ph_external</a>
<a href="image_ph_inline.html">image_ph_inline</a>
<a href="image_srcset.html">image_srcset</a>
<a href="image_srcset_lazy_sizes.html">image_srcset_lazy_sizes</a>
<a href="image_srcset_sizes.html">image_srcset_sizes</a>
<a href="lazily_load_lazyLoad.html">lazily_load_lazyLoad</a>
<a href="lazy_functions.html">lazy_functions</a>
<a href="load.html">load</a>
<a href="load_all.html">load_all</a>
<a href="native_lazyload.html">native_lazyload</a>
<a href="native_lazyload_conditional.html">native_lazyload_conditional</a>
<a href="object.html">object</a>
<a href="picture_media.html">picture_media</a>
<a href="picture_type_webp.html">picture_type_webp</a>
<a href="popup_layer.html">popup_layer</a>
<a href="print.html">print</a>
<a href="restore_destroy.html">restore_destroy</a>
<a href="sliders_css_only.html">sliders_css_only</a>
<a href="swiper.html">swiper</a>
<a href="thresholds.html">thresholds</a>
<a href="video.html">video</a>
<a href="video_autoplay.html">video_autoplay</a>
</body>
</html>
12 changes: 8 additions & 4 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// jest.config.js
/** @type {import('jest').Config} */
module.exports = {
//verbose: true,
testMatch: ["**/__tests__/*.js"],
testEnvironment: "jsdom"
verbose: true,
testMatch: ["<rootDir>/tests/unit/**/*.test.js"],
testEnvironment: 'jsdom',
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.js',
]
};
Loading

0 comments on commit 217ce21

Please sign in to comment.