-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
123 changed files
with
4,354 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Function: initPhantom() | ||
|
||
```ts | ||
function initPhantom(): Promise<{ | ||
"browserArgs": string[]; | ||
"extensions": string[]; | ||
}> | ||
``` | ||
|
||
Initializes Phantom for Cypress tests. | ||
|
||
This function prepares the Phantom extension for use in Cypress tests. | ||
It sets up the necessary browser arguments and extension paths. | ||
|
||
## Returns | ||
|
||
`Promise`\<\{ | ||
`"browserArgs"`: `string`[]; | ||
`"extensions"`: `string`[]; | ||
\}\> | ||
|
||
An object containing the extension path and browser arguments. | ||
|
||
| Member | Type | | ||
| :------ | :------ | | ||
| `browserArgs` | `string`[] | | ||
| `extensions` | `string`[] | | ||
|
||
## Async |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { downloadFile, ensureCacheDirExists, unzipArchivePhantom } from '.' | ||
|
||
export const DEFAULT_PHANTOM_VERSION = 'latest' | ||
export const PHANTOM_EXTENSION_DOWNLOAD_URL = 'https://crx-backup.phantom.dev/latest.crx' | ||
|
||
// NOTE: This function is copied from `wallets/phantom/src/prepareExtensionPhantom.ts` only TEMPORARILY! | ||
export async function prepareExtensionPhantom() { | ||
const cacheDirPath = ensureCacheDirExists() | ||
|
||
const downloadResult = await downloadFile({ | ||
url: PHANTOM_EXTENSION_DOWNLOAD_URL, | ||
outputDir: cacheDirPath, | ||
fileName: 'phantom-chrome-latest.crx' | ||
}) | ||
|
||
const unzipResult = await unzipArchivePhantom({ | ||
archivePath: downloadResult.filePath | ||
}) | ||
|
||
return unzipResult.outputPath | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ | |
"src", | ||
"test" | ||
], | ||
"files": ["environment.d.ts"] | ||
"files": ["environment.d.ts", "unzip-crx-3.d.ts"] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module 'unzip-crx-3' |
Oops, something went wrong.