Skip to content

Commit

Permalink
fix: e2e failing when crx name is set to Fuel Wallet (#1509)
Browse files Browse the repository at this point in the history
- Fixed e2e flakiness due to the use of wrong connector/VITE_CRX_NAME
pair
- Adds errors warning when required env var is not set
  • Loading branch information
arthurgeron authored Sep 26, 2024
1 parent 0d135e6 commit 773c5b9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-squids-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels-wallet": patch
---

Fixed e2e flakiness due to the use of wrong connector/VITE_CRX_NAME pair
25 changes: 21 additions & 4 deletions packages/app/playwright/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
import { FuelWalletDevelopmentConnector } from '@fuels/connectors';
import { Address, Fuel, Provider } from 'fuels';
import {
FuelWalletConnector,
FuelWalletDevelopmentConnector,
} from '@fuels/connectors';
import { Address, Fuel } from 'fuels';
import { VITE_CRX_NAME } from '../src/config';

localStorage.clear();

const connectors = [];

// Do not change this. This fixes e2e flakyness triggered by different env variables.
switch (VITE_CRX_NAME) {
case 'Fuel Wallet Development':
connectors.push(new FuelWalletDevelopmentConnector());
break;
case 'Fuel Wallet':
connectors.push(new FuelWalletConnector());
break;
default:
throw new Error('VITE_CRX_NAME is not set to a valid value');
}

window.fuel = new Fuel({
connectors: [new FuelWalletDevelopmentConnector()],
connectors,
});

window.createAddress = (address: string) => Address.fromString(address);

0 comments on commit 773c5b9

Please sign in to comment.