This file contains hidden or 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
| var ghpages = require('gh-pages'); | |
| ghpages.publish( | |
| 'public', // path to public directory | |
| { | |
| branch: 'gh-pages', | |
| repo: 'https://github.com/el3um4s/petits-chevaux.git', // Update to point to your repository | |
| user: { | |
| name: 'Samuele', // update to use your name | |
| email: 'samuele@stranianelli.com' // Update to use your email |
This file contains hidden or 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
| import preprocess from 'svelte-preprocess'; | |
| import adapter from '@sveltejs/adapter-static'; | |
| /** @type {import('@sveltejs/kit').Config} */ | |
| const config = { | |
| preprocess: preprocess(), | |
| kit: { | |
| target: '#svelte', | |
| adapter: adapter({ | |
| pages: 'build', // path to public directory |
This file contains hidden or 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 windowState = await electronApp.evaluate(async ({ BrowserWindow }) => { | |
| const mainWindow = BrowserWindow.getAllWindows()[0]; | |
| const getState = () => ({ | |
| isVisible: mainWindow.isVisible(), | |
| isDevToolsOpened: mainWindow.webContents.isDevToolsOpened(), | |
| isCrashed: mainWindow.webContents.isCrashed(), | |
| }); | |
| return new Promise((resolve) => { |
This file contains hidden or 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
| import { _electron as electron } from "playwright"; | |
| import { test, expect } from "@playwright/test"; | |
| test("Launch electron app", async () => { | |
| const electronApp = await electron.launch({ args: ["."] }); | |
| const windowState: { | |
| isVisible: boolean; | |
| isDevToolsOpened: boolean; | |
| isCrashed: boolean; |
This file contains hidden or 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
| test.describe("Check Man Page", async () => { | |
| let electronApp: ElectronApplication; | |
| let firstWindow: Page; | |
| test.beforeAll(async () => { | |
| electronApp = await electron.launch({ args: ["."] }); | |
| firstWindow = await electronApp.firstWindow(); | |
| }); | |
| // ... |
This file contains hidden or 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
| test("Check title", async () => { | |
| const title = await firstWindow.title(); | |
| expect(title).toBe("MEMENTO - Svelte, TailwindCSS, Electron and TypeScript"); | |
| }); |
This file contains hidden or 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
| test("Check version number: APP", async () => { | |
| const versionNumberApp = await firstWindow.innerText( | |
| "data-testid=version-number-app" | |
| ); | |
| expect(versionNumberApp).not.toBe("-"); | |
| const isValidNumberApp = semver.valid(semver.coerce(versionNumberApp)); | |
| expect(semver.valid(isValidNumberApp)).not.toBeNull(); | |
| }); |
This file contains hidden or 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
| test("Check Screenshot", async () => { | |
| await firstWindow.screenshot({ path: "tests/screenshot/firstWindow.png" }); | |
| expect(await firstWindow.screenshot()).toMatchSnapshot("firstWindow.png"); | |
| }); |
This file contains hidden or 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
| import { PlaywrightTestConfig } from "@playwright/test"; | |
| const config: PlaywrightTestConfig = { | |
| testDir: "./tests", | |
| expect: { | |
| toMatchSnapshot: { threshold: 0.2 }, | |
| }, | |
| }; | |
| export default config; |
This file contains hidden or 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
| let context: BrowserContext; | |
| test.beforeAll(async () => { | |
| electronApp = await electron.launch({ args: ["."] }); | |
| context = electronApp.context(); | |
| await context.tracing.start({ screenshots: true, snapshots: true }); | |
| firstWindow = await electronApp.firstWindow(); | |
| await firstWindow.screenshot({ path: "tests/screenshot/firstWindow.png" }); | |
| expect(await firstWindow.screenshot()).toMatchSnapshot("firstWindow.png"); |
OlderNewer