This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("expect no JavaScript error", () => { | |
let jsErrors = []; | |
let errorMessages = []; | |
jsErrors.forEach(error => errorMessages.push(error.message)); | |
let allowedJsErrors = page.allowedJsErrors | 0; | |
expect(jsErrors).to.have.length(allowedJsErrors, "array of javascript errors must be empty, but found " + jsErrors.length + " error(s):\r\n" + errorMessages) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof site.gtmCodes !== "undefined") { | |
site.gtmCodes.forEach(gtmCode => { | |
it("expect GTM-Code '" + gtmCode + "'", () => { | |
let gtmArray = Object.keys(getWindowVariable("google_tag_manager")); | |
expect(gtmArray).to.include(gtmCode, "GTM-Code not found in google_tag_manager array keys '" + gtmArray + "'"); | |
}); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before(() => { | |
browser.url(site.baseUrl + page.path).waitForVisible("body", 2000); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "sblum GmbH", | |
"short_name": "sblum", | |
"description": "sblum GmbH aus München", | |
"lang": "de", | |
"start_url": "./", | |
"display": "standalone", | |
"orientation": "any", | |
"background_color": "#fafafa", | |
"theme_color": "#9b348e", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="manifest" href="/manifest.json"> | |
<script> | |
if ("serviceWorker" in navigator) { | |
navigator.serviceWorker.register("sw.js"); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const VERSION = "1.0"; | |
const CACHE_VERSION = "sblum-offline-v" + VERSION; | |
const OFFLINE_URL = "/offline"; | |
let cacheablePages = [ | |
"/", | |
"/offline", | |
"/css/public.css", | |
"/fonts/font-awesome/fontawesome-webfont.woff2", | |
"/img/header/homepage.jpg", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cleanup old cache storages | |
self.addEventListener("activate", event => { | |
event.waitUntil( | |
caches.keys() | |
.then(cacheNames => { | |
return Promise.all( | |
cacheNames.map(cacheName => { | |
if (CACHE_VERSION !== cacheName) { | |
return caches.delete(cacheName); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener("fetch", (event) => { | |
event.respondWith( | |
caches.match(event.request) | |
.then(response => { | |
if (response) { | |
return response; | |
} | |
// Version #1: Cache all (!) responses and return error page | |
// Clone the request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class data | |
{ | |
private $data; | |
public function __construct($data) | |
{ | |
$this->data = $data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Demo; | |
use Demo\ProductList; | |
class ProductListTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testProductList() | |
{ |