Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playwright test for ReefKnot #203

Merged
merged 31 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2957649
feat: create playwright test for reef-knot
jake4take Nov 20, 2024
50ab383
fix: fix env naming
jake4take Nov 29, 2024
9c69efb
fix: fix env naming
jake4take Nov 29, 2024
d9051e6
fix: fixed the setup extension process
jake4take Nov 29, 2024
bcedc93
fix: some fixes after review
jake4take Dec 4, 2024
dafb5e9
Merge branch 'main' of github.com:lidofinance/reef-knot into playwrig…
jake4take Dec 4, 2024
fdfb991
chore: merge with main
jake4take Dec 4, 2024
d94114f
fix: fix test.yaml
jake4take Dec 4, 2024
0a2660e
fix: fix test.yaml
jake4take Dec 4, 2024
02be069
fix: fix test.yaml
jake4take Dec 4, 2024
e91f8c5
fix: fix test.yaml
jake4take Dec 5, 2024
9b1957c
fix: fix test.yaml
jake4take Dec 5, 2024
d55bb14
fix: fix test.yaml
jake4take Dec 5, 2024
8967f64
fix: fix test.yaml
jake4take Dec 5, 2024
94a7c52
fix: fix test.yaml
jake4take Dec 5, 2024
bda5e06
fix: config fixes
jake4take Dec 5, 2024
2bfb564
fix: fix test.yaml
jake4take Dec 5, 2024
a2a4508
fix: fix reporter config
jake4take Dec 5, 2024
73d13b7
fix: fix tags
jake4take Dec 5, 2024
4e5ecf6
fix: fix reporter
jake4take Dec 5, 2024
b1888d3
fix: fix tests
jake4take Dec 5, 2024
bc0d644
fix: fixes after review
jake4take Dec 12, 2024
5103968
fix: fix initWalletSetup()
jake4take Dec 12, 2024
8bdc461
test: update wallets=testing-modules version
jake4take Dec 23, 2024
5d6c703
fix: check the stat ETH balance with SDK (instead of wallet balance)
jake4take Dec 24, 2024
b670095
chore: remove test run for pull request
jake4take Dec 24, 2024
3e8876d
feat: add test of stake tx
jake4take Dec 28, 2024
07b2b43
fix: fix report config naming
jake4take Dec 28, 2024
21a9242
fix: decreased Ubuntu version to 22.04 for the CI workflow test run
jake4take Jan 9, 2025
9332de2
fix: fixes after review
jake4take Jan 10, 2025
b9f3545
fix: fix import path
jake4take Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: fix env naming
  • Loading branch information
jake4take committed Nov 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 50ab383b959f66f26d3b4a2535732a74ce137f3e
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @lidofinance/lido-si
* @lidofinance/lido-si
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ name: Test ReefKnot
on:
workflow_dispatch:
inputs:
STAND_TYPE:
description: 'Stand type'
STAND_ENV:
description: 'Stand env'
required: true
type: choice
default: testnet
@@ -21,8 +21,8 @@ jobs:
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
WALLET_SECRET_PHRASE: ${{ secrets.WALLET_SECRET_PHRASE }}
WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD }}
STAND_TYPE: ${{ github.event.inputs.STAND_TYPE }}
STAND_LINK_TYPE: testnet
STAND_ENV: ${{ github.event.inputs.STAND_ENV }}
STAND_TYPE: stand
NODE_OPTIONS: --max-old-space-size=4096

steps:
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -38,4 +38,4 @@ yarn-error.log*

# editors
.idea
.vscode
.vscode
6 changes: 3 additions & 3 deletions playwright-tests/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### Playwright test run .env configuration

# Stand type for the wallet setup. Can be equal: testnet, mainnet
STAND_TYPE=testnet
# Stand env for the wallet setup. Can be equal: testnet, mainnet
STAND_ENV=testnet

# Link type for a test run. Can be equal: testnet, localhost
STAND_LINK_TYPE=testnet
STAND_TYPE=testnet

# Wallet configurations
## Secret phase of the wallet to set up the wallet extension
33 changes: 10 additions & 23 deletions playwright-tests/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,22 @@
import { STAND_CONFIGS, STAND_LINK, STAND_TYPE } from './env.config';
import { STAND_CONFIGS, STAND_LINK, STAND_ENV } from './env.config';
import * as dotenv from 'dotenv';
import * as path from 'path';

dotenv.config({ path: path.resolve(__dirname, '../.env') });

export const REEF_KNOT_CONFIG = {
STAND_TYPE: getStandType(),
STAND_TYPE: process.env.STAND_TYPE,
STAND_CONFIG: getStandConfig(),
STAND_URL: getStandUrl(),
STAND_LINK_TYPE: process.env.STAND_LINK_TYPE,
STAND_ENV: process.env.STAND_ENV,
};

function getStandType() {
switch (process.env.STAND_TYPE) {
case 'mainnet':
return STAND_TYPE.mainnet;
case 'testnet':
return STAND_TYPE.testnet;
default:
throw Error(
`CONFIG_VALIDATION_ERROR: STAND_TYPE is not correctly defined (value is "${process.env.STAND_TYPE}")`,
);
}
}

function getStandConfig() {
switch (process.env.STAND_TYPE) {
switch (process.env.STAND_ENV) {
case 'mainnet':
return STAND_CONFIGS.get(STAND_TYPE.mainnet);
return STAND_CONFIGS.get(STAND_ENV.mainnet);
case 'testnet':
return STAND_CONFIGS.get(STAND_TYPE.testnet);
return STAND_CONFIGS.get(STAND_ENV.testnet);
default:
throw Error(
`CONFIG_VALIDATION_ERROR: STAND_TYPE is not correctly defined (value is "${process.env.STAND_TYPE}")`,
@@ -38,14 +25,14 @@ function getStandConfig() {
}

function getStandUrl() {
switch (process.env.STAND_LINK_TYPE) {
case 'testnet':
return STAND_LINK.testnet;
switch (process.env.STAND_TYPE) {
case 'stand':
return STAND_LINK.stand;
case 'localhost':
return STAND_LINK.localhost;
itaven marked this conversation as resolved.
Show resolved Hide resolved
default:
throw Error(
`CONFIG_VALIDATION_ERROR: STAND_LINK_TYPE is not correctly defined (value is "${process.env.STAND_LINK_TYPE}")`,
`CONFIG_VALIDATION_ERROR: STAND_TYPE is not correctly defined (value is "${process.env.STAND_TYPE}")`,
);
}
}
8 changes: 4 additions & 4 deletions playwright-tests/config/env.config.ts
Original file line number Diff line number Diff line change
@@ -11,19 +11,19 @@ export interface StandConfig {
};
}

export const STAND_TYPE = {
export const STAND_ENV = {
testnet: 'testnet',
mainnet: 'mainnet',
};

export const STAND_LINK = {
testnet: 'https://lidofinance.github.io/reef-knot/',
stand: 'https://lidofinance.github.io/reef-knot/',
localhost: 'http://localhost:3000/',
};

export const STAND_CONFIGS = new Map<string, StandConfig>([
[
STAND_TYPE.testnet,
STAND_ENV.testnet,
{
chainId: 17000,
tokenSymbol: 'ETH',
@@ -38,7 +38,7 @@ export const STAND_CONFIGS = new Map<string, StandConfig>([
},
],
[
STAND_TYPE.mainnet,
STAND_ENV.mainnet,
{
chainId: 1,
tokenSymbol: 'ETH',