diff --git a/.changeset/config.json b/.changeset/config.json index 7833f90d9..85ee38cbb 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -5,7 +5,7 @@ "fixed": [], "linked": [], "access": "public", - "baseBranch": "new-dawn", + "baseBranch": "dev", "updateInternalDependencies": "patch", "ignore": [] } diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fb41c89d1..4fbeab466 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -3,7 +3,7 @@ name: CodeQL on: push: branches: - - new-dawn + - dev pull_request: schedule: - cron: '0 6 * * 3' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8f5e917e1..2a80275dc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ name: 🎨 Lint on: push: branches: - - new-dawn + - dev pull_request: jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 570f97d8d..c8ac3ab04 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: 🧑‍🔧 Test on: push: branches: - - new-dawn + - dev pull_request: paths: - '.github/actions/**/*.yml' diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b4b97f326..c40baf78a 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,50 +1,57 @@ -import { defineConfig } from 'vitepress' -import { sidebar } from './sidebar' +import { defineConfig } from "vitepress"; +import { sidebar } from "./sidebar"; -const pkg = await import('../node_modules/@synthetixio/synpress/package.json') +const pkg = await import("../node_modules/@synthetixio/synpress/package.json"); // https://vitepress.dev/reference/site-config export default defineConfig({ cleanUrls: true, - title: 'Synpress', - description: 'E2E testing library for Web3 dapps.', + title: "Synpress", + description: "E2E testing library for Web3 dapps.", lastUpdated: true, - head: [['link', { rel: 'icon', href: '/favicon.ico' }]], + head: [["link", { rel: "icon", href: "/favicon.ico" }]], themeConfig: { editLink: { - pattern: 'https://github.com/Synthetixio/synpress/tree/new-dawn/docs/:path', - text: 'Suggest changes to this page' + pattern: "https://github.com/Synthetixio/synpress/tree/dev/docs/:path", + text: "Suggest changes to this page", }, externalLinkIcon: true, // https://vitepress.dev/reference/default-theme-config nav: [ - { text: 'Docs', link: '/docs/getting-started' }, - { text: 'API', link: '/api/index/' }, - { text: 'Examples', link: 'https://github.com/Synthetixio/synpress/tree/new-dawn/examples' }, + { text: "Docs", link: "/docs/getting-started" }, + { text: "API", link: "/api/index/" }, + { + text: "Examples", + link: "https://github.com/Synthetixio/synpress/tree/dev/examples", + }, { text: pkg.version, items: [ // TODO: Add changelog { - text: 'Check out our Discord!', - link: 'https://discord.gg/XhZKSRGtWc' - } - ] - } + text: "Check out our Discord!", + link: "https://discord.gg/XhZKSRGtWc", + }, + ], + }, ], sidebar, socialLinks: [ - { icon: 'github', link: 'https://github.com/Synthetixio/synpress/tree/new-dawn' }, - { icon: 'discord', link: 'https://discord.gg/XhZKSRGtWc' }, - { icon: 'x', link: 'https://twitter.com/Synpress_' } + { + icon: "github", + link: "https://github.com/Synthetixio/synpress/tree/dev", + }, + { icon: "discord", link: "https://discord.gg/XhZKSRGtWc" }, + { icon: "x", link: "https://twitter.com/Synpress_" }, ], footer: { - message: 'Supported by 🔴 Optimism' - } - } -}) + message: + 'Supported by 🔴 Optimism', + }, + }, +}); diff --git a/docs/docs/guides/ci.md b/docs/docs/guides/ci.md index d10f82a3c..5c134de41 100644 --- a/docs/docs/guides/ci.md +++ b/docs/docs/guides/ci.md @@ -14,4 +14,4 @@ Running Synpress on CI is very similar to running Playwright on CI. The only dif The `xvfb-run` is required here in both steps because Synpress and Playwright must run in the headful mode on CI. See the [Known Issues](/docs/known-issues) section for an explanation of why this is the case. ::: -For a complete example of a CI configuration, see [this file](https://github.com/Synthetixio/synpress/blob/new-dawn/.github/workflows/test.yml#L30), which we use internally to run Synpress tests on GitHub Actions. +For a complete example of a CI configuration, see [this file](https://github.com/Synthetixio/synpress/blob/dev/.github/workflows/test.yml#L30), which we use internally to run Synpress tests on GitHub Actions. diff --git a/docs/docs/setupPlaywright.md b/docs/docs/setupPlaywright.md index 0bf7f6cf4..611065ede 100644 --- a/docs/docs/setupPlaywright.md +++ b/docs/docs/setupPlaywright.md @@ -29,26 +29,26 @@ This guide provides a quick setup process for Playwright with Synpress to automa ```typescript // Import necessary Playwright and Synpress modules - import { defineConfig, devices } from '@playwright/test'; - import { synpressFixtures } from '@synthetixio/synpress/synpress'; + import { defineConfig, devices } from "@playwright/test"; + import { synpressFixtures } from "@synthetixio/synpress/synpress"; // Define Playwright configuration export default defineConfig({ - testDir: './tests', + testDir: "./tests", fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, - reporter: 'html', + reporter: "html", use: { // Set base URL for tests - baseURL: 'http://localhost:3000', - trace: 'on-first-retry', + baseURL: "http://localhost:3000", + trace: "on-first-retry", }, projects: [ { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, + name: "chromium", + use: { ...devices["Desktop Chrome"] }, }, ], // Additional Synpress-specific configuration can be added here @@ -58,63 +58,79 @@ This guide provides a quick setup process for Playwright with Synpress to automa 2. Create a `BasicSetup` file (e.g., `wallet-setup/basic.setup.ts`): ```typescript - import { defineWalletSetup } from '@synthetixio/synpress-cache' - import { MetaMask } from '@synthetixio/synpress' + import { defineWalletSetup } from "@synthetixio/synpress-cache"; + import { MetaMask } from "@synthetixio/synpress"; // Define a test seed phrase and password - export const SEED_PHRASE = 'test test test test test test test test test test test junk' - export const PASSWORD = 'Tester@1234' + export const SEED_PHRASE = + "test test test test test test test test test test test junk"; + export const PASSWORD = "Tester@1234"; // Define the basic wallet setup export default defineWalletSetup(PASSWORD, async (context, walletPage) => { // Create a new MetaMask instance - const metamask = new MetaMask(context, walletPage, PASSWORD) + const metamask = new MetaMask(context, walletPage, PASSWORD); // Import the wallet using the seed phrase - await metamask.importWallet(SEED_PHRASE) - + await metamask.importWallet(SEED_PHRASE); + // Additional setup steps can be added here, such as: // - Adding custom networks // - Importing tokens // - Setting up specific account states - }) + }); ``` 3. Create a simple test file (e.g., `tests/example.spec.ts`): ```typescript // Import necessary Synpress modules and setup - import { testWithSynpress, MetaMask, unlockForFixture } from '@synthetixio/synpress' - import BasicSetup from '../wallet-setup/basic.setup' + import { + testWithSynpress, + MetaMask, + unlockForFixture, + } from "@synthetixio/synpress"; + import BasicSetup from "../wallet-setup/basic.setup"; // Create a test instance with Synpress and BasicSetup - const test = testWithSynpress(BasicSetup, unlockForFixture) + const test = testWithSynpress(BasicSetup, unlockForFixture); // Extract expect function from test - const { expect } = test + const { expect } = test; // Define a basic test case - test('should connect wallet to the MetaMask Test Dapp', async ({ context, page, extensionId }) => { + test("should connect wallet to the MetaMask Test Dapp", async ({ + context, + page, + extensionId, + }) => { // Create a new MetaMask instance - const metamask = new MetaMask(context, page, BasicSetup.walletPassword, extensionId) + const metamask = new MetaMask( + context, + page, + BasicSetup.walletPassword, + extensionId + ); // Navigate to the homepage - await page.goto('/') + await page.goto("/"); // Click the connect button - await page.locator('#connectButton').click() + await page.locator("#connectButton").click(); // Connect MetaMask to the dapp - await metamask.connectToDapp() + await metamask.connectToDapp(); // Verify the connected account address - await expect(page.locator('#accounts')).toHaveText('0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266') + await expect(page.locator("#accounts")).toHaveText( + "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266" + ); // Additional test steps can be added here, such as: // - Sending transactions // - Interacting with smart contracts // - Testing dapp-specific functionality - }) + }); ``` ## Running Tests @@ -134,5 +150,5 @@ This will execute your tests using Playwright with Synpress integration. ## Next Steps - Check the [API documentation](/api/) for detailed Synpress functionalities. -- Explore example projects in the [Synpress GitHub repository](https://github.com/Synthetixio/synpress/tree/new-dawn/examples). +- Explore example projects in the [Synpress GitHub repository](https://github.com/Synthetixio/synpress/tree/dev/examples). - Join our [Discord community](https://discord.gg/XhZKSRGtWc) for support and best practices. diff --git a/examples/ethereum-wallet-mock/CHANGELOG.md b/examples/ethereum-wallet-mock/CHANGELOG.md index 7cf672490..5eb6efe5a 100644 --- a/examples/ethereum-wallet-mock/CHANGELOG.md +++ b/examples/ethereum-wallet-mock/CHANGELOG.md @@ -1,4 +1,4 @@ -# example-new-dawn +# example-ethereum-wallet-mock ## 0.0.3 diff --git a/examples/metamask/CHANGELOG.md b/examples/metamask/CHANGELOG.md index 7cf672490..dbb175c7d 100644 --- a/examples/metamask/CHANGELOG.md +++ b/examples/metamask/CHANGELOG.md @@ -1,4 +1,4 @@ -# example-new-dawn +# example-metamask ## 0.0.3