Skip to content

Commit

Permalink
chore: switch to dev branch
Browse files Browse the repository at this point in the history
Signed-off-by: drptbl <jakub.mucha@icloud.com>
  • Loading branch information
drptbl committed Nov 3, 2024
1 parent 5ff1cd2 commit 30d979a
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "new-dawn",
"baseBranch": "dev",
"updateInternalDependencies": "patch",
"ignore": []
}
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CodeQL
on:
push:
branches:
- new-dawn
- dev
pull_request:
schedule:
- cron: '0 6 * * 3'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🎨 Lint
on:
push:
branches:
- new-dawn
- dev
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: 🧑‍🔧 Test
on:
push:
branches:
- new-dawn
- dev
pull_request:
paths:
- '.github/actions/**/*.yml'
Expand Down
53 changes: 30 additions & 23 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -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 🔴 <a href="https://www.optimism.io/" target="_blank">Optimism</a>'
}
}
})
message:
'Supported by 🔴 <a href="https://www.optimism.io/" target="_blank">Optimism</a>',
},
},
});
2 changes: 1 addition & 1 deletion docs/docs/guides/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
72 changes: 44 additions & 28 deletions docs/docs/setupPlaywright.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
2 changes: 1 addition & 1 deletion examples/ethereum-wallet-mock/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# example-new-dawn
# example-ethereum-wallet-mock

## 0.0.3

Expand Down
2 changes: 1 addition & 1 deletion examples/metamask/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# example-new-dawn
# example-metamask

## 0.0.3

Expand Down

0 comments on commit 30d979a

Please sign in to comment.