diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index acdc0799..69a4644f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,4 +27,4 @@ jobs:
- run: npm run build --if-present
- - run: npm run test
+ - run: npm run test:unit
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
new file mode 100644
index 00000000..40e23f7e
--- /dev/null
+++ b/.github/workflows/playwright.yml
@@ -0,0 +1,27 @@
+name: Playwright Tests
+on:
+ push:
+ branches: [main, master, develop, "feature/**"]
+ 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
diff --git a/.gitignore b/.gitignore
index 59910fa5..23e10e36 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,54 +1,42 @@
-# Windows image file caches
Thumbs.db
ehthumbs.db
-# Folder config file
Desktop.ini
-# Recycle Bin used on file shares
$RECYCLE.BIN/
-# Windows Installer files
*.cab
*.msi
*.msm
*.msp
-# =========================
-# Operating System Files
-# =========================
-
-# OSX
-# =========================
-
.DS_Store
.AppleDouble
.LSOverride
-# Icon must end with two \r
Icon
-
-# Thumbnails
._*
-# Files that might appear on external disk
.Spotlight-V100
.Trashes
-# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
-# Editor files
.idea
-# Node modules
node_modules
-# Jekyll!
_site
-.sass-cache
\ No newline at end of file
+.sass-cache
+
+/test-results/
+/playwright-report/
+/blob-report/
+/playwright/.cache/
+
+coverage
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 53df447f..b592551a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
## Version 19
+#### 19.1.0
+
+- Added end to end tests to expand test coverage to more use cases and cross browser
+
#### 19.0.5
- Removed `.eslintrc.json`, `LICENSE`, `CHANGELOG.md`, `CODE_OF_CONDUCT.md`, `README.md`, `package.json` from the package files, as they didn't have any impact on [code quality](https://docs.npmjs.com/searching-for-and-choosing-packages-to-download#quality).
diff --git a/README.md b/README.md
index a9f8a561..d459ab25 100644
--- a/README.md
+++ b/README.md
@@ -176,7 +176,7 @@ Please note that the video poster can be lazily loaded too.
## 👩‍💻 Getting started - Script
-The latest, recommended version of LazyLoad is **19.0.5**.
+The latest, recommended version of LazyLoad is **19.1.0**.
Note that if you need to support Internet Explorer 11, you need to use version 17.9.0 or below.
Quickly understand how to upgrade from a previous version reading the [practical upgrade guide](UPGRADE.md).
@@ -186,7 +186,7 @@ Quickly understand how to upgrade from a previous version reading the [practical
The easiest way to use LazyLoad is to include the script from a CDN.
```html
-
+
```
OR, if you prefer to import it as an ES module:
@@ -237,7 +237,7 @@ Then include the script.
```html
```
@@ -271,7 +271,7 @@ Then include the script.
```html
```
diff --git a/demos/async.html b/demos/async.html
index 39a02292..118d4d78 100644
--- a/demos/async.html
+++ b/demos/async.html
@@ -47,7 +47,7 @@
Async loading demo
>
@@ -57,7 +57,7 @@ Async loading demo
>
@@ -67,7 +67,7 @@ Async loading demo
>
@@ -77,7 +77,7 @@ Async loading demo
>
@@ -87,7 +87,7 @@ Async loading demo
>
@@ -97,7 +97,7 @@ Async loading demo
>
@@ -107,7 +107,7 @@ Async loading demo
>
@@ -117,7 +117,7 @@ Async loading demo
>
@@ -127,7 +127,7 @@ Async loading demo
>
@@ -137,7 +137,7 @@ Async loading demo
>
@@ -147,7 +147,7 @@ Async loading demo
>
@@ -157,7 +157,7 @@ Async loading demo
>
@@ -167,7 +167,7 @@ Async loading demo
>
@@ -177,7 +177,7 @@ Async loading demo
>
@@ -187,7 +187,7 @@ Async loading demo
>
@@ -197,7 +197,7 @@ Async loading demo
>
@@ -207,7 +207,7 @@ Async loading demo
>
@@ -217,7 +217,7 @@ Async loading demo
>
@@ -227,7 +227,7 @@ Async loading demo
>
@@ -237,7 +237,7 @@ Async loading demo
>
@@ -247,7 +247,7 @@ Async loading demo
>
@@ -257,7 +257,7 @@ Async loading demo
>
@@ -267,7 +267,7 @@ Async loading demo
>
@@ -277,7 +277,7 @@ Async loading demo
>
@@ -287,7 +287,7 @@ Async loading demo
>
@@ -297,7 +297,7 @@ Async loading demo
>
@@ -307,7 +307,7 @@ Async loading demo
>
@@ -317,7 +317,7 @@ Async loading demo
>
@@ -327,7 +327,7 @@ Async loading demo
>
@@ -337,7 +337,7 @@ Async loading demo
>
@@ -347,7 +347,7 @@ Async loading demo
>
@@ -357,7 +357,7 @@ Async loading demo
>
@@ -367,7 +367,7 @@ Async loading demo
>
@@ -377,7 +377,7 @@ Async loading demo
>
@@ -387,7 +387,7 @@ Async loading demo
>
@@ -397,7 +397,7 @@ Async loading demo
>
@@ -407,7 +407,7 @@ Async loading demo
>
@@ -417,7 +417,7 @@ Async loading demo
>
@@ -427,7 +427,7 @@ Async loading demo
>
@@ -437,7 +437,7 @@ Async loading demo
>
@@ -464,7 +464,7 @@ Async loading demo
var callback_error = function (element) {
logElementEvent("đź’€ ERROR", element);
element.src =
- "https://via.placeholder.com/440x560/?text=Error+Placeholder";
+ "./images/440x560-Error.webp";
};
var callback_finish = function () {
logElementEvent("✔️ FINISHED", document.documentElement);
diff --git a/demos/async_multiple.html b/demos/async_multiple.html
index 5b080d45..524d9c11 100644
--- a/demos/async_multiple.html
+++ b/demos/async_multiple.html
@@ -51,7 +51,7 @@ Async loading, multiple instances demo
@@ -60,7 +60,7 @@ Async loading, multiple instances demo
@@ -70,7 +70,7 @@ Async loading, multiple instances demo
>
@@ -80,7 +80,7 @@ Async loading, multiple instances demo
>
@@ -90,7 +90,7 @@ Async loading, multiple instances demo
>
@@ -100,7 +100,7 @@ Async loading, multiple instances demo
>
@@ -110,7 +110,7 @@ Async loading, multiple instances demo
>
@@ -120,7 +120,7 @@ Async loading, multiple instances demo
>
@@ -130,7 +130,7 @@ Async loading, multiple instances demo
>
@@ -140,7 +140,7 @@ Async loading, multiple instances demo
>
@@ -150,7 +150,7 @@ Async loading, multiple instances demo
>
@@ -160,7 +160,7 @@ Async loading, multiple instances demo
>
@@ -170,7 +170,7 @@ Async loading, multiple instances demo
>
@@ -180,7 +180,7 @@ Async loading, multiple instances demo
>
@@ -190,7 +190,7 @@ Async loading, multiple instances demo
>
@@ -200,7 +200,7 @@ Async loading, multiple instances demo
>
@@ -210,7 +210,7 @@ Async loading, multiple instances demo
>
@@ -220,7 +220,7 @@ Async loading, multiple instances demo
>
@@ -230,7 +230,7 @@ Async loading, multiple instances demo
>
@@ -243,7 +243,7 @@ Async loading, multiple instances demo
@@ -252,7 +252,7 @@ Async loading, multiple instances demo
@@ -262,7 +262,7 @@ Async loading, multiple instances demo
>
@@ -272,7 +272,7 @@ Async loading, multiple instances demo
>
@@ -282,7 +282,7 @@ Async loading, multiple instances demo
>
@@ -292,7 +292,7 @@ Async loading, multiple instances demo
>
@@ -302,7 +302,7 @@ Async loading, multiple instances demo
>
@@ -312,7 +312,7 @@ Async loading, multiple instances demo
>
@@ -322,7 +322,7 @@ Async loading, multiple instances demo
>
@@ -332,7 +332,7 @@ Async loading, multiple instances demo
>
@@ -342,7 +342,7 @@ Async loading, multiple instances demo
>
@@ -352,7 +352,7 @@ Async loading, multiple instances demo
>
@@ -362,7 +362,7 @@ Async loading, multiple instances demo
>
@@ -372,7 +372,7 @@ Async loading, multiple instances demo
>
@@ -382,7 +382,7 @@ Async loading, multiple instances demo
>
@@ -392,7 +392,7 @@ Async loading, multiple instances demo
>
@@ -402,7 +402,7 @@ Async loading, multiple instances demo
>
@@ -412,7 +412,7 @@ Async loading, multiple instances demo
>
@@ -422,7 +422,7 @@ Async loading, multiple instances demo
>
@@ -432,7 +432,7 @@ Async loading, multiple instances demo
>
@@ -442,7 +442,7 @@ Async loading, multiple instances demo
>
@@ -471,7 +471,7 @@ Async loading, multiple instances demo
var callback_error = function (element) {
logElementEvent("đź’€ ERROR", element);
element.src =
- "https://via.placeholder.com/440x560/?text=Error+Placeholder";
+ "./images/440x560-Error.webp";
};
var callback_finish = function () {
logElementEvent("✔️ FINISHED", document.documentElement);
diff --git a/demos/background_images.html b/demos/background_images.html
index 420d9211..67b80738 100644
--- a/demos/background_images.html
+++ b/demos/background_images.html
@@ -35,297 +35,297 @@ Background images demo
-
+
-
+
-
+
@@ -350,8 +350,7 @@ Background images demo
};
var callback_error = function (element) {
logElementEvent("đź’€ ERROR", element);
- element.style.backgroundImage =
- "url('https://via.placeholder.com/440x560/?text=Error+Placeholder')";
+ element.style.backgroundImage = 'url("./images/440x560-Error.webp")';
};
var callback_finish = function () {
logElementEvent("✔️ FINISHED", document.documentElement);
diff --git a/demos/background_images_image-set.html b/demos/background_images_image-set.html
index 2a1a0ff9..c5fa134a 100644
--- a/demos/background_images_image-set.html
+++ b/demos/background_images_image-set.html
@@ -35,13 +35,9 @@ Background images with image-set
demo
@@ -51,20 +47,13 @@ Background images with image-set
demo
class="multiple"
href="#"
style="
- background-image: -webkit-image-set(
- url('https://via.placeholder.com/220x280?text=Img+02+Left') 1x,
- url('https://via.placeholder.com/440x560?text=Img+02+Left') 2x
- ), -webkit-image-set(
- url('https://via.placeholder.com/220x280?text=Img+02+Right') 1x,
- url('https://via.placeholder.com/440x560?text=Img+02+Right') 2x
- );
background-image: image-set(
- url('https://via.placeholder.com/220x280?text=Img+02+Left') 1x,
- url('https://via.placeholder.com/440x560?text=Img+02+Left') 2x
+ url('./images/220x280-L-02.webp') 1x,
+ url('./images/440x560-L-02.webp') 2x
),
image-set(
- url('https://via.placeholder.com/220x280?text=Img+02+Right') 1x,
- url('https://via.placeholder.com/440x560?text=Img+02+Right') 2x
+ url('./images/220x280-R-02.webp') 1x,
+ url('./images/440x560-R-02.webp') 2x
);
"
>
@@ -73,262 +62,259 @@ Background images with image-set
demo
@@ -353,8 +339,7 @@ Background images with image-set
demo
};
var callback_error = function (element) {
logElementEvent("đź’€ ERROR", element);
- element.style.backgroundImage =
- "url('https://via.placeholder.com/440x560/?text=Error+Placeholder')";
+ element.style.backgroundImage = 'url("./images/440x560-Error.webp")';
};
var callback_finish = function () {
logElementEvent("✔️ FINISHED", document.documentElement);
diff --git a/demos/background_images_multi.html b/demos/background_images_multi.html
index c35cd227..2c80a7fc 100644
--- a/demos/background_images_multi.html
+++ b/demos/background_images_multi.html
@@ -2,9 +2,7 @@
-
- Multiple background images - Lazyload demos
-
+ Multiple background images - Lazyload demos
-
+ /* Fixes Firefox anomaly during image load */
+ @-moz-document url-prefix() {
+ img:-moz-loading {
+ visibility: hidden;
+ }
+ }
+
+
-
- Native lazy loading demo
-
- You can use this page to test browsers' implementations of
- native lazy loading.
- Please note that not even one line of JavaScript code is involved here.
-
-
-
-
-
-
-
+
+ Native lazy loading demo
+
+ You can use this page to test browsers' implementations of
+ native lazy loading.
+ Please note that not even one line of JavaScript code is involved here.
+
+
+
+
+
+
+