Skip to content

Commit

Permalink
test(cat-voices): playwright tests refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
emiride committed Oct 28, 2024
1 parent e257af5 commit 7c7e554
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
APP_URL=http://app:80
WALLET1_SEED_WORD=stomach,horn,rail,afraid,flip,also,abandon,speed,chaos,daring,soon,soft,okay,online,benefit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.12.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Introduction

Wallet automation is a testing package in Playwright that automates the wallet creation process for the Catalyst project. It is a part of the Catalyst Voices ecosystem.

## Getting Started

1. Clone this repository:

```sh
git clone
cd catalyst-voices
```

2. Install Flutter and Dart:

```sh
brew install flutter
```

3. Bootstrap the project:

```sh
melos bootstrap
```

4. Execute earthly command from this directory:

```sh
earthly +package-app
```

5. Use docker compose to run the app:

```sh
docker-compose up
```
The app should be running on `localhost:8000`.

6. You can now

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { defineConfig, devices } from '@playwright/test';
import dotenv from 'dotenv';
import path from 'path';

if (process.env.APP_URL == undefined){
throw new Error("APP_URL env variable undefined");
}
dotenv.config({ path: path.resolve(__dirname, '.env') });
// if (process.env.APP_URL == undefined){
// throw new Error("APP_URL env variable undefined");
// }

export default defineConfig({
testDir: '.',
testDir: './tests',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
Expand All @@ -19,14 +22,18 @@ export default defineConfig({
reporter: [['junit', { outputFile: '/results/cardano-wallet.junit-report.xml' }]],
timeout: 60 * 1000,
projects: [
{
name: 'setup',
testMatch: /global-setup\.ts/,
},
// {
// name: 'setup',
// testMatch: /global-setup\.ts/,
// },
// {
// name: 'chromium',
// use: { ...devices['Desktop Chrome'] },
// dependencies: ['setup']
// },
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
dependencies: ['setup']
use: { ...devices['Desktop Chrome'] }
},
]
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, chromium, expect, BrowserContext, Page } from '@playwright/test';
import { allowExtension, downloadExtension, getWalletCredentials, importWallet, signData, signDataBadPwd} from './utils';
import { allowExtension, downloadExtension, getWalletCredentials, importWallet, signData, signDataBadPwd} from '../utils';

let browser: BrowserContext;
let extensionPath: string;
Expand All @@ -13,9 +13,9 @@ let wallets =
wallets.forEach(({ name, id, url }) => {
test.describe(`Testing with ${name}`,() => {
test.skip(name === 'Typhon', 'https://github.com/input-output-hk/catalyst-voices/issues/753');
test.afterAll(async () => {
browser.close()
});
// test.afterAll(async () => {
// browser.close()
// });

test.beforeAll(async () => {
// Download extension and import wallet into wallet extension
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"types": ["node"], // Add this line
"typeRoots": ["./node_modules/@types"]
},
"exclude": ["node_modules", "dist"]
}

0 comments on commit 7c7e554

Please sign in to comment.