forked from trent_larson/crowd-funder-for-time-pwa
Remove PWA test
Created a new branch for this specific test, instead
This commit is contained in:
@@ -1,27 +0,0 @@
|
|||||||
const { test, expect } = require('@playwright/test');
|
|
||||||
|
|
||||||
test('Install PWA', async ({ page, context }) => {
|
|
||||||
await page.goto('./');
|
|
||||||
|
|
||||||
// Wait for the service worker to register
|
|
||||||
await page.waitForSelector('service-worker-registered-indicator', {
|
|
||||||
timeout: 10000, // Adjust timeout according to your needs
|
|
||||||
});
|
|
||||||
|
|
||||||
// Trigger the install prompt manually
|
|
||||||
const [installPrompt] = await Promise.all([
|
|
||||||
page.waitForEvent('beforeinstallprompt'),
|
|
||||||
page.evaluate(() => {
|
|
||||||
window.dispatchEvent(new Event('beforeinstallprompt'));
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Accept the install prompt
|
|
||||||
await installPrompt.prompt();
|
|
||||||
|
|
||||||
// Check if the PWA was installed successfully
|
|
||||||
const result = await installPrompt.userChoice;
|
|
||||||
expect(result.outcome).toBe('accepted');
|
|
||||||
|
|
||||||
// Additional checks go here
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user