Skip to content

Commit

Permalink
fix: improve wallet injection and test configuration
Browse files Browse the repository at this point in the history
- Update README with bootstrap instructions
- Add no-sandbox flags to playwright config
- Enhance wallet injection logic in config.ts
- Update test timeouts and selectors
- Update yarn.lock files

Co-Authored-By: [email protected] <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and originalix committed Dec 25, 2024
1 parent f7a3b3e commit 01345ee
Show file tree
Hide file tree
Showing 6 changed files with 541 additions and 400 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

```bash
yarn
yarn bootstrap # Run bootstrap twice to resolve fast-safe-stringify dependency
yarn bootstrap
yarn build
```
Expand Down
15 changes: 13 additions & 2 deletions packages/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], viewport: { width: 1440, height: 800 } },
use: {
...devices['Desktop Chrome'],
viewport: { width: 1440, height: 800 },
launchOptions: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
},
},
{
name: 'Mobile Chrome',
use: { ...devices['iPhone 6'] },
use: {
...devices['iPhone 6'],
launchOptions: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
},
},
],
});
13 changes: 9 additions & 4 deletions packages/e2e/tests/connectButton/universal.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ test.describe('Connect Button Hack', () => {
// const startWebSite = 'app.vesper.finance';
// const startIdx = sitesConfig.findIndex((e) => e.urls.includes(startWebSite));
// const availableSites = sitesConfig.slice(startIdx == -1 ? 0 : startIdx);
const availableSites = sitesConfig
const siteFilter = process.env.SITE;
const availableSites = siteFilter
? sitesConfig.filter(site => site.urls.includes(siteFilter))
: sitesConfig;
const sitesOnly = availableSites.filter((e) => e.only);
const sites = sitesOnly.length > 0 ? sitesOnly : availableSites;
const sitesWithoutSkip = sites.filter((e) => (typeof e.skip === 'boolean' ? !e.skip : true))
const sitesWithoutSkip = sites.filter((e) => (typeof e.skip === 'boolean' ? !e.skip : true));

let testCounter = 0;
for (const site of sitesWithoutSkip) {
const {
urls,
Expand All @@ -42,7 +46,8 @@ test.describe('Connect Button Hack', () => {
testUrls,
} = site;
for (const url of testUrls || urls) {
test(url, async ({ page }, testInfo) => {
testCounter++;
test(`${url} (${sitesConfig.findIndex((e) => e.urls.includes(url))}-${testCounter})`, async ({ page }, testInfo) => {
const { project: { name }, } = testInfo;
const index = sitesConfig.findIndex((e) => e.urls.includes(url));
// @ts-ignore
Expand Down Expand Up @@ -119,4 +124,4 @@ test.describe('Connect Button Hack', () => {
});


// npx playwright test --headed tests/connectButton/universal.e2e.ts
// npx playwright test --headed tests/connectButton/universal.e2e.ts
Loading

0 comments on commit 01345ee

Please sign in to comment.